Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: gecko-sdk/include/nsISelection.h

Issue 20346: Version 1.8 of gecko-sdk. Downloaded from here:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gecko-sdk/include/nsISecurityWarningDialogs.h ('k') | gecko-sdk/include/nsIServiceManager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0 -Release/WINNT_5.2_Depend/mozilla/content/base/public/nsISelection.idl
3 */
4
5 #ifndef __gen_nsISelection_h__
6 #define __gen_nsISelection_h__
7
8
9 #ifndef __gen_nsISupports_h__
10 #include "nsISupports.h"
11 #endif
12
13 /* For IDL files that don't want to include root IDL files. */
14 #ifndef NS_NO_VTABLE
15 #define NS_NO_VTABLE
16 #endif
17 class nsIDOMNode; /* forward declaration */
18
19 class nsIDOMRange; /* forward declaration */
20
21
22 /* starting interface: nsISelection */
23 #define NS_ISELECTION_IID_STR "b2c7ed59-8634-4352-9e37-5484c8b6e4e1"
24
25 #define NS_ISELECTION_IID \
26 {0xb2c7ed59, 0x8634, 0x4352, \
27 { 0x9e, 0x37, 0x54, 0x84, 0xc8, 0xb6, 0xe4, 0xe1 }}
28
29 /**
30 * Interface for manipulating and querying the current selected range
31 * of nodes within the document.
32 *
33 * @status FROZEN
34 * @version 1.0
35 */
36 class NS_NO_VTABLE nsISelection : public nsISupports {
37 public:
38
39 NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISELECTION_IID)
40
41 /**
42 * The node representing one end of the selection.
43 */
44 /* readonly attribute nsIDOMNode anchorNode; */
45 NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode) = 0;
46
47 /**
48 * The offset within the (text) node where the selection begins.
49 */
50 /* readonly attribute long anchorOffset; */
51 NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) = 0;
52
53 /**
54 * The node with keyboard focus.
55 */
56 /* readonly attribute nsIDOMNode focusNode; */
57 NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) = 0;
58
59 /**
60 * The offset within the (text) node where focus starts.
61 */
62 /* readonly attribute long focusOffset; */
63 NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset) = 0;
64
65 /**
66 * Indicates if the selection is collapsed or not.
67 */
68 /* readonly attribute boolean isCollapsed; */
69 NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed) = 0;
70
71 /**
72 * Returns the number of ranges in the selection.
73 */
74 /* readonly attribute long rangeCount; */
75 NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount) = 0;
76
77 /**
78 * Returns the range at the specified index.
79 */
80 /* nsIDOMRange getRangeAt (in long index); */
81 NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval) = 0;
82
83 /**
84 * Collapses the selection to a single point, at the specified offset
85 * in the given DOM node. When the selection is collapsed, and the content
86 * is focused and editable, the caret will blink there.
87 * @param parentNode The given dom node where the selection will be set
88 * @param offset Where in given dom node to place the selection (th e offset into the given node)
89 */
90 /* void collapse (in nsIDOMNode parentNode, in long offset); */
91 NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) = 0;
92
93 /**
94 * Extends the selection by moving the focus to the specified node and offse t,
95 * preserving the anchor postion. The new selection end result will always
96 * be from the anchor to the new focus, regardless of direction.
97 * @param parentNode The node where the selection will be extended to
98 * @param offset Where in node to place the offset in the new focus ed node
99 */
100 /* void extend (in nsIDOMNode parentNode, in long offset); */
101 NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset) = 0;
102
103 /**
104 * Collapses the whole selection to a single point at the start
105 * of the current selection (irrespective of direction). If content
106 * is focused and editable, the caret will blink there.
107 */
108 /* void collapseToStart (); */
109 NS_IMETHOD CollapseToStart(void) = 0;
110
111 /**
112 * Collapses the whole selection to a single point at the end
113 * of the current selection (irrespective of direction). If content
114 * is focused and editable, the caret will blink there.
115 */
116 /* void collapseToEnd (); */
117 NS_IMETHOD CollapseToEnd(void) = 0;
118
119 /**
120 * The value of entirelyContained determines the detail of the search to det ermine if
121 * the selection contains the node. If entirelyContained is set to PR_TRUE, t
122 * or false if
123 * @param node The node where the selection will be extended to
124 * @param entirelyContained Whether
125 */
126 /* boolean containsNode (in nsIDOMNode node, in boolean entirelyContained); */
127 NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool entirelyContained, PRBool *_r etval) = 0;
128
129 /**
130 * Adds all children of the specified node to the selection.
131 * @param parentNode the parent of the children to be added to the selectio n.
132 */
133 /* void selectAllChildren (in nsIDOMNode parentNode); */
134 NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) = 0;
135
136 /**
137 * Adds a range to the current selection.
138 */
139 /* void addRange (in nsIDOMRange range); */
140 NS_IMETHOD AddRange(nsIDOMRange *range) = 0;
141
142 /**
143 * Removes a range from the current selection.
144 */
145 /* void removeRange (in nsIDOMRange range); */
146 NS_IMETHOD RemoveRange(nsIDOMRange *range) = 0;
147
148 /**
149 * Removes all ranges from the current selection.
150 */
151 /* void removeAllRanges (); */
152 NS_IMETHOD RemoveAllRanges(void) = 0;
153
154 /**
155 * Deletes this selection from document the nodes belong to.
156 */
157 /* void deleteFromDocument (); */
158 NS_IMETHOD DeleteFromDocument(void) = 0;
159
160 /**
161 * Modifies the cursor Bidi level after a change in keyboard direction
162 * @param langRTL is PR_TRUE if the new language is right-to-left or
163 * PR_FALSE if the new language is left-to-right.
164 */
165 /* void selectionLanguageChange (in boolean langRTL); */
166 NS_IMETHOD SelectionLanguageChange(PRBool langRTL) = 0;
167
168 /**
169 * Returns the whole selection into a plain text string.
170 */
171 /* wstring toString (); */
172 NS_IMETHOD ToString(PRUnichar **_retval) = 0;
173
174 };
175
176 /* Use this macro when declaring classes that implement this interface. */
177 #define NS_DECL_NSISELECTION \
178 NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode); \
179 NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset); \
180 NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode); \
181 NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset); \
182 NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed); \
183 NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount); \
184 NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval); \
185 NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset); \
186 NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset); \
187 NS_IMETHOD CollapseToStart(void); \
188 NS_IMETHOD CollapseToEnd(void); \
189 NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool entirelyContained, PRBool *_r etval); \
190 NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode); \
191 NS_IMETHOD AddRange(nsIDOMRange *range); \
192 NS_IMETHOD RemoveRange(nsIDOMRange *range); \
193 NS_IMETHOD RemoveAllRanges(void); \
194 NS_IMETHOD DeleteFromDocument(void); \
195 NS_IMETHOD SelectionLanguageChange(PRBool langRTL); \
196 NS_IMETHOD ToString(PRUnichar **_retval);
197
198 /* Use this macro to declare functions that forward the behavior of this interfa ce to another object. */
199 #define NS_FORWARD_NSISELECTION(_to) \
200 NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode) { return _to GetAnchorNode (aAnchorNode); } \
201 NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) { return _to GetAnchorOffse t(aAnchorOffset); } \
202 NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) { return _to GetFocusNode(aF ocusNode); } \
203 NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset) { return _to GetFocusOffset(a FocusOffset); } \
204 NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed) { return _to GetIsCollapsed(aI sCollapsed); } \
205 NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount) { return _to GetRangeCount(aRan geCount); } \
206 NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval) { return _to GetRa ngeAt(index, _retval); } \
207 NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) { return _to Colla pse(parentNode, offset); } \
208 NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset) { return _to Extend( parentNode, offset); } \
209 NS_IMETHOD CollapseToStart(void) { return _to CollapseToStart(); } \
210 NS_IMETHOD CollapseToEnd(void) { return _to CollapseToEnd(); } \
211 NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool entirelyContained, PRBool *_r etval) { return _to ContainsNode(node, entirelyContained, _retval); } \
212 NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) { return _to SelectAllChi ldren(parentNode); } \
213 NS_IMETHOD AddRange(nsIDOMRange *range) { return _to AddRange(range); } \
214 NS_IMETHOD RemoveRange(nsIDOMRange *range) { return _to RemoveRange(range); } \
215 NS_IMETHOD RemoveAllRanges(void) { return _to RemoveAllRanges(); } \
216 NS_IMETHOD DeleteFromDocument(void) { return _to DeleteFromDocument(); } \
217 NS_IMETHOD SelectionLanguageChange(PRBool langRTL) { return _to SelectionLangu ageChange(langRTL); } \
218 NS_IMETHOD ToString(PRUnichar **_retval) { return _to ToString(_retval); }
219
220 /* Use this macro to declare functions that forward the behavior of this interfa ce to another object in a safe way. */
221 #define NS_FORWARD_SAFE_NSISELECTION(_to) \
222 NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode) { return !_to ? NS_ERROR_N ULL_POINTER : _to->GetAnchorNode(aAnchorNode); } \
223 NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) { return !_to ? NS_ERROR_NU LL_POINTER : _to->GetAnchorOffset(aAnchorOffset); } \
224 NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) { return !_to ? NS_ERROR_NUL L_POINTER : _to->GetFocusNode(aFocusNode); } \
225 NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset) { return !_to ? NS_ERROR_NULL _POINTER : _to->GetFocusOffset(aFocusOffset); } \
226 NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed) { return !_to ? NS_ERROR_NULL_ POINTER : _to->GetIsCollapsed(aIsCollapsed); } \
227 NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount) { return !_to ? NS_ERROR_NULL_P OINTER : _to->GetRangeCount(aRangeCount); } \
228 NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval) { return !_to ? NS _ERROR_NULL_POINTER : _to->GetRangeAt(index, _retval); } \
229 NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) { return !_to ? NS _ERROR_NULL_POINTER : _to->Collapse(parentNode, offset); } \
230 NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset) { return !_to ? NS_E RROR_NULL_POINTER : _to->Extend(parentNode, offset); } \
231 NS_IMETHOD CollapseToStart(void) { return !_to ? NS_ERROR_NULL_POINTER : _to-> CollapseToStart(); } \
232 NS_IMETHOD CollapseToEnd(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Co llapseToEnd(); } \
233 NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool entirelyContained, PRBool *_r etval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContainsNode(node, entirelyC ontained, _retval); } \
234 NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) { return !_to ? NS_ERROR_ NULL_POINTER : _to->SelectAllChildren(parentNode); } \
235 NS_IMETHOD AddRange(nsIDOMRange *range) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddRange(range); } \
236 NS_IMETHOD RemoveRange(nsIDOMRange *range) { return !_to ? NS_ERROR_NULL_POINT ER : _to->RemoveRange(range); } \
237 NS_IMETHOD RemoveAllRanges(void) { return !_to ? NS_ERROR_NULL_POINTER : _to-> RemoveAllRanges(); } \
238 NS_IMETHOD DeleteFromDocument(void) { return !_to ? NS_ERROR_NULL_POINTER : _t o->DeleteFromDocument(); } \
239 NS_IMETHOD SelectionLanguageChange(PRBool langRTL) { return !_to ? NS_ERROR_NU LL_POINTER : _to->SelectionLanguageChange(langRTL); } \
240 NS_IMETHOD ToString(PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); }
241
242 #if 0
243 /* Use the code below as a template for the implementation class for this interf ace. */
244
245 /* Header file */
246 class nsSelection : public nsISelection
247 {
248 public:
249 NS_DECL_ISUPPORTS
250 NS_DECL_NSISELECTION
251
252 nsSelection();
253
254 private:
255 ~nsSelection();
256
257 protected:
258 /* additional members */
259 };
260
261 /* Implementation file */
262 NS_IMPL_ISUPPORTS1(nsSelection, nsISelection)
263
264 nsSelection::nsSelection()
265 {
266 /* member initializers and constructor code */
267 }
268
269 nsSelection::~nsSelection()
270 {
271 /* destructor code */
272 }
273
274 /* readonly attribute nsIDOMNode anchorNode; */
275 NS_IMETHODIMP nsSelection::GetAnchorNode(nsIDOMNode * *aAnchorNode)
276 {
277 return NS_ERROR_NOT_IMPLEMENTED;
278 }
279
280 /* readonly attribute long anchorOffset; */
281 NS_IMETHODIMP nsSelection::GetAnchorOffset(PRInt32 *aAnchorOffset)
282 {
283 return NS_ERROR_NOT_IMPLEMENTED;
284 }
285
286 /* readonly attribute nsIDOMNode focusNode; */
287 NS_IMETHODIMP nsSelection::GetFocusNode(nsIDOMNode * *aFocusNode)
288 {
289 return NS_ERROR_NOT_IMPLEMENTED;
290 }
291
292 /* readonly attribute long focusOffset; */
293 NS_IMETHODIMP nsSelection::GetFocusOffset(PRInt32 *aFocusOffset)
294 {
295 return NS_ERROR_NOT_IMPLEMENTED;
296 }
297
298 /* readonly attribute boolean isCollapsed; */
299 NS_IMETHODIMP nsSelection::GetIsCollapsed(PRBool *aIsCollapsed)
300 {
301 return NS_ERROR_NOT_IMPLEMENTED;
302 }
303
304 /* readonly attribute long rangeCount; */
305 NS_IMETHODIMP nsSelection::GetRangeCount(PRInt32 *aRangeCount)
306 {
307 return NS_ERROR_NOT_IMPLEMENTED;
308 }
309
310 /* nsIDOMRange getRangeAt (in long index); */
311 NS_IMETHODIMP nsSelection::GetRangeAt(PRInt32 index, nsIDOMRange **_retval)
312 {
313 return NS_ERROR_NOT_IMPLEMENTED;
314 }
315
316 /* void collapse (in nsIDOMNode parentNode, in long offset); */
317 NS_IMETHODIMP nsSelection::Collapse(nsIDOMNode *parentNode, PRInt32 offset)
318 {
319 return NS_ERROR_NOT_IMPLEMENTED;
320 }
321
322 /* void extend (in nsIDOMNode parentNode, in long offset); */
323 NS_IMETHODIMP nsSelection::Extend(nsIDOMNode *parentNode, PRInt32 offset)
324 {
325 return NS_ERROR_NOT_IMPLEMENTED;
326 }
327
328 /* void collapseToStart (); */
329 NS_IMETHODIMP nsSelection::CollapseToStart()
330 {
331 return NS_ERROR_NOT_IMPLEMENTED;
332 }
333
334 /* void collapseToEnd (); */
335 NS_IMETHODIMP nsSelection::CollapseToEnd()
336 {
337 return NS_ERROR_NOT_IMPLEMENTED;
338 }
339
340 /* boolean containsNode (in nsIDOMNode node, in boolean entirelyContained); */
341 NS_IMETHODIMP nsSelection::ContainsNode(nsIDOMNode *node, PRBool entirelyContain ed, PRBool *_retval)
342 {
343 return NS_ERROR_NOT_IMPLEMENTED;
344 }
345
346 /* void selectAllChildren (in nsIDOMNode parentNode); */
347 NS_IMETHODIMP nsSelection::SelectAllChildren(nsIDOMNode *parentNode)
348 {
349 return NS_ERROR_NOT_IMPLEMENTED;
350 }
351
352 /* void addRange (in nsIDOMRange range); */
353 NS_IMETHODIMP nsSelection::AddRange(nsIDOMRange *range)
354 {
355 return NS_ERROR_NOT_IMPLEMENTED;
356 }
357
358 /* void removeRange (in nsIDOMRange range); */
359 NS_IMETHODIMP nsSelection::RemoveRange(nsIDOMRange *range)
360 {
361 return NS_ERROR_NOT_IMPLEMENTED;
362 }
363
364 /* void removeAllRanges (); */
365 NS_IMETHODIMP nsSelection::RemoveAllRanges()
366 {
367 return NS_ERROR_NOT_IMPLEMENTED;
368 }
369
370 /* void deleteFromDocument (); */
371 NS_IMETHODIMP nsSelection::DeleteFromDocument()
372 {
373 return NS_ERROR_NOT_IMPLEMENTED;
374 }
375
376 /* void selectionLanguageChange (in boolean langRTL); */
377 NS_IMETHODIMP nsSelection::SelectionLanguageChange(PRBool langRTL)
378 {
379 return NS_ERROR_NOT_IMPLEMENTED;
380 }
381
382 /* wstring toString (); */
383 NS_IMETHODIMP nsSelection::ToString(PRUnichar **_retval)
384 {
385 return NS_ERROR_NOT_IMPLEMENTED;
386 }
387
388 /* End of implementation class template. */
389 #endif
390
391
392 #endif /* __gen_nsISelection_h__ */
OLDNEW
« no previous file with comments | « gecko-sdk/include/nsISecurityWarningDialogs.h ('k') | gecko-sdk/include/nsIServiceManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698