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.text.TextPaint; 21 22 /** 23 * The classes that affect the height of the line should implement this interface. 24 */ 25 public interface LineHeightSpan extends ParagraphStyle, WrapTogetherSpan { 26 /** 27 * Classes that implement this should define how the height is being calculated. 28 * 29 * @param text the text 30 * @param start the start of the line 31 * @param end the end of the line 32 * @param spanstartv the start of the span 33 * @param lineHeight the line height 34 * @param fm font metrics of the paint, in integers 35 */ chooseHeight(CharSequence text, int start, int end, int spanstartv, int lineHeight, Paint.FontMetricsInt fm)36 public void chooseHeight(CharSequence text, int start, int end, 37 int spanstartv, int lineHeight, 38 Paint.FontMetricsInt fm); 39 40 /** 41 * The classes that affect the height of the line with respect to density, should implement this 42 * interface. 43 */ 44 public interface WithDensity extends LineHeightSpan { 45 46 /** 47 * Classes that implement this should define how the height is being calculated. 48 * 49 * @param text the text 50 * @param start the start of the line 51 * @param end the end of the line 52 * @param spanstartv the start of the span 53 * @param lineHeight the line height 54 * @param paint the paint 55 */ chooseHeight(CharSequence text, int start, int end, int spanstartv, int lineHeight, Paint.FontMetricsInt fm, TextPaint paint)56 public void chooseHeight(CharSequence text, int start, int end, 57 int spanstartv, int lineHeight, 58 Paint.FontMetricsInt fm, TextPaint paint); 59 } 60 } 61