Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | #include "extIApplication.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIVariant; |
michael@0 | 9 | interface nsIURI; |
michael@0 | 10 | interface nsIDOMHTMLDocument; |
michael@0 | 11 | |
michael@0 | 12 | interface fuelIBookmarkFolder; |
michael@0 | 13 | interface fuelIBrowserTab; |
michael@0 | 14 | |
michael@0 | 15 | /** |
michael@0 | 16 | * Interface representing a collection of annotations associated |
michael@0 | 17 | * with a bookmark or bookmark folder. |
michael@0 | 18 | */ |
michael@0 | 19 | [scriptable, uuid(335c9292-91a1-4ca0-ad0b-07d5f63ed6cd)] |
michael@0 | 20 | interface fuelIAnnotations : nsISupports |
michael@0 | 21 | { |
michael@0 | 22 | /** |
michael@0 | 23 | * Array of the annotation names associated with the owning item |
michael@0 | 24 | */ |
michael@0 | 25 | readonly attribute nsIVariant names; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * Determines if an annotation exists with the given name. |
michael@0 | 29 | * @param aName |
michael@0 | 30 | * The name of the annotation |
michael@0 | 31 | * @returns true if an annotation exists with the given name, |
michael@0 | 32 | * false otherwise. |
michael@0 | 33 | */ |
michael@0 | 34 | boolean has(in AString aName); |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * Gets the value of an annotation with the given name. |
michael@0 | 38 | * @param aName |
michael@0 | 39 | * The name of the annotation |
michael@0 | 40 | * @returns A variant containing the value of the annotation. Supports |
michael@0 | 41 | * string, boolean and number. |
michael@0 | 42 | */ |
michael@0 | 43 | nsIVariant get(in AString aName); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Sets the value of an annotation with the given name. |
michael@0 | 47 | * @param aName |
michael@0 | 48 | * The name of the annotation |
michael@0 | 49 | * @param aValue |
michael@0 | 50 | * The new value of the annotation. Supports string, boolean |
michael@0 | 51 | * and number |
michael@0 | 52 | * @param aExpiration |
michael@0 | 53 | * The expiration policy for the annotation. |
michael@0 | 54 | * See nsIAnnotationService. |
michael@0 | 55 | */ |
michael@0 | 56 | void set(in AString aName, in nsIVariant aValue, in int32_t aExpiration); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * Removes the named annotation from the owner item. |
michael@0 | 60 | * @param aName |
michael@0 | 61 | * The name of annotation. |
michael@0 | 62 | */ |
michael@0 | 63 | void remove(in AString aName); |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | * Interface representing a bookmark item. |
michael@0 | 69 | */ |
michael@0 | 70 | [scriptable, uuid(808585b6-7568-4b26-8c62-545221bf2b8c)] |
michael@0 | 71 | interface fuelIBookmark : nsISupports |
michael@0 | 72 | { |
michael@0 | 73 | /** |
michael@0 | 74 | * The id of the bookmark. |
michael@0 | 75 | */ |
michael@0 | 76 | readonly attribute long long id; |
michael@0 | 77 | |
michael@0 | 78 | /** |
michael@0 | 79 | * The title of the bookmark. |
michael@0 | 80 | */ |
michael@0 | 81 | attribute AString title; |
michael@0 | 82 | |
michael@0 | 83 | /** |
michael@0 | 84 | * The uri of the bookmark. |
michael@0 | 85 | */ |
michael@0 | 86 | attribute nsIURI uri; |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | * The description of the bookmark. |
michael@0 | 90 | */ |
michael@0 | 91 | attribute AString description; |
michael@0 | 92 | |
michael@0 | 93 | /** |
michael@0 | 94 | * The keyword associated with the bookmark. |
michael@0 | 95 | */ |
michael@0 | 96 | attribute AString keyword; |
michael@0 | 97 | |
michael@0 | 98 | /** |
michael@0 | 99 | * The type of the bookmark. |
michael@0 | 100 | * values: "bookmark", "separator" |
michael@0 | 101 | */ |
michael@0 | 102 | readonly attribute AString type; |
michael@0 | 103 | |
michael@0 | 104 | /** |
michael@0 | 105 | * The parent folder of the bookmark. |
michael@0 | 106 | */ |
michael@0 | 107 | attribute fuelIBookmarkFolder parent; |
michael@0 | 108 | |
michael@0 | 109 | /** |
michael@0 | 110 | * The annotations object for the bookmark. |
michael@0 | 111 | */ |
michael@0 | 112 | readonly attribute fuelIAnnotations annotations; |
michael@0 | 113 | |
michael@0 | 114 | /** |
michael@0 | 115 | * The events object for the bookmark. |
michael@0 | 116 | * supports: "remove", "change", "visit", "move" |
michael@0 | 117 | */ |
michael@0 | 118 | readonly attribute extIEvents events; |
michael@0 | 119 | |
michael@0 | 120 | /** |
michael@0 | 121 | * Removes the item from the parent folder. Used to |
michael@0 | 122 | * delete a bookmark or separator |
michael@0 | 123 | */ |
michael@0 | 124 | void remove(); |
michael@0 | 125 | }; |
michael@0 | 126 | |
michael@0 | 127 | |
michael@0 | 128 | /** |
michael@0 | 129 | * Interface representing a bookmark folder. Folders |
michael@0 | 130 | * can hold bookmarks, separators and other folders. |
michael@0 | 131 | */ |
michael@0 | 132 | [scriptable, uuid(9f42fe20-52de-4a55-8632-a459c7716aa0)] |
michael@0 | 133 | interface fuelIBookmarkFolder : nsISupports |
michael@0 | 134 | { |
michael@0 | 135 | /** |
michael@0 | 136 | * The id of the folder. |
michael@0 | 137 | */ |
michael@0 | 138 | readonly attribute long long id; |
michael@0 | 139 | |
michael@0 | 140 | /** |
michael@0 | 141 | * The title of the folder. |
michael@0 | 142 | */ |
michael@0 | 143 | attribute AString title; |
michael@0 | 144 | |
michael@0 | 145 | /** |
michael@0 | 146 | * The description of the folder. |
michael@0 | 147 | */ |
michael@0 | 148 | attribute AString description; |
michael@0 | 149 | |
michael@0 | 150 | /** |
michael@0 | 151 | * The type of the folder. |
michael@0 | 152 | * values: "folder" |
michael@0 | 153 | */ |
michael@0 | 154 | readonly attribute AString type; |
michael@0 | 155 | |
michael@0 | 156 | /** |
michael@0 | 157 | * The parent folder of the folder. |
michael@0 | 158 | */ |
michael@0 | 159 | attribute fuelIBookmarkFolder parent; |
michael@0 | 160 | |
michael@0 | 161 | /** |
michael@0 | 162 | * The annotations object for the folder. |
michael@0 | 163 | */ |
michael@0 | 164 | readonly attribute fuelIAnnotations annotations; |
michael@0 | 165 | |
michael@0 | 166 | /** |
michael@0 | 167 | * The events object for the folder. |
michael@0 | 168 | * supports: "add", "addchild", "remove", "removechild", "change", "move" |
michael@0 | 169 | */ |
michael@0 | 170 | readonly attribute extIEvents events; |
michael@0 | 171 | |
michael@0 | 172 | /** |
michael@0 | 173 | * Array of all bookmarks, separators and folders contained |
michael@0 | 174 | * in this folder. |
michael@0 | 175 | */ |
michael@0 | 176 | readonly attribute nsIVariant children; |
michael@0 | 177 | |
michael@0 | 178 | /** |
michael@0 | 179 | * Adds a new child bookmark to this folder. |
michael@0 | 180 | * @param aTitle |
michael@0 | 181 | * The title of bookmark. |
michael@0 | 182 | * @param aURI |
michael@0 | 183 | * The uri of bookmark. |
michael@0 | 184 | */ |
michael@0 | 185 | fuelIBookmark addBookmark(in AString aTitle, in nsIURI aURI); |
michael@0 | 186 | |
michael@0 | 187 | /** |
michael@0 | 188 | * Adds a new child separator to this folder. |
michael@0 | 189 | */ |
michael@0 | 190 | fuelIBookmark addSeparator(); |
michael@0 | 191 | |
michael@0 | 192 | /** |
michael@0 | 193 | * Adds a new child folder to this folder. |
michael@0 | 194 | * @param aTitle |
michael@0 | 195 | * The title of folder. |
michael@0 | 196 | */ |
michael@0 | 197 | fuelIBookmarkFolder addFolder(in AString aTitle); |
michael@0 | 198 | |
michael@0 | 199 | /** |
michael@0 | 200 | * Removes the folder from the parent folder. |
michael@0 | 201 | */ |
michael@0 | 202 | void remove(); |
michael@0 | 203 | }; |
michael@0 | 204 | |
michael@0 | 205 | /** |
michael@0 | 206 | * Interface representing a container for bookmark roots. Roots |
michael@0 | 207 | * are the top level parents for the various types of bookmarks in the system. |
michael@0 | 208 | */ |
michael@0 | 209 | [scriptable, uuid(c9a80870-eb3c-11dc-95ff-0800200c9a66)] |
michael@0 | 210 | interface fuelIBookmarkRoots : nsISupports |
michael@0 | 211 | { |
michael@0 | 212 | /** |
michael@0 | 213 | * The folder for the 'bookmarks menu' root. |
michael@0 | 214 | */ |
michael@0 | 215 | readonly attribute fuelIBookmarkFolder menu; |
michael@0 | 216 | |
michael@0 | 217 | /** |
michael@0 | 218 | * The folder for the 'personal toolbar' root. |
michael@0 | 219 | */ |
michael@0 | 220 | readonly attribute fuelIBookmarkFolder toolbar; |
michael@0 | 221 | |
michael@0 | 222 | /** |
michael@0 | 223 | * The folder for the 'tags' root. |
michael@0 | 224 | */ |
michael@0 | 225 | readonly attribute fuelIBookmarkFolder tags; |
michael@0 | 226 | |
michael@0 | 227 | /** |
michael@0 | 228 | * The folder for the 'unfiled bookmarks' root. |
michael@0 | 229 | */ |
michael@0 | 230 | readonly attribute fuelIBookmarkFolder unfiled; |
michael@0 | 231 | }; |
michael@0 | 232 | |
michael@0 | 233 | /** |
michael@0 | 234 | * Interface representing a browser window. |
michael@0 | 235 | */ |
michael@0 | 236 | [scriptable, uuid(207edb28-eb5e-424e-a862-b0e97C8de866)] |
michael@0 | 237 | interface fuelIWindow : nsISupports |
michael@0 | 238 | { |
michael@0 | 239 | /** |
michael@0 | 240 | * A collection of browser tabs within the browser window. |
michael@0 | 241 | */ |
michael@0 | 242 | readonly attribute nsIVariant tabs; |
michael@0 | 243 | |
michael@0 | 244 | /** |
michael@0 | 245 | * The currently-active tab within the browser window. |
michael@0 | 246 | */ |
michael@0 | 247 | readonly attribute fuelIBrowserTab activeTab; |
michael@0 | 248 | |
michael@0 | 249 | /** |
michael@0 | 250 | * Open a new browser tab, pointing to the specified URI. |
michael@0 | 251 | * @param aURI |
michael@0 | 252 | * The uri to open the browser tab to |
michael@0 | 253 | */ |
michael@0 | 254 | fuelIBrowserTab open(in nsIURI aURI); |
michael@0 | 255 | |
michael@0 | 256 | /** |
michael@0 | 257 | * The events object for the browser window. |
michael@0 | 258 | * supports: "TabOpen", "TabClose", "TabMove", "TabSelect" |
michael@0 | 259 | */ |
michael@0 | 260 | readonly attribute extIEvents events; |
michael@0 | 261 | }; |
michael@0 | 262 | |
michael@0 | 263 | /** |
michael@0 | 264 | * Interface representing a browser tab. |
michael@0 | 265 | */ |
michael@0 | 266 | [scriptable, uuid(3073ceff-777c-41ce-9ace-ab37268147c1)] |
michael@0 | 267 | interface fuelIBrowserTab : nsISupports |
michael@0 | 268 | { |
michael@0 | 269 | /** |
michael@0 | 270 | * The current uri of this tab. |
michael@0 | 271 | */ |
michael@0 | 272 | readonly attribute nsIURI uri; |
michael@0 | 273 | |
michael@0 | 274 | /** |
michael@0 | 275 | * The current index of this tab in the browser window. |
michael@0 | 276 | */ |
michael@0 | 277 | readonly attribute int32_t index; |
michael@0 | 278 | |
michael@0 | 279 | /** |
michael@0 | 280 | * The browser window that is holding the tab. |
michael@0 | 281 | */ |
michael@0 | 282 | readonly attribute fuelIWindow window; |
michael@0 | 283 | |
michael@0 | 284 | /** |
michael@0 | 285 | * The content document of the browser tab. |
michael@0 | 286 | */ |
michael@0 | 287 | readonly attribute nsIDOMHTMLDocument document; |
michael@0 | 288 | |
michael@0 | 289 | /** |
michael@0 | 290 | * The events object for the browser tab. |
michael@0 | 291 | * supports: "load" |
michael@0 | 292 | */ |
michael@0 | 293 | readonly attribute extIEvents events; |
michael@0 | 294 | |
michael@0 | 295 | /** |
michael@0 | 296 | * Load a new URI into this browser tab. |
michael@0 | 297 | * @param aURI |
michael@0 | 298 | * The uri to load into the browser tab |
michael@0 | 299 | */ |
michael@0 | 300 | void load(in nsIURI aURI); |
michael@0 | 301 | |
michael@0 | 302 | /** |
michael@0 | 303 | * Give focus to this browser tab, and bring it to the front. |
michael@0 | 304 | */ |
michael@0 | 305 | void focus(); |
michael@0 | 306 | |
michael@0 | 307 | /** |
michael@0 | 308 | * Close the browser tab. This may not actually close the tab |
michael@0 | 309 | * as script may abort the close operation. |
michael@0 | 310 | */ |
michael@0 | 311 | void close(); |
michael@0 | 312 | |
michael@0 | 313 | /** |
michael@0 | 314 | * Moves this browser tab before another browser tab within the window. |
michael@0 | 315 | * @param aBefore |
michael@0 | 316 | * The tab before which the target tab will be moved |
michael@0 | 317 | */ |
michael@0 | 318 | void moveBefore(in fuelIBrowserTab aBefore); |
michael@0 | 319 | |
michael@0 | 320 | /** |
michael@0 | 321 | * Move this browser tab to the last tab within the window. |
michael@0 | 322 | */ |
michael@0 | 323 | void moveToEnd(); |
michael@0 | 324 | }; |
michael@0 | 325 | |
michael@0 | 326 | /** |
michael@0 | 327 | * Interface for managing and accessing the applications systems |
michael@0 | 328 | */ |
michael@0 | 329 | [scriptable, uuid(fe74cf80-aa2d-11db-abbd-0800200c9a66)] |
michael@0 | 330 | interface fuelIApplication : extIApplication |
michael@0 | 331 | { |
michael@0 | 332 | /** |
michael@0 | 333 | * The root bookmarks object for the application. |
michael@0 | 334 | * Contains all the bookmark roots in the system. |
michael@0 | 335 | */ |
michael@0 | 336 | readonly attribute fuelIBookmarkRoots bookmarks; |
michael@0 | 337 | |
michael@0 | 338 | /** |
michael@0 | 339 | * An array of browser windows within the application. |
michael@0 | 340 | */ |
michael@0 | 341 | readonly attribute nsIVariant windows; |
michael@0 | 342 | |
michael@0 | 343 | /** |
michael@0 | 344 | * The currently active browser window. |
michael@0 | 345 | */ |
michael@0 | 346 | readonly attribute fuelIWindow activeWindow; |
michael@0 | 347 | }; |