browser/fuel/public/fuelIApplication.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/fuel/public/fuelIApplication.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,347 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +#include "extIApplication.idl"
    1.10 +
    1.11 +interface nsIVariant;
    1.12 +interface nsIURI;
    1.13 +interface nsIDOMHTMLDocument;
    1.14 +
    1.15 +interface fuelIBookmarkFolder;
    1.16 +interface fuelIBrowserTab;
    1.17 +
    1.18 +/**
    1.19 + * Interface representing a collection of annotations associated
    1.20 + * with a bookmark or bookmark folder.
    1.21 + */
    1.22 +[scriptable, uuid(335c9292-91a1-4ca0-ad0b-07d5f63ed6cd)]
    1.23 +interface fuelIAnnotations : nsISupports
    1.24 +{
    1.25 +  /**
    1.26 +   * Array of the annotation names associated with the owning item
    1.27 +   */
    1.28 +  readonly attribute nsIVariant names;
    1.29 +
    1.30 +  /**
    1.31 +   * Determines if an annotation exists with the given name.
    1.32 +   * @param   aName
    1.33 +   *          The name of the annotation
    1.34 +   * @returns true if an annotation exists with the given name,
    1.35 +   *          false otherwise.
    1.36 +   */
    1.37 +  boolean has(in AString aName);
    1.38 +
    1.39 +  /**
    1.40 +   * Gets the value of an annotation with the given name.
    1.41 +   * @param   aName
    1.42 +   *          The name of the annotation
    1.43 +   * @returns A variant containing the value of the annotation. Supports
    1.44 +   *          string, boolean and number.
    1.45 +   */
    1.46 +  nsIVariant get(in AString aName);
    1.47 +
    1.48 +  /**
    1.49 +   * Sets the value of an annotation with the given name.
    1.50 +   * @param   aName
    1.51 +   *          The name of the annotation
    1.52 +   * @param   aValue
    1.53 +   *          The new value of the annotation. Supports string, boolean
    1.54 +   *          and number
    1.55 +   * @param   aExpiration
    1.56 +   *          The expiration policy for the annotation.
    1.57 +   *          See nsIAnnotationService.
    1.58 +   */
    1.59 +  void set(in AString aName, in nsIVariant aValue, in int32_t aExpiration);
    1.60 +
    1.61 +  /**
    1.62 +   * Removes the named annotation from the owner item.
    1.63 +   * @param   aName
    1.64 +   *          The name of annotation.
    1.65 +   */
    1.66 +  void remove(in AString aName);
    1.67 +};
    1.68 +
    1.69 +
    1.70 +/**
    1.71 + * Interface representing a bookmark item.
    1.72 + */
    1.73 +[scriptable, uuid(808585b6-7568-4b26-8c62-545221bf2b8c)]
    1.74 +interface fuelIBookmark : nsISupports
    1.75 +{
    1.76 +  /**
    1.77 +   * The id of the bookmark.
    1.78 +   */
    1.79 +  readonly attribute long long id;
    1.80 +
    1.81 +  /**
    1.82 +   * The title of the bookmark.
    1.83 +   */
    1.84 +  attribute AString title;
    1.85 +
    1.86 +  /**
    1.87 +   * The uri of the bookmark.
    1.88 +   */
    1.89 +  attribute nsIURI uri;
    1.90 +
    1.91 +  /**
    1.92 +   * The description of the bookmark.
    1.93 +   */
    1.94 +  attribute AString description;
    1.95 +
    1.96 +  /**
    1.97 +   * The keyword associated with the bookmark.
    1.98 +   */
    1.99 +  attribute AString keyword;
   1.100 +
   1.101 +  /**
   1.102 +   * The type of the bookmark.
   1.103 +   * values: "bookmark", "separator"
   1.104 +   */
   1.105 +  readonly attribute AString type;
   1.106 +
   1.107 +  /**
   1.108 +   * The parent folder of the bookmark.
   1.109 +   */
   1.110 +  attribute fuelIBookmarkFolder parent;
   1.111 +
   1.112 +  /**
   1.113 +   * The annotations object for the bookmark.
   1.114 +   */
   1.115 +  readonly attribute fuelIAnnotations annotations;
   1.116 +
   1.117 +  /**
   1.118 +   * The events object for the bookmark.
   1.119 +   * supports: "remove", "change", "visit", "move"
   1.120 +   */
   1.121 +  readonly attribute extIEvents events;
   1.122 +
   1.123 +  /**
   1.124 +   * Removes the item from the parent folder. Used to
   1.125 +   * delete a bookmark or separator
   1.126 +   */
   1.127 +  void remove();
   1.128 +};
   1.129 +
   1.130 +
   1.131 +/**
   1.132 + * Interface representing a bookmark folder. Folders
   1.133 + * can hold bookmarks, separators and other folders.
   1.134 + */
   1.135 +[scriptable, uuid(9f42fe20-52de-4a55-8632-a459c7716aa0)]
   1.136 +interface fuelIBookmarkFolder : nsISupports
   1.137 +{
   1.138 +  /**
   1.139 +   * The id of the folder.
   1.140 +   */
   1.141 +  readonly attribute long long id;
   1.142 +
   1.143 +  /**
   1.144 +   * The title of the folder.
   1.145 +   */
   1.146 +  attribute AString title;
   1.147 +
   1.148 +  /**
   1.149 +   * The description of the folder.
   1.150 +   */
   1.151 +  attribute AString description;
   1.152 +
   1.153 +  /**
   1.154 +   * The type of the folder.
   1.155 +   * values: "folder"
   1.156 +   */
   1.157 +  readonly attribute AString type;
   1.158 +
   1.159 +  /**
   1.160 +   * The parent folder of the folder.
   1.161 +   */
   1.162 +  attribute fuelIBookmarkFolder parent;
   1.163 +
   1.164 +  /**
   1.165 +   * The annotations object for the folder.
   1.166 +   */
   1.167 +  readonly attribute fuelIAnnotations annotations;
   1.168 +
   1.169 +  /**
   1.170 +   * The events object for the folder.
   1.171 +   * supports: "add", "addchild", "remove", "removechild", "change", "move"
   1.172 +   */
   1.173 +  readonly attribute extIEvents events;
   1.174 +
   1.175 +  /**
   1.176 +   * Array of all bookmarks, separators and folders contained
   1.177 +   * in this folder.
   1.178 +   */
   1.179 +  readonly attribute nsIVariant children;
   1.180 +
   1.181 +  /**
   1.182 +   * Adds a new child bookmark to this folder.
   1.183 +   * @param   aTitle
   1.184 +   *          The title of bookmark.
   1.185 +   * @param   aURI
   1.186 +   *          The uri of bookmark.
   1.187 +   */
   1.188 +  fuelIBookmark addBookmark(in AString aTitle, in nsIURI aURI);
   1.189 +
   1.190 +  /**
   1.191 +   * Adds a new child separator to this folder.
   1.192 +   */
   1.193 +  fuelIBookmark addSeparator();
   1.194 +
   1.195 +  /**
   1.196 +   * Adds a new child folder to this folder.
   1.197 +   * @param   aTitle
   1.198 +   *          The title of folder.
   1.199 +   */
   1.200 +  fuelIBookmarkFolder addFolder(in AString aTitle);
   1.201 +
   1.202 +  /**
   1.203 +   * Removes the folder from the parent folder.
   1.204 +   */
   1.205 +  void remove();
   1.206 +};
   1.207 +
   1.208 +/**
   1.209 + * Interface representing a container for bookmark roots. Roots
   1.210 + * are the top level parents for the various types of bookmarks in the system.
   1.211 + */
   1.212 +[scriptable, uuid(c9a80870-eb3c-11dc-95ff-0800200c9a66)]
   1.213 +interface fuelIBookmarkRoots : nsISupports
   1.214 +{
   1.215 +  /**
   1.216 +   * The folder for the 'bookmarks menu' root.
   1.217 +   */
   1.218 +  readonly attribute fuelIBookmarkFolder menu;
   1.219 +
   1.220 +  /**
   1.221 +   * The folder for the 'personal toolbar' root.
   1.222 +   */
   1.223 +  readonly attribute fuelIBookmarkFolder toolbar;
   1.224 +
   1.225 +  /**
   1.226 +   * The folder for the 'tags' root.
   1.227 +   */
   1.228 +  readonly attribute fuelIBookmarkFolder tags;
   1.229 +
   1.230 +  /**
   1.231 +   * The folder for the 'unfiled bookmarks' root.
   1.232 +   */
   1.233 +  readonly attribute fuelIBookmarkFolder unfiled;
   1.234 +};
   1.235 +
   1.236 +/**
   1.237 + * Interface representing a browser window.
   1.238 + */
   1.239 +[scriptable, uuid(207edb28-eb5e-424e-a862-b0e97C8de866)]
   1.240 +interface fuelIWindow : nsISupports
   1.241 +{
   1.242 +  /**
   1.243 +   * A collection of browser tabs within the browser window.
   1.244 +   */
   1.245 +  readonly attribute nsIVariant tabs;
   1.246 +
   1.247 +  /**
   1.248 +   * The currently-active tab within the browser window.
   1.249 +   */
   1.250 +  readonly attribute fuelIBrowserTab activeTab;
   1.251 +
   1.252 +  /**
   1.253 +   * Open a new browser tab, pointing to the specified URI.
   1.254 +   * @param   aURI
   1.255 +   *          The uri to open the browser tab to
   1.256 +   */
   1.257 +  fuelIBrowserTab open(in nsIURI aURI);
   1.258 +
   1.259 +  /**
   1.260 +   * The events object for the browser window.
   1.261 +   * supports: "TabOpen", "TabClose", "TabMove", "TabSelect"
   1.262 +   */
   1.263 +  readonly attribute extIEvents events;
   1.264 +};
   1.265 +
   1.266 +/**
   1.267 + * Interface representing a browser tab.
   1.268 + */
   1.269 +[scriptable, uuid(3073ceff-777c-41ce-9ace-ab37268147c1)]
   1.270 +interface fuelIBrowserTab : nsISupports
   1.271 +{
   1.272 +  /**
   1.273 +   * The current uri of this tab.
   1.274 +   */
   1.275 +  readonly attribute nsIURI uri;
   1.276 +
   1.277 +  /**
   1.278 +   * The current index of this tab in the browser window.
   1.279 +   */
   1.280 +  readonly attribute int32_t index;
   1.281 +
   1.282 +  /**
   1.283 +   * The browser window that is holding the tab.
   1.284 +   */
   1.285 +  readonly attribute fuelIWindow window;
   1.286 +
   1.287 +  /**
   1.288 +   * The content document of the browser tab.
   1.289 +   */
   1.290 +  readonly attribute nsIDOMHTMLDocument document;
   1.291 +
   1.292 +  /**
   1.293 +   * The events object for the browser tab.
   1.294 +   * supports: "load"
   1.295 +   */
   1.296 +  readonly attribute extIEvents events;
   1.297 +
   1.298 +  /**
   1.299 +   * Load a new URI into this browser tab.
   1.300 +   * @param   aURI
   1.301 +   *          The uri to load into the browser tab
   1.302 +   */
   1.303 +  void load(in nsIURI aURI);
   1.304 +
   1.305 +  /**
   1.306 +   * Give focus to this browser tab, and bring it to the front.
   1.307 +   */
   1.308 +  void focus();
   1.309 +
   1.310 +  /**
   1.311 +   * Close the browser tab. This may not actually close the tab
   1.312 +   * as script may abort the close operation.
   1.313 +   */
   1.314 +  void close();
   1.315 +
   1.316 +  /**
   1.317 +   * Moves this browser tab before another browser tab within the window.
   1.318 +   * @param   aBefore
   1.319 +   *          The tab before which the target tab will be moved
   1.320 +   */
   1.321 +  void moveBefore(in fuelIBrowserTab aBefore);
   1.322 +
   1.323 +  /**
   1.324 +   * Move this browser tab to the last tab within the window.
   1.325 +   */
   1.326 +  void moveToEnd();
   1.327 +};
   1.328 +
   1.329 +/**
   1.330 + * Interface for managing and accessing the applications systems
   1.331 + */
   1.332 +[scriptable, uuid(fe74cf80-aa2d-11db-abbd-0800200c9a66)]
   1.333 +interface fuelIApplication : extIApplication
   1.334 +{
   1.335 +  /**
   1.336 +   * The root bookmarks object for the application.
   1.337 +   * Contains all the bookmark roots in the system.
   1.338 +   */
   1.339 +  readonly attribute fuelIBookmarkRoots bookmarks;
   1.340 +
   1.341 +  /**
   1.342 +   * An array of browser windows within the application.
   1.343 +   */
   1.344 +  readonly attribute nsIVariant windows;
   1.345 +
   1.346 +  /**
   1.347 +   * The currently active browser window.
   1.348 +   */
   1.349 +  readonly attribute fuelIWindow activeWindow;
   1.350 +};

mercurial