PageRenderTime 100ms CodeModel.GetById 28ms app.highlight 10ms RepoModel.GetById 59ms app.codeStats 0ms

/gecko_api/include/nsISelection.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 393 lines | 194 code | 64 blank | 135 comment | 0 complexity | f96024f1f66c29351552350d5d12eb8f MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_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
 17class nsIDOMNode; /* forward declaration */
 18
 19class 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 */
 36class NS_NO_VTABLE NS_SCRIPTABLE nsISelection : public nsISupports {
 37 public: 
 38
 39  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISELECTION_IID)
 40
 41  /**
 42     * Returns the node in which the selection begins.
 43     */
 44  /* readonly attribute nsIDOMNode anchorNode; */
 45  NS_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) = 0;
 52
 53  /**
 54     * Returns the node in which the selection ends.
 55     */
 56  /* readonly attribute nsIDOMNode focusNode; */
 57  NS_SCRIPTABLE NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) = 0;
 58
 59  /**
 60     * The offset within the (text) node where the selection ends.
 61     */
 62  /* readonly attribute long focusOffset; */
 63  NS_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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 (the offset into the given node)
 89     */
 90  /* void collapse (in nsIDOMNode parentNode, in long offset); */
 91  NS_SCRIPTABLE NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) = 0;
 92
 93  /**
 94     * Extends the selection by moving the selection end to the specified node and offset,
 95     * preserving the selection begin position. The new selection end result will always
 96     * be from the anchorNode to the new focusNode, 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 selection end
 99     */
