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; 18 19 /** 20 * When an object of this type is attached to a Spannable, its methods 21 * will be called to notify it that other markup objects have been 22 * added, changed, or removed. 23 */ 24 @android.ravenwood.annotation.RavenwoodKeepWholeClass 25 public interface SpanWatcher extends NoCopySpan { 26 /** 27 * This method is called to notify you that the specified object 28 * has been attached to the specified range of the text. 29 */ onSpanAdded(Spannable text, Object what, int start, int end)30 public void onSpanAdded(Spannable text, Object what, int start, int end); 31 /** 32 * This method is called to notify you that the specified object 33 * has been detached from the specified range of the text. 34 */ onSpanRemoved(Spannable text, Object what, int start, int end)35 public void onSpanRemoved(Spannable text, Object what, int start, int end); 36 /** 37 * This method is called to notify you that the specified object 38 * has been relocated from the range <code>ostart…oend</code> 39 * to the new range <code>nstart…nend</code> of the text. 40 */ onSpanChanged(Spannable text, Object what, int ostart, int oend, int nstart, int nend)41 public void onSpanChanged(Spannable text, Object what, int ostart, int oend, 42 int nstart, int nend); 43 } 44