sbIServicePaneService.idl
Go to the documentation of this file.
1 /* vim: set ts=2 sw=2 expandtab : */
2 /*
3  *=BEGIN SONGBIRD GPL
4  *
5  * This file is part of the Songbird web player.
6  *
7  * Copyright(c) 2005-2010 POTI, Inc.
8  * http://www.songbirdnest.com
9  *
10  * This file may be licensed under the terms of of the
11  * GNU General Public License Version 2 (the ``GPL'').
12  *
13  * Software distributed under the License is distributed
14  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
15  * express or implied. See the GPL for the specific language
16  * governing rights and limitations.
17  *
18  * You should have received a copy of the GPL along with this
19  * program. If not, go to http://www.gnu.org/licenses/gpl.html
20  * or write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  *=END SONGBIRD GPL
24  */
25 
31 #include "nsISupports.idl"
32 
33 interface nsIArray;
34 interface nsIRDFDataSource;
35 interface nsIRDFResource;
36 interface nsIDOMXULElement;
37 interface nsIDOMNode;
38 interface nsIDOMWindow;
39 interface nsISimpleEnumerator;
40 interface nsIStringEnumerator;
41 interface nsIDragSession;
42 interface nsIDOMDataTransfer;
43 interface nsIStringBundle;
46 
51 [scriptable, uuid(7515c2f0-17cf-480e-bf15-8eb1f168783b)]
53 {
54  /* \brief the uri of this node as a string */
55  attribute AString id;
56 
57  /* \deprecated All nodes are potential containers now, don't use this */
58  readonly attribute boolean isContainer;
59 
60  /* \brief class name of the node */
61  attribute AString className;
62  /* \brief the URL to load when the node is clicked on in the tree */
63  attribute AString url;
64 
70  attribute AString contentPrefix;
71 
72  /* \brief the URL of the image to display in the tree */
73  attribute AString image;
74  /* \brief the unlocalized text for the name of the node */
75  attribute AString name;
76  /* \brief the localized text to display in the tree (set via name) */
77  readonly attribute AString displayName;
78  /* \brief the tooltip to display when the user hovers over the node in the tree */
79  attribute AString tooltip;
80  /* \brief should the node be hidden in the tree ? */
81  attribute boolean hidden;
82  /* \brief should the node name be editable in the tree ? */
83  attribute boolean editable;
84  /* \brief is the this node open in the tree? */
85  attribute boolean isOpen;
86  /* \brief the contract id of the service that owns the node */
87  attribute AString contractid;
88  /* \brief the corresponding search engine type (if available) of the node */
89  attribute AString searchtype;
90 
91  /* drag and drop reordering helper attributes */
92  /* \brief a comma separated list of drag types to offer for reordering */
93  attribute AString dndDragTypes;
94  /* \brief a comma separated list of drag types to allow to be reordered before or after */
95  attribute AString dndAcceptNear;
96  /* \brief a comma separated list of drag types to allow dropping into */
97  attribute AString dndAcceptIn;
98 
99  /* \brief the uri of a stringbundle to use to translate the properties of this node */
100  attribute AString stringbundle;
101 
102  /* \deprecated This is the same as className property now */
103  attribute AString properties;
104 
110  void addEventListener (in sbIServicePaneNodeListener aListener);
112  void dispatchEvent (in AString event);
113 
121 
128 
129  // here's a subset of the W3C DOM Level 1 Core
130 
131  boolean hasAttribute(in AString aName);
132  AString getAttribute(in AString aName);
133  AString setAttribute(in AString aName,
134  in AString aValue);
135  void removeAttribute(in AString aName);
136 
137  boolean hasAttributeNS(in aString aNamespace,
138  in AString aName);
139  AString getAttributeNS(in AString aNamespace,
140  in AString aName);
141  AString setAttributeNS(in AString aNamespace,
142  in AString aName,
143  in AString aValue);
144  void removeAttributeNS(in AString aNamespace,
145  in AString aName);
146 
148  readonly attribute nsIStringEnumerator attributes;
150  readonly attribute nsISimpleEnumerator childNodes;
151  readonly attribute sbIServicePaneNode firstChild;
152  readonly attribute sbIServicePaneNode lastChild;
153  readonly attribute sbIServicePaneNode nextSibling;
155  readonly attribute sbIServicePaneNode parentNode;
156 
159  in sbIServicePaneNode aAdjacentNode);
160  void removeChild (in sbIServicePaneNode aChild);
161  void replaceChild (in sbIServicePaneNode aNewNode,
162  in sbIServicePaneNode aOldNode);
163 };
164 
170 [scriptable, function, uuid(fd541806-1dd1-11b2-9a3d-d7ba87856d00)]
172  void handleEvent (in AString aEventName);
173 };
174 
180 [scriptable, uuid(3d36154b-d7d0-4abe-9ba4-475a7caf4b16)]
191  void attrModified (in sbIServicePaneNode aNode, in AString aAttrName,
192  in AString aNamespace, in AString aOldVal, in AString aNewVal);
193 
200  void nodeInserted (in sbIServicePaneNode aNode, in sbIServicePaneNode aParent, in sbIServicePaneNode aInsertBefores);
201 
208  void nodeRemoved (in sbIServicePaneNode aNode, in sbIServicePaneNode aParent);
209 };
210 
215 [scriptable, uuid(0c86331b-6767-4595-95e7-80f775ab1770)]
222  void nodePropertyChanged(in string aNodeId, in string aAttributeName);
223 };
224 
225 
226 
236 [scriptable, uuid(47704d11-ee27-458f-8baf-adc644e629d4)]
238 {
242  readonly attribute sbIServicePaneNode root;
243 
247  void init();
248 
249  /* \brief Creates a new node object
250  * \return node object, or null if the node couldn't be created
251  */
253 
254  /* \deprecated The proper way of creating nodes is now calling createNode(),
255  * seting its attributes as required and calling
256  * parent.appendChild() with this node then.
257  */
258  sbIServicePaneNode addNode(in AString aId,
259  in sbIServicePaneNode aParent,
260  in boolean aContainer);
261 
262  /* \deprecated The proper way to remove a node is calling
263  * node.parentNode.removeChild(node).
264  */
265  void removeNode(in sbIServicePaneNode aNode);
266 
267  /* \brief Get the node object for the given id
268  * \param aId the ID of the desired node
269  * \return node object, or null if it couldn't be found
270  */
271  sbIServicePaneNode getNode(in AString aId);
272 
273 
274  /* \brief Get the first node object for the given url
275  * \param aURL the url of the desired node
276  * \param aMatchLevel the desired level to test url matches. This may be set
277  * to URL_MATCH_EXACT or URL_MATCH_PREFIX. The
278  * default value is URL_MATCH_EXACT. See comments below for
279  * usage.
280  * \return node object, or null if it couldn't be found
281  */
282  sbIServicePaneNode getNodeForURL(in AString aURL,
283  [optional] in unsigned long aMatchLevel);
284 
295  const unsigned long URL_MATCH_EXACT = 0;
296  const unsigned long URL_MATCH_PREFIX = 1;
297 
298  /* \brief Get all nodes with the given attribute value
299  * \param aNamespace the attribute namespace
300  * \param aName the attribute name
301  * \param aValue the attribute value
302  * \return nsIArray of sbIServicePaneNode nodes with attribute value
303  */
304  nsIArray getNodesByAttributeNS(in AString aNamespace,
305  in AString aName,
306  in AString aValue);
307 
308  /* \deprecated Sorting is performed automatically now, calling this method
309  * won't do anything.
310  */
311  void sortNode(in sbIServicePaneNode aNode);
312 
313  /* \deprecated Service pane no longer supports persistance, calling this
314  * method won't do anything.
315  */
316  void save();
317 
318  /* \brief Fill the context menu for the given node
319  * \param aNode node clicked on
320  * \param aContextMenu the menu we're trying to fill
321  * \param aParentWindow the toplevel window we're displaying in
322  */
323  void fillContextMenu(in sbIServicePaneNode aNode,
324  in nsIDOMXULElement aContextMenu,
325  in nsIDOMWindow aParentWindow);
326 
327  /* \brief Fill a menu with menuitems to create new tree nodes
328  * \param aNode the node or null for the click and hold menu
329  * \param aContextMenu the menu we're trying to fill
330  * \param aParentWindow the toplevel window we're displaying in
331  */
332  void fillNewItemMenu(in sbIServicePaneNode aNode,
333  in nsIDOMXULElement aContextMenu,
334  in nsIDOMWindow aParentWindow);
335 
336  /* \brief Selection changes notification
337  * \param aNode node that is now selected
338  * \param aContainer The container object that implements the selection
339  * \param aParentWindow the toplevel window we're displaying in
340  */
342  in nsIDOMNode aContainer,
343  in nsIDOMWindow aParentWindow);
344 
345  /* drag and drop support */
346  PRBool canDrop(in sbIServicePaneNode aNode,
347  in nsIDragSession aDragSession,
348  in PRInt32 aOrientation,
349  in nsIDOMWindow aWindow);
350 
351  void onDrop(in sbIServicePaneNode aNode,
352  in nsIDragSession aDragSession,
353  in PRInt32 aOrientation,
354  in nsIDOMWindow aWindow);
355 
356  PRBool onDragGesture(in sbIServicePaneNode aNode,
357  in nsIDOMDataTransfer aDataTransfer);
358 
359  /* \brief Called before a user starts to rename a node.
360  * \param aNode the node about to be renamed
361  */
362  void onBeforeRename(in sbIServicePaneNode aNode);
363 
364  /* \brief Called when a node is renamed by the user, allows
365  * the node owner to accept the action by setting the
366  * node name to the given value.
367  * \param aNode the node being renamed
368  * \param aNewName new name entered by the user or null if user canceled
369  * renaming
370  */
371  void onRename(in sbIServicePaneNode aNode,
372  in AString aNewName);
373 
374  /* \brief Add a service pane listener
375  * \param aListener the listener to add
376  */
377  void addListener(in sbIServicePaneListener aListener);
378 
379  /* \brief Remove a service pane listener
380  * \param aListener the listener to remove
381  */
382  void removeListener(in sbIServicePaneListener aListener);
383 };
384 
385 
390 [scriptable, uuid(2ece4c56-1dd2-11b2-9cc4-8a248cad3050)]
392 {
393  /* \brief Initialize this service pane module
394  * This is where the module should set itself up in the tree if it hasn't
395  * before.
396  * \param aServicePaneService the service pane service instance
397  */
398  void servicePaneInit(in sbIServicePaneService aServicePaneService);
399 
400  /* \brief Fill the context menu for the given node
401  * \param aNode the node that was context-clicked on
402  * \param aContextMenu the menu we're trying to fill
403  * \param aParentWindow the toplevel window we're displaying in
404  */
405  void fillContextMenu(in sbIServicePaneNode aNode,
406  in nsIDOMXULElement aContextMenu,
407  in nsIDOMWindow aParentWindow);
408 
409  void fillNewItemMenu(in sbIServicePaneNode aNode,
410  in nsIDOMXULElement aContextMenu,
411  in nsIDOMWindow aParentWindow);
412 
413  /* \brief Selection changes notification
414  * \param aNode the node that is now selected
415  * \param aParentWindow the toplevel window we're displaying in
416  */
418  in nsIDOMNode aContainer,
419  in nsIDOMWindow aParentWindow);
420 
421  PRBool canDrop(in sbIServicePaneNode aNode,
422  in nsIDragSession aDragSession,
423  in PRInt32 aOrientation,
424  in nsIDOMWindow aWindow);
425  void onDrop(in sbIServicePaneNode aNode,
426  in nsIDragSession aDragSession,
427  in PRInt32 aOrientation,
428  in nsIDOMWindow aWindow);
429  PRBool onDragGesture(in sbIServicePaneNode aNode,
430  in nsIDOMDataTransfer aDataTransfer);
431 
432  /* \brief Called before a user starts to rename a node.
433  * \param aNode the node that is about to be renamed
434  */
435  void onBeforeRename(in sbIServicePaneNode aNode);
436 
437  /* \brief Called when a node is renamed by the user, allows
438  * the module to accept the action by setting the
439  * node name to the given value.
440  * \param aNode the node that was renamed
441  * \param aNewName new name entered by the user or null if user canceled
442  * renaming
443  */
444  void onRename(in sbIServicePaneNode aNode,
445  in AString aNewName);
446 
447  /* \brief optional URI of stringbundle to use to localize names of nodes
448  associated with this module */
449  readonly attribute AString stringbundle;
450 
451  /* \brief Called when service pane service is shutting down
452  */
453  void shutdown();
454 };
455 
456 
sbIServicePaneNode getNode(in AString aId)
void nodeRemoved(in sbIServicePaneNode aNode, in sbIServicePaneNode aParent)
Called after a node is removed from the service pane tree.
PRBool onDragGesture(in sbIServicePaneNode aNode, in nsIDOMDataTransfer aDataTransfer)
attribute AString dndAcceptNear
attribute AString className
void fillContextMenu(in sbIServicePaneNode aNode, in nsIDOMXULElement aContextMenu, in nsIDOMWindow aParentWindow)
void servicePaneInit(in sbIServicePaneService aServicePaneService)
AString setAttribute(in AString aName, in AString aValue)
readonly attribute AString stringbundle
nsIArray getNodesByAttributeNS(in AString aNamespace, in AString aName, in AString aValue)
readonly attribute sbIServicePaneNode previousSibling
void removeEventListener(in sbIServicePaneNodeListener aListener)
attribute AString properties
void onSelectionChanged(in sbIServicePaneNode aNode, in nsIDOMNode aContainer, in nsIDOMWindow aParentWindow)
onPageChanged aValue
Definition: FeedWriter.js:1395
void removeAttribute(in AString aName)
AString getAttributeNS(in AString aNamespace, in AString aName)
readonly attribute sbIServicePaneNode parentNode
PRBool canDrop(in sbIServicePaneNode aNode, in nsIDragSession aDragSession, in PRInt32 aOrientation, in nsIDOMWindow aWindow)
var event
void fillNewItemMenu(in sbIServicePaneNode aNode, in nsIDOMXULElement aContextMenu, in nsIDOMWindow aParentWindow)
boolean hasAttributeNS(in aString aNamespace, in AString aName)
PRBool canDrop(in sbIServicePaneNode aNode, in nsIDragSession aDragSession, in PRInt32 aOrientation, in nsIDOMWindow aWindow)
void addListener(in sbIServicePaneListener aListener)
const unsigned long URL_MATCH_EXACT
void onSelectionChanged(in sbIServicePaneNode aNode, in nsIDOMNode aContainer, in nsIDOMWindow aParentWindow)
void removeChild(in sbIServicePaneNode aChild)
PRBool onDragGesture(in sbIServicePaneNode aNode, in nsIDOMDataTransfer aDataTransfer)
var uuid
void removeAttributeNS(in AString aNamespace, in AString aName)
sbIServicePaneNode insertBefore(in sbIServicePaneNode aNewNode, in sbIServicePaneNode aAdjacentNode)
AString getAttribute(in AString aName)
const nsIDOMWindow
attribute AString contentPrefix
A prefix for URLs associated with this node. This prefix is used to test urls when sbIServicePaneServ...
void onBeforeRename(in sbIServicePaneNode aNode)
void nodePropertyChanged(in string aNodeId, in string aAttributeName)
A node attribute has changed.
readonly attribute AString displayName
The interface to be implemented by node mutation listeners added via sbIServicePaneNode.addListener()
void onDrop(in sbIServicePaneNode aNode, in nsIDragSession aDragSession, in PRInt32 aOrientation, in nsIDOMWindow aWindow)
attribute boolean editable
Listen for changes on service pane nodes.
sbIServicePaneNode appendChild(in sbIServicePaneNode aChild)
void nodeInserted(in sbIServicePaneNode aNode, in sbIServicePaneNode aParent, in sbIServicePaneNode aInsertBefores)
Called after a node is added to the service pane tree.
readonly attribute sbIServicePaneNode root
The root of the tree.
attribute AString dndDragTypes
readonly attribute sbIServicePaneNode nextSibling
boolean hasAttribute(in AString aName)
sbIServicePaneNode addNode(in AString aId, in sbIServicePaneNode aParent, in boolean aContainer)
readonly attribute nsIStringEnumerator attributes
enumerator returning names of node attributes
The interface to be implemented by node event listeners added via sbIServicePaneNode.addEventListener()
AString setAttributeNS(in AString aNamespace, in AString aName, in AString aValue)
sbIServicePaneNode createNode()
attribute boolean hidden
readonly attribute sbIServicePaneNode firstChild
attribute AString stringbundle
sbIServicePaneNode getNodeForURL(in AString aURL, [optional] in unsigned long aMatchLevel)
void onBeforeRename(in sbIServicePaneNode aNode)
void fillNewItemMenu(in sbIServicePaneNode aNode, in nsIDOMXULElement aContextMenu, in nsIDOMWindow aParentWindow)
_updateCookies aName
void addMutationListener(in sbIServicePaneMutationListener aListener)
Adds mutation listener that will be called whenever a node or one of its children get modified...
attribute boolean isOpen
void replaceChild(in sbIServicePaneNode aNewNode, in sbIServicePaneNode aOldNode)
readonly attribute boolean isContainer
void removeNode(in sbIServicePaneNode aNode)
readonly attribute nsISimpleEnumerator childNodes
enumerator returning node's child nodes
attribute AString dndAcceptIn
void sortNode(in sbIServicePaneNode aNode)
void onRename(in sbIServicePaneNode aNode, in AString aNewName)
void addEventListener(in sbIServicePaneNodeListener aListener)
Event listeners that will be called whenever the node gets notified that the given event has occured ...
void onRename(in sbIServicePaneNode aNode, in AString aNewName)
void removeMutationListener(in sbIServicePaneMutationListener aListener)
Removes a previously added mutation listener.
The interface to interact with a particular node in the service pane.
attribute AString searchtype
attribute AString tooltip
attribute AString contractid
void attrModified(in sbIServicePaneNode aNode, in AString aAttrName, in AString aNamespace, in AString aOldVal, in AString aNewVal)
Called after a node attribute changes.
void dispatchEvent(in AString event)
void handleEvent(in AString aEventName)
The interface exposed by the service pane backends.
void removeListener(in sbIServicePaneListener aListener)
const unsigned long URL_MATCH_PREFIX
readonly attribute sbIServicePaneNode lastChild
void fillContextMenu(in sbIServicePaneNode aNode, in nsIDOMXULElement aContextMenu, in nsIDOMWindow aParentWindow)
The interface exposed by the service pane service.
void onDrop(in sbIServicePaneNode aNode, in nsIDragSession aDragSession, in PRInt32 aOrientation, in nsIDOMWindow aWindow)