ReplacementSpan.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
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
17package android.text.style;
18
19import android.graphics.Paint;
20import android.graphics.Canvas;
21import android.text.TextPaint;
22
23public abstract class ReplacementSpan extends MetricAffectingSpan {
24
25    public abstract int getSize(Paint paint, CharSequence text,
26                         int start, int end,
27                         Paint.FontMetricsInt fm);
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     */
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     */
42    public void updateDrawState(TextPaint ds) { }
43}
44