View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics
3    * and Informatics, Comenius University, Bratislava. This file is protected by
4    * the Mozilla Public License version 1.1 (the License); you may not use this
5    * file except in compliance with the License. You may obtain a copy of the
6    * License at http://euromath2.sourceforge.net/license.html Unless required by
7    * applicable law or agreed to in writing, software distributed under the
8    * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9    * OF ANY KIND, either express or implied. See the License for the specific
10   * language governing permissions and limitations under the License.
11   */
12  package sk.uniba.euromath.editor.textEditor;
13  
14  import org.eclipse.swt.widgets.Caret;
15  
16  import sk.baka.ikslibs.ptr.DomPointer;
17  
18  /***
19   * CaretProvider provides a single instance of caret.
20   * 
21   * @author Tomáš Studva Created on 15.7.2004
22   * 
23   */
24  public interface ICaretProvider {
25  
26      /***
27       * Returns instance of caret.
28       * 
29       * @return caret object
30       */
31      public Caret getCaret();
32  
33      /***
34       * @return ID of bottommost node in DOM tree containing caret.
35       *         <code>null</code> if caret is not visible or contained by
36       *         object without id.
37       */
38      public String getNodeIDWithCaret();
39  
40      /***
41       * Returns CaretPositioner with caret or null if caret is not visible.
42       * 
43       * @return null or caret positioner
44       */
45      public ICaretPositioner getActiveCaretPositioner();
46  
47      /***
48       * Returns TextPieceKeeper with caret or null if caret is not visible.
49       * 
50       * @return null or TextPieceKeeper
51       */
52      public ITextPieceKeeper getActiveTextPieceKeeper();
53  
54      /***
55       * Returns pointer to place in DOM tree where is caret or null if caret is
56       * nowhere.
57       * 
58       * @return null or DomPointer
59       */
60      public DomPointer getPointer();
61  
62      /***
63       * Returns text of text node with caret to caret position or null if caret
64       * is nowhere.
65       * 
66       * @return null or String
67       */
68      public String getPreviousText();
69  
70  }