129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.ITextViewerExtension3;
|
|
14
|
131
|
15 import dwtx.jface.text.IRegion; // packageimport
|
|
16
|
129
|
17 import dwt.dwthelper.utils;
|
|
18
|
|
19
|
|
20 /**
|
|
21 * Extension interface for {@link dwtx.jface.text.ITextViewer}. <p>
|
|
22 * This interface has been replaced by {@link dwtx.jface.text.ITextViewerExtension5}.
|
|
23 * Clients are not supposed to use this interface any longer.
|
|
24 *
|
|
25 * @since 2.1
|
|
26 * @deprecated replaced by {@link dwtx.jface.text.ITextViewerExtension5}
|
|
27 */
|
|
28 public interface ITextViewerExtension3 {
|
|
29
|
|
30
|
|
31 /**
|
|
32 * Returns the minimal region of the viewer's document that completely comprises everything that is
|
|
33 * visible in the viewer's widget or <code>null</code> if there is no such region.
|
|
34 *
|
|
35 * @return the minimal region of the viewer's document comprising the contents of the viewer's widget or <code>null</code>
|
|
36 */
|
|
37 IRegion getModelCoverage();
|
|
38
|
|
39
|
|
40 /**
|
|
41 * Returns the widget line that corresponds to the given line of the viewer's document or <code>-1</code> if there is no such line.
|
|
42 *
|
|
43 * @param modelLine the line of the viewer's document
|
|
44 * @return the corresponding widget line or <code>-1</code>
|
|
45 */
|
|
46 int modelLine2WidgetLine(int modelLine);
|
|
47
|
|
48 /**
|
|
49 * Returns the widget offset that corresponds to the given offset in the viewer's document
|
|
50 * or <code>-1</code> if there is no such offset
|
|
51 *
|
|
52 * @param modelOffset the offset in the viewer's document
|
|
53 * @return the corresponding widget offset or <code>-1</code>
|
|
54 */
|
|
55 int modelOffset2WidgetOffset(int modelOffset);
|
|
56
|
|
57 /**
|
|
58 * Returns the minimal region of the viewer's widget that completely comprises the given region of the
|
|
59 * viewer's document or <code>null</code> if there is no such region.
|
|
60 *
|
|
61 * @param modelRange the region of the viewer's document
|
|
62 * @return the minimal region of the widget comprising <code>modelRange</code> or <code>null</code>
|
|
63 */
|
|
64 IRegion modelRange2WidgetRange(IRegion modelRange);
|
|
65
|
|
66
|
|
67 /**
|
|
68 * Returns the offset of the viewer's document that corresponds to the given widget offset
|
|
69 * or <code>-1</code> if there is no such offset
|
|
70 *
|
|
71 * @param widgetOffset the widget offset
|
|
72 * @return the corresponding offset in the viewer's document or <code>-1</code>
|
|
73 */
|
|
74 int widgetOffset2ModelOffset(int widgetOffset);
|
|
75
|
|
76 /**
|
|
77 * Returns the minimal region of the viewer's document that completely comprises the given widget region
|
|
78 * or <code>null</code> if there is no such region.
|
|
79 *
|
|
80 * @param widgetRange the widget region
|
|
81 * @return the minimal region of the viewer's document comprising <code>widgetRange</code> or <code>null</code>
|
|
82 */
|
|
83 IRegion widgetRange2ModelRange(IRegion widgetRange);
|
|
84
|
|
85 /**
|
|
86 * Returns the line of the viewer's document that corresponds to the given widget line or <code>-1</code> if there is no such line.
|
|
87 *
|
|
88 * @param widgetLine the widget line
|
|
89 * @return the corresponding line of the viewer's document or <code>-1</code>
|
|
90 */
|
|
91 int widgetlLine2ModelLine(int widgetLine);
|
|
92
|
|
93 /**
|
|
94 * Returns the widget line of the given widget offset.
|
|
95 *
|
|
96 * @param widgetOffset the widget offset
|
|
97 * @return the widget line of the widget offset
|
|
98 */
|
|
99 int widgetLineOfWidgetOffset(int widgetOffset);
|
|
100 }
|