michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "extIApplication.idl" michael@0: michael@0: interface nsIVariant; michael@0: interface nsIURI; michael@0: interface nsIDOMHTMLDocument; michael@0: michael@0: interface fuelIBookmarkFolder; michael@0: interface fuelIBrowserTab; michael@0: michael@0: /** michael@0: * Interface representing a collection of annotations associated michael@0: * with a bookmark or bookmark folder. michael@0: */ michael@0: [scriptable, uuid(335c9292-91a1-4ca0-ad0b-07d5f63ed6cd)] michael@0: interface fuelIAnnotations : nsISupports michael@0: { michael@0: /** michael@0: * Array of the annotation names associated with the owning item michael@0: */ michael@0: readonly attribute nsIVariant names; michael@0: michael@0: /** michael@0: * Determines if an annotation exists with the given name. michael@0: * @param aName michael@0: * The name of the annotation michael@0: * @returns true if an annotation exists with the given name, michael@0: * false otherwise. michael@0: */ michael@0: boolean has(in AString aName); michael@0: michael@0: /** michael@0: * Gets the value of an annotation with the given name. michael@0: * @param aName michael@0: * The name of the annotation michael@0: * @returns A variant containing the value of the annotation. Supports michael@0: * string, boolean and number. michael@0: */ michael@0: nsIVariant get(in AString aName); michael@0: michael@0: /** michael@0: * Sets the value of an annotation with the given name. michael@0: * @param aName michael@0: * The name of the annotation michael@0: * @param aValue michael@0: * The new value of the annotation. Supports string, boolean michael@0: * and number michael@0: * @param aExpiration michael@0: * The expiration policy for the annotation. michael@0: * See nsIAnnotationService. michael@0: */ michael@0: void set(in AString aName, in nsIVariant aValue, in int32_t aExpiration); michael@0: michael@0: /** michael@0: * Removes the named annotation from the owner item. michael@0: * @param aName michael@0: * The name of annotation. michael@0: */ michael@0: void remove(in AString aName); michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * Interface representing a bookmark item. michael@0: */ michael@0: [scriptable, uuid(808585b6-7568-4b26-8c62-545221bf2b8c)] michael@0: interface fuelIBookmark : nsISupports michael@0: { michael@0: /** michael@0: * The id of the bookmark. michael@0: */ michael@0: readonly attribute long long id; michael@0: michael@0: /** michael@0: * The title of the bookmark. michael@0: */ michael@0: attribute AString title; michael@0: michael@0: /** michael@0: * The uri of the bookmark. michael@0: */ michael@0: attribute nsIURI uri; michael@0: michael@0: /** michael@0: * The description of the bookmark. michael@0: */ michael@0: attribute AString description; michael@0: michael@0: /** michael@0: * The keyword associated with the bookmark. michael@0: */ michael@0: attribute AString keyword; michael@0: michael@0: /** michael@0: * The type of the bookmark. michael@0: * values: "bookmark", "separator" michael@0: */ michael@0: readonly attribute AString type; michael@0: michael@0: /** michael@0: * The parent folder of the bookmark. michael@0: */ michael@0: attribute fuelIBookmarkFolder parent; michael@0: michael@0: /** michael@0: * The annotations object for the bookmark. michael@0: */ michael@0: readonly attribute fuelIAnnotations annotations; michael@0: michael@0: /** michael@0: * The events object for the bookmark. michael@0: * supports: "remove", "change", "visit", "move" michael@0: */ michael@0: readonly attribute extIEvents events; michael@0: michael@0: /** michael@0: * Removes the item from the parent folder. Used to michael@0: * delete a bookmark or separator michael@0: */ michael@0: void remove(); michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * Interface representing a bookmark folder. Folders michael@0: * can hold bookmarks, separators and other folders. michael@0: */ michael@0: [scriptable, uuid(9f42fe20-52de-4a55-8632-a459c7716aa0)] michael@0: interface fuelIBookmarkFolder : nsISupports michael@0: { michael@0: /** michael@0: * The id of the folder. michael@0: */ michael@0: readonly attribute long long id; michael@0: michael@0: /** michael@0: * The title of the folder. michael@0: */ michael@0: attribute AString title; michael@0: michael@0: /** michael@0: * The description of the folder. michael@0: */ michael@0: attribute AString description; michael@0: michael@0: /** michael@0: * The type of the folder. michael@0: * values: "folder" michael@0: */ michael@0: readonly attribute AString type; michael@0: michael@0: /** michael@0: * The parent folder of the folder. michael@0: */ michael@0: attribute fuelIBookmarkFolder parent; michael@0: michael@0: /** michael@0: * The annotations object for the folder. michael@0: */ michael@0: readonly attribute fuelIAnnotations annotations; michael@0: michael@0: /** michael@0: * The events object for the folder. michael@0: * supports: "add", "addchild", "remove", "removechild", "change", "move" michael@0: */ michael@0: readonly attribute extIEvents events; michael@0: michael@0: /** michael@0: * Array of all bookmarks, separators and folders contained michael@0: * in this folder. michael@0: */ michael@0: readonly attribute nsIVariant children; michael@0: michael@0: /** michael@0: * Adds a new child bookmark to this folder. michael@0: * @param aTitle michael@0: * The title of bookmark. michael@0: * @param aURI michael@0: * The uri of bookmark. michael@0: */ michael@0: fuelIBookmark addBookmark(in AString aTitle, in nsIURI aURI); michael@0: michael@0: /** michael@0: * Adds a new child separator to this folder. michael@0: */ michael@0: fuelIBookmark addSeparator(); michael@0: michael@0: /** michael@0: * Adds a new child folder to this folder. michael@0: * @param aTitle michael@0: * The title of folder. michael@0: */ michael@0: fuelIBookmarkFolder addFolder(in AString aTitle); michael@0: michael@0: /** michael@0: * Removes the folder from the parent folder. michael@0: */ michael@0: void remove(); michael@0: }; michael@0: michael@0: /** michael@0: * Interface representing a container for bookmark roots. Roots michael@0: * are the top level parents for the various types of bookmarks in the system. michael@0: */ michael@0: [scriptable, uuid(c9a80870-eb3c-11dc-95ff-0800200c9a66)] michael@0: interface fuelIBookmarkRoots : nsISupports michael@0: { michael@0: /** michael@0: * The folder for the 'bookmarks menu' root. michael@0: */ michael@0: readonly attribute fuelIBookmarkFolder menu; michael@0: michael@0: /** michael@0: * The folder for the 'personal toolbar' root. michael@0: */ michael@0: readonly attribute fuelIBookmarkFolder toolbar; michael@0: michael@0: /** michael@0: * The folder for the 'tags' root. michael@0: */ michael@0: readonly attribute fuelIBookmarkFolder tags; michael@0: michael@0: /** michael@0: * The folder for the 'unfiled bookmarks' root. michael@0: */ michael@0: readonly attribute fuelIBookmarkFolder unfiled; michael@0: }; michael@0: michael@0: /** michael@0: * Interface representing a browser window. michael@0: */ michael@0: [scriptable, uuid(207edb28-eb5e-424e-a862-b0e97C8de866)] michael@0: interface fuelIWindow : nsISupports michael@0: { michael@0: /** michael@0: * A collection of browser tabs within the browser window. michael@0: */ michael@0: readonly attribute nsIVariant tabs; michael@0: michael@0: /** michael@0: * The currently-active tab within the browser window. michael@0: */ michael@0: readonly attribute fuelIBrowserTab activeTab; michael@0: michael@0: /** michael@0: * Open a new browser tab, pointing to the specified URI. michael@0: * @param aURI michael@0: * The uri to open the browser tab to michael@0: */ michael@0: fuelIBrowserTab open(in nsIURI aURI); michael@0: michael@0: /** michael@0: * The events object for the browser window. michael@0: * supports: "TabOpen", "TabClose", "TabMove", "TabSelect" michael@0: */ michael@0: readonly attribute extIEvents events; michael@0: }; michael@0: michael@0: /** michael@0: * Interface representing a browser tab. michael@0: */ michael@0: [scriptable, uuid(3073ceff-777c-41ce-9ace-ab37268147c1)] michael@0: interface fuelIBrowserTab : nsISupports michael@0: { michael@0: /** michael@0: * The current uri of this tab. michael@0: */ michael@0: readonly attribute nsIURI uri; michael@0: michael@0: /** michael@0: * The current index of this tab in the browser window. michael@0: */ michael@0: readonly attribute int32_t index; michael@0: michael@0: /** michael@0: * The browser window that is holding the tab. michael@0: */ michael@0: readonly attribute fuelIWindow window; michael@0: michael@0: /** michael@0: * The content document of the browser tab. michael@0: */ michael@0: readonly attribute nsIDOMHTMLDocument document; michael@0: michael@0: /** michael@0: * The events object for the browser tab. michael@0: * supports: "load" michael@0: */ michael@0: readonly attribute extIEvents events; michael@0: michael@0: /** michael@0: * Load a new URI into this browser tab. michael@0: * @param aURI michael@0: * The uri to load into the browser tab michael@0: */ michael@0: void load(in nsIURI aURI); michael@0: michael@0: /** michael@0: * Give focus to this browser tab, and bring it to the front. michael@0: */ michael@0: void focus(); michael@0: michael@0: /** michael@0: * Close the browser tab. This may not actually close the tab michael@0: * as script may abort the close operation. michael@0: */ michael@0: void close(); michael@0: michael@0: /** michael@0: * Moves this browser tab before another browser tab within the window. michael@0: * @param aBefore michael@0: * The tab before which the target tab will be moved michael@0: */ michael@0: void moveBefore(in fuelIBrowserTab aBefore); michael@0: michael@0: /** michael@0: * Move this browser tab to the last tab within the window. michael@0: */ michael@0: void moveToEnd(); michael@0: }; michael@0: michael@0: /** michael@0: * Interface for managing and accessing the applications systems michael@0: */ michael@0: [scriptable, uuid(fe74cf80-aa2d-11db-abbd-0800200c9a66)] michael@0: interface fuelIApplication : extIApplication michael@0: { michael@0: /** michael@0: * The root bookmarks object for the application. michael@0: * Contains all the bookmark roots in the system. michael@0: */ michael@0: readonly attribute fuelIBookmarkRoots bookmarks; michael@0: michael@0: /** michael@0: * An array of browser windows within the application. michael@0: */ michael@0: readonly attribute nsIVariant windows; michael@0: michael@0: /** michael@0: * The currently active browser window. michael@0: */ michael@0: readonly attribute fuelIWindow activeWindow; michael@0: };