100  /* void extend (in nsIDOMNode parentNode, in long offset); */
101  NS_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD CollapseToEnd(void) = 0;
118
119  /**
120     * Indicates whether the node is part of the selection. If partlyContained 
121     * is set to PR_TRUE, the function returns true when some part of the node 
122     * is part of the selection. If partlyContained is set to PR_FALSE, the
123     * function only returns true when the entire node is part of the selection.
124     */
125  /* boolean containsNode (in nsIDOMNode node, in boolean partlyContained); */
126  NS_SCRIPTABLE NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool partlyContained, PRBool *_retval) = 0;
127
128  /**
129     * Adds all children of the specified node to the selection.
130     * @param parentNode  the parent of the children to be added to the selection.
131     */
132  /* void selectAllChildren (in nsIDOMNode parentNode); */
133  NS_SCRIPTABLE NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) = 0;
134
135  /**
136     * Adds a range to the current selection.
137     */
138  /* void addRange (in nsIDOMRange range); */
139  NS_SCRIPTABLE NS_IMETHOD AddRange(nsIDOMRange *range) = 0;
140
141  /**
142     * Removes a range from the current selection.
143     */
144  /* void removeRange (in nsIDOMRange range); */
145  NS_SCRIPTABLE NS_IMETHOD RemoveRange(nsIDOMRange *range) = 0;
146
147  /**
148     * Removes all ranges from the current selection.
149     */
150  /* void removeAllRanges (); */
151  NS_SCRIPTABLE NS_IMETHOD RemoveAllRanges(void) = 0;
152
153  /**
154     * Deletes this selection from document the nodes belong to.
155     */
156  /* void deleteFromDocument (); */
157  NS_SCRIPTABLE NS_IMETHOD DeleteFromDocument(void) = 0;
158
159  /**
160     * Modifies the cursor Bidi level after a change in keyboard direction
161     * @param langRTL is PR_TRUE if the new language is right-to-left or
162     *                PR_FALSE if the new language is left-to-right.
163     */
164  /* void selectionLanguageChange (in boolean langRTL); */
165  NS_SCRIPTABLE NS_IMETHOD SelectionLanguageChange(PRBool langRTL) = 0;
166
167  /**
168     * Returns the whole selection into a plain text string.
169     */
170  /* wstring toString (); */
171  NS_SCRIPTABLE NS_IMETHOD ToString(PRUnichar **_retval) = 0;
172
173};
174
175  NS_DEFINE_STATIC_IID_ACCESSOR(nsISelection, NS_ISELECTION_IID)
176
177/* Use this macro when declaring classes that implement this interface. */
178#define NS_DECL_NSISELECTION \
179  NS_SCRIPTABLE NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode); \
180  NS_SCRIPTABLE NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset); \
181  NS_SCRIPTABLE NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode); \
182  NS_SCRIPTABLE NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset); \
183  NS_SCRIPTABLE NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed); \
184  NS_SCRIPTABLE NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount); \
185  NS_SCRIPTABLE NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval); \
186  NS_SCRIPTABLE NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset); \
187  NS_SCRIPTABLE NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset); \
188  NS_SCRIPTABLE NS_IMETHOD CollapseToStart(void); \
189  NS_SCRIPTABLE NS_IMETHOD CollapseToEnd(void); \
190  NS_SCRIPTABLE NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool partlyContained, PRBool *_retval); \
191  NS_SCRIPTABLE NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode); \
192  NS_SCRIPTABLE NS_IMETHOD AddRange(nsIDOMRange *range); \
193  NS_SCRIPTABLE NS_IMETHOD RemoveRange(nsIDOMRange *range); \
194  NS_SCRIPTABLE NS_IMETHOD RemoveAllRanges(void); \
195  NS_SCRIPTABLE NS_IMETHOD DeleteFromDocument(void); \
196  NS_SCRIPTABLE NS_IMETHOD SelectionLanguageChange(PRBool langRTL); \
197  NS_SCRIPTABLE NS_IMETHOD ToString(PRUnichar **_retval); 
198
199/* Use this macro to declare functions that forward the behavior of this interface to another object. */
200#define NS_FORWARD_NSISELECTION(_to) \
201  NS_SCRIPTABLE NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode) { return _to GetAnchorNode(aAnchorNode); } \
202  NS_SCRIPTABLE NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) { return _to GetAnchorOffset(aAnchorOffset); } \
203  NS_SCRIPTABLE NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) { return _to GetFocusNode(aFocusNode); } \
204  NS_SCRIPTABLE NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset) { return _to GetFocusOffset(aFocusOffset); } \
205  NS_SCRIPTABLE NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed) { return _to GetIsCollapsed(aIsCollapsed); } \
206  NS_SCRIPTABLE NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount) { return _to GetRangeCount(aRangeCount); } \
207  NS_SCRIPTABLE NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval) { return _to GetRangeAt(index, _retval); } \
208  NS_SCRIPTABLE NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) { return _to Collapse(parentNode, offset); } \
209  NS_SCRIPTABLE NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset) { return _to Extend(parentNode, offset); } \
210  NS_SCRIPTABLE NS_IMETHOD CollapseToStart(void) { return _to CollapseToStart(); } \
211  NS_SCRIPTABLE NS_IMETHOD CollapseToEnd(void) { return _to CollapseToEnd(); } \
212  NS_SCRIPTABLE NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool partlyContained, PRBool *_retval) { return _to ContainsNode(node, partlyContained, _retval); } \
213  NS_SCRIPTABLE NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) { return _to SelectAllChildren(parentNode); } \
214  NS_SCRIPTABLE NS_IMETHOD AddRange(nsIDOMRange *range) { return _to AddRange(range); } \
215  NS_SCRIPTABLE NS_IMETHOD RemoveRange(nsIDOMRange *range) { return _to RemoveRange(range); } \
216  NS_SCRIPTABLE NS_IMETHOD RemoveAllRanges(void) { return _to RemoveAllRanges(); } \
217  NS_SCRIPTABLE NS_IMETHOD DeleteFromDocument(void) { return _to DeleteFromDocument(); } \
218  NS_SCRIPTABLE NS_IMETHOD SelectionLanguageChange(PRBool langRTL) { return _to SelectionLanguageChange(langRTL); } \
219  NS_SCRIPTABLE NS_IMETHOD ToString(PRUnichar **_retval) { return _to ToString(_retval); } 
220
221/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
222#define NS_FORWARD_SAFE_NSISELECTION(_to) \
223  NS_SCRIPTABLE NS_IMETHOD GetAnchorNode(nsIDOMNode * *aAnchorNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnchorNode(aAnchorNode); } \
224  NS_SCRIPTABLE NS_IMETHOD GetAnchorOffset(PRInt32 *aAnchorOffset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnchorOffset(aAnchorOffset); } \
225  NS_SCRIPTABLE NS_IMETHOD GetFocusNode(nsIDOMNode * *aFocusNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFocusNode(aFocusNode); } \
226  NS_SCRIPTABLE NS_IMETHOD GetFocusOffset(PRInt32 *aFocusOffset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFocusOffset(aFocusOffset); } \
227  NS_SCRIPTABLE NS_IMETHOD GetIsCollapsed(PRBool *aIsCollapsed) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsCollapsed(aIsCollapsed); } \
228  NS_SCRIPTABLE NS_IMETHOD GetRangeCount(PRInt32 *aRangeCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRangeCount(aRangeCount); } \
229  NS_SCRIPTABLE NS_IMETHOD GetRangeAt(PRInt32 index, nsIDOMRange **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRangeAt(index, _retval); } \
230  NS_SCRIPTABLE NS_IMETHOD Collapse(nsIDOMNode *parentNode, PRInt32 offset) { return !_to ? NS_ERROR_NULL_POINTER : _to->Collapse(parentNode, offset); } \
231  NS_SCRIPTABLE NS_IMETHOD Extend(nsIDOMNode *parentNode, PRInt32 offset) { return !_to ? NS_ERROR_NULL_POINTER : _to->Extend(parentNode, offset); } \
232  NS_SCRIPTABLE NS_IMETHOD CollapseToStart(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CollapseToStart(); } \
233  NS_SCRIPTABLE NS_IMETHOD CollapseToEnd(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CollapseToEnd(); } \
234  NS_SCRIPTABLE NS_IMETHOD ContainsNode(nsIDOMNode *node, PRBool partlyContained, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContainsNode(node, partlyContained, _retval); } \
235  NS_SCRIPTABLE NS_IMETHOD SelectAllChildren(nsIDOMNode *parentNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectAllChildren(parentNode); } \
236  NS_SCRIPTABLE NS_IMETHOD AddRange(nsIDOMRange *range) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddRange(range); } \
237  NS_SCRIPTABLE NS_IMETHOD RemoveRange(nsIDOMRange *range) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveRange(range); } \
238  NS_SCRIPTABLE NS_IMETHOD RemoveAllRanges(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAllRanges(); } \
239  NS_SCRIPTABLE NS_IMETHOD DeleteFromDocument(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteFromDocument(); } \
240  NS_SCRIPTABLE NS_IMETHOD SelectionLanguageChange(PRBool langRTL) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectionLanguageChange(langRTL); } \
241  NS_SCRIPTABLE NS_IMETHOD ToString(PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); } 
242
243#if 0
244/* Use the code below as a template for the implementation class for this interface. */
245
246/* Header file */
247class nsSelection : public nsISelection
248{
249public:
250  NS_DECL_ISUPPORTS
251  NS_DECL_NSISELECTION
252
253  nsSelection();
254
255private:
256  ~nsSelection();
257
258protected:
259  /* additional members */
260};
261
262/* Implementation file */
263NS_IMPL_ISUPPORTS1(nsSelection, nsISelection)
264
265nsSelection::nsSelection()
266{
267  /* member initializers and constructor code */
268}
269
270nsSelection::~nsSelection()
271{
272  /* destructor code */
273}
274
275/* readonly attribute nsIDOMNode anchorNode; */
276NS_IMETHODIMP nsSelection::GetAnchorNode(nsIDOMNode * *aAnchorNode)
277{
278    return NS_ERROR_NOT_IMPLEMENTED;
279}
280
281/* readonly attribute long anchorOffset; */
282NS_IMETHODIMP nsSelection::GetAnchorOffset(PRInt32 *aAnchorOffset)
283{
284    return NS_ERROR_NOT_IMPLEMENTED;
285}
286
287/* readonly attribute nsIDOMNode focusNode; */
288NS_IMETHODIMP nsSelection::GetFocusNode(nsIDOMNode * *aFocusNode)
289{
290    return NS_ERROR_NOT_IMPLEMENTED;
291}
292
293/* readonly attribute long focusOffset; */
294NS_IMETHODIMP nsSelection::GetFocusOffset(PRInt32 *aFocusOffset)
295{
296    return NS_ERROR_NOT_IMPLEMENTED;
297}
298
299/* readonly attribute boolean isCollapsed; */
300NS_IMETHODIMP nsSelection::GetIsCollapsed(PRBool *aIsCollapsed)
301{
302    return NS_ERROR_NOT_IMPLEMENTED;
303}
304
305/* readonly attribute long rangeCount; */
306NS_IMETHODIMP nsSelection::GetRangeCount(PRInt32 *aRangeCount)
307{
308    return NS_ERROR_NOT_IMPLEMENTED;
309}
310
311/* nsIDOMRange getRangeAt (in long index); */
312NS_IMETHODIMP nsSelection::GetRangeAt(PRInt32 index, nsIDOMRange **_retval)
313{
314    return NS_ERROR_NOT_IMPLEMENTED;
315}
316
317/* void collapse (in nsIDOMNode parentNode, in long offset); */
318NS_IMETHODIMP nsSelection::Collapse(nsIDOMNode *parentNode, PRInt32 offset)
319{
320    return NS_ERROR_NOT_IMPLEMENTED;
321}
322
323/* void extend (in nsIDOMNode parentNode, in long offset); */
324NS_IMETHODIMP nsSelection::Extend(nsIDOMNode *parentNode, PRInt32 offset)
325{
326    return NS_ERROR_NOT_IMPLEMENTED;
327}
328
329/* void collapseToStart (); */
330NS_IMETHODIMP nsSelection::CollapseToStart()
331{
332    return NS_ERROR_NOT_IMPLEMENTED;
333}
334
335/* void collapseToEnd (); */
336NS_IMETHODIMP nsSelection::CollapseToEnd()
337{
338    return NS_ERROR_NOT_IMPLEMENTED;
339}
340
341/* boolean containsNode (in nsIDOMNode node, in boolean partlyContained); */
342NS_IMETHODIMP nsSelection::ContainsNode(nsIDOMNode *node, PRBool partlyContained, PRBool *_retval)
343{
344    return NS_ERROR_NOT_IMPLEMENTED;
345}
346
347/* void selectAllChildren (in nsIDOMNode parentNode); */
348NS_IMETHODIMP nsSelection::SelectAllChildren(nsIDOMNode *parentNode)
349{
350    return NS_ERROR_NOT_IMPLEMENTED;
351}
352
353/* void addRange (in nsIDOMRange range); */
354NS_IMETHODIMP nsSelection::AddRange(nsIDOMRange *range)
355{
356    return NS_ERROR_NOT_IMPLEMENTED;
357}
358
359/* void removeRange (in nsIDOMRange range); */
360NS_IMETHODIMP nsSelection::RemoveRange(nsIDOMRange *range)
361{
362    return NS_ERROR_NOT_IMPLEMENTED;
363}
364
365/* void removeAllRanges (); */
366NS_IMETHODIMP nsSelection::RemoveAllRanges()
367{
368    return NS_ERROR_NOT_IMPLEMENTED;
369}
370
371/* void deleteFromDocument (); */
372NS_IMETHODIMP nsSelection::DeleteFromDocument()
373{
374    return NS_ERROR_NOT_IMPLEMENTED;
375}
376
377/* void selectionLanguageChange (in boolean langRTL); */
378NS_IMETHODIMP nsSelection::SelectionLanguageChange(PRBool langRTL)
379{
380    return NS_ERROR_NOT_IMPLEMENTED;
381}
382
383/* wstring toString (); */
384NS_IMETHODIMP nsSelection::ToString(PRUnichar **_retval)
385{
386    return NS_ERROR_NOT_IMPLEMENTED;
387}
388
389/* End of implementation class template. */
390#endif
391
392
393#endif /* __gen_nsISelection_h__ */