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