summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/Range.java
blob: 54c6309680389ceb47d99914f9bb9b0ff4c37f37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;

/**


*/
public class Range implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;
	protected Range(Class dummy){}

	public Range() {
		newRange();
	}
	private native void newRange();
	public Range(Document rootContainer) {
		newRange(rootContainer);
	}
	private native void newRange(Document rootContainer);
	public Range(Range other) {
		newRange(other);
	}
	private native void newRange(Range other);
	public Range(Node startContainer, long startOffset, Node endContainer, long endOffset) {
		newRange(startContainer,startOffset,endContainer,endOffset);
	}
	private native void newRange(Node startContainer, long startOffset, Node endContainer, long endOffset);
	/**	
		 Node within which the range begins
			     		@short    Node within which the range begins
	*/
	public native Node startContainer();
	/**	
		 Offset within the starting node of the range.
			     		@short    Offset within the starting node of the range.
	*/
	public native long startOffset();
	/**	
		 Node within which the range ends
			     		@short    Node within which the range ends
	*/
	public native Node endContainer();
	/**	
		 Offset within the ending node of the range.
			     		@short    Offset within the ending node of the range.
	*/
	public native long endOffset();
	/**	
		 true if the range is collapsed
			     		@short    true if the range is collapsed
	*/
	public native boolean collapsed();
	/**	
		 Gets the common ancestor container of the range's two end-points.
		 Also sets it.
			     		@short    Gets the common ancestor container of the range's two end-points.
	*/
	public native Node commonAncestorContainer();
	/**	
		 Sets the attributes describing the start of the range.
			@param refNode The <code>refNode</code> value. This parameter
		 must be different from <code>null</code> .
			@param offset The <code>startOffset</code> value.
			  INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an
		 ancestor of <code>refNode</code> is an Attr, Entity,
		 Notation, or DocumentType node.
			  If an offset is out-of-bounds, should it just be fixed up or
		 should an exception be raised.
			     		@short    Sets the attributes describing the start of the range.
	*/
	public native void setStart(Node refNode, long offset);
	/**	
		 Sets the attributes describing the end of a range.
			@param refNode The <code>refNode</code> value. This parameter
		 must be different from <code>null</code> .
			@param offset The <code>endOffset</code> value.
			  INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an
		 ancestor of <code>refNode</code> is an Attr, Entity,
		 Notation, or DocumentType node.
			     		@short    Sets the attributes describing the end of a range.
	*/
	public native void setEnd(Node refNode, long offset);
	/**	
		 Sets the start position to be before a node
			@param refNode Range starts before <code>refNode</code>
			     		@short    Sets the start position to be before a node
	*/
	public native void setStartBefore(Node refNode);
	/**	
		 Sets the start position to be after a node
			@param refNode Range starts after <code>refNode</code>
			     		@short    Sets the start position to be after a node
	*/
	public native void setStartAfter(Node refNode);
	/**	
		 Sets the end position to be before a node.
			@param refNode Range ends before <code>refNode</code>
			     		@short    Sets the end position to be before a node.
	*/
	public native void setEndBefore(Node refNode);
	/**	
		 Sets the end of a range to be after a node
			@param refNode Range ends after <code>refNode</code> .
			     		@short    Sets the end of a range to be after a node
	*/
	public native void setEndAfter(Node refNode);
	/**	
		 Collapse a range onto one of its end-points
			@param toStart If true, collapses the Range onto its start; if
		 false, collapses it onto its end.
			     		@short    Collapse a range onto one of its end-points
	*/
	public native void collapse(boolean toStart);
	/**	
		 Select a node and its contents
			@param refNode The node to select.
			     		@short    Select a node and its contents
	*/
	public native void selectNode(Node refNode);
	/**	
		 Select the contents within a node
			@param refNode Node to select from
			     		@short    Select the contents within a node
	*/
	public native void selectNodeContents(Node refNode);
	/**	
		 Compare the end-points of two ranges in a document.
			     		@return -1, 0 or 1 depending on whether the corresponding
 end-point of the Range is before, equal to, or after the
 corresponding end-point of <code>sourceRange</code> .

		@short    Compare the end-points of two ranges in a document.
	*/
	// short compareBoundaryPoints(DOM::Range::CompareHow arg1,const DOM::Range& arg2); >>>> NOT CONVERTED
	/**	
			 not part of the DOM
			 Compare the boundary-points of a range.
			 Return true if the startContainer is before the endContainer,
		 or if they are equal.
		 Return false if the startContainer is after the endContainer.
			     		@short
	*/
	public native boolean boundaryPointsValid();
	/**	
		 Removes the contents of a range from the containing document or
		 document fragment without returning a reference to the removed
		 content.
			     		@short    Removes the contents of a range from the containing document or  document fragment without returning a reference to the removed  content.
	*/
	public native void deleteContents();
	/**	
		 Moves the contents of a range from the containing document or
		 document fragment to a new DocumentFragment.
			  HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
		 extracted into the new DocumentFragment.
			     		@return A DocumentFragment containing the extracted contents.

		@short    Moves the contents of a range from the containing document or  document fragment to a new DocumentFragment.
	*/
	public native DocumentFragment extractContents();
	/**	
		 Duplicates the contents of a range
			     		@return A DocumentFragment containing contents equivalent to
 those of this range.

		@short    Duplicates the contents of a range
	*/
	public native DocumentFragment cloneContents();
	/**	
		 Inserts a node into the document or document fragment at the
		 start of the range.
			@param newNode The node to insert at the start of the range
			  WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and the
		 container of the start of the Range were not created from the
		 same document.
			  HIERARCHY_REQUEST_ERR: Raised if the container of the start of
		 the Range is of a type that does not allow children of the type
		 of <code>newNode</code> or if <code>newNode</code> is an
		 ancestor of the container .
			     		@short    Inserts a node into the document or document fragment at the  start of the range.
	*/
	public native void insertNode(Node newNode);
	/**	
		 Reparents the contents of the range to the given node and
		 inserts the node at the position of the start of the range.
			@param newParent The node to surround the contents with.
			  WRONG_DOCUMENT_ERR: Raised if <code>newParent</code> and the
		 container of the start of the Range were not created from the
		 same document.
			  HIERARCHY_REQUEST_ERR: Raised if the container of the start of
		 the Range is of a type that does not allow children of the type
		 of <code>newParent</code> or if <code>newParent</code> is
		 an ancestor of the container or if <code>node</code> would
		 end up with a child node of a type not allowed by the type of
		 <code>node</code> .
			  INVALID_NODE_TYPE_ERR: Raised if <code>node</code> is an
		 Attr, Entity, DocumentType, Notation, Document, or
		 DocumentFragment node.
			     		@short    Reparents the contents of the range to the given node and  inserts the node at the position of the start of the range.
	*/
	public native void surroundContents(Node newParent);
	/**	
		 Produces a new range whose end-points are equal to the
		 end-points of the range.
			     		@return The duplicated range.

		@short    Produces a new range whose end-points are equal to the  end-points of the range.
	*/
	public native Range cloneRange();
	/**	
		 Returns the contents of a range as a string.
			     		@return The contents of the range.

		@short    Returns the contents of a range as a string.
	*/
	public native String toString();
	/**	
			     		@short
	*/
	public native String toHTML();
	public native DocumentFragment createContextualFragment(String html);
	/**	
		 Called to indicate that the range is no longer in use and that
		 the implementation may relintquish any resources associated with
		 this range. Subsequent calls to any methods or attribute getters
		 on this range will result in a DOMException being thrown with an
		 error code of INVALID_STATE_ERR.
			     		@short    Called to indicate that the range is no longer in use and that  the implementation may relintquish any resources associated with  this range.
	*/
	public native void detach();
	/**	
		 not part of the DOM
		 true if the range is detached
			     		@short    not part of the DOM  true if the range is detached
	*/
	public native boolean isDetached();
	/**	
			 not part of the DOM
		     		@short
	*/
	// DOM::RangeImpl* handle(); >>>> NOT CONVERTED
	public native boolean isNull();
	// DOM::Range* Range(DOM::RangeImpl* arg1); >>>> NOT CONVERTED
}