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 public interface SpanWatcher extends NoCopySpan {
25     /**
26      * This method is called to notify you that the specified object
27      * has been attached to the specified range of the text.
28      */
onSpanAdded(Spannable text, Object what, int start, int end)29     public void onSpanAdded(Spannable text, Object what, int start, int end);
30     /**
31      * This method is called to notify you that the specified object
32      * has been detached from the specified range of the text.
33      */
onSpanRemoved(Spannable text, Object what, int start, int end)34     public void onSpanRemoved(Spannable text, Object what, int start, int end);
35     /**
36      * This method is called to notify you that the specified object
37      * has been relocated from the range <code>ostart&hellip;oend</code>
38      * to the new range <code>nstart&hellip;nend</code> of the text.
39      */
onSpanChanged(Spannable text, Object what, int ostart, int oend, int nstart, int nend)40     public void onSpanChanged(Spannable text, Object what, int ostart, int oend,
41                               int nstart, int nend);
42 }
43