1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.text.style; 18 19 import android.graphics.Paint; 20 import android.graphics.Canvas; 21 import android.text.TextPaint; 22 23 public abstract class ReplacementSpan extends MetricAffectingSpan { 24 getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)25 public abstract int getSize(Paint paint, CharSequence text, 26 int start, int end, 27 Paint.FontMetricsInt fm); draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)28 public abstract void draw(Canvas canvas, CharSequence text, 29 int start, int end, float x, 30 int top, int y, int bottom, Paint paint); 31 32 /** 33 * This method does nothing, since ReplacementSpans are measured 34 * explicitly instead of affecting Paint properties. 35 */ updateMeasureState(TextPaint p)36 public void updateMeasureState(TextPaint p) { } 37 38 /** 39 * This method does nothing, since ReplacementSpans are drawn 40 * explicitly instead of affecting Paint properties. 41 */ updateDrawState(TextPaint ds)42 public void updateDrawState(TextPaint ds) { } 43 } 44