|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 interface nsIArray; |
|
9 interface nsIMutableArray; |
|
10 |
|
11 [scriptable, uuid(1FE6A9CD-2B18-4dd5-A176-C2B32FA4F683)] |
|
12 interface nsIJumpListBuilder : nsISupports |
|
13 { |
|
14 /** |
|
15 * JumpLists |
|
16 * |
|
17 * Jump lists are built and then applied. Modifying an applied jump list is not |
|
18 * permitted. Callers should begin the creation of a new jump list using |
|
19 * initListBuild, add sub lists using addListToBuild, then commit the jump list |
|
20 * using commitListBuild. Lists are built in real-time during the sequence of |
|
21 * build calls, make sure to check for errors on each individual step. |
|
22 * |
|
23 * The default number of allowed items in a jump list is ten. Users can change |
|
24 * the number through system preferences. User may also pin items to jump lists, |
|
25 * which take up additional slots. Applications do not have control over the |
|
26 * number of items allowed in jump lists; excess items added are dropped by the |
|
27 * system. Item insertion priority is defined as first to last added. |
|
28 * |
|
29 * Users may remove items from jump lists after they are commited. The system |
|
30 * tracks removed items between commits. A list of these items is returned by |
|
31 * a call to initListBuild. nsIJumpListBuilder does not filter entries added that |
|
32 * have been removed since the last commit. To prevent repeatedly adding entries |
|
33 * users have removed, applications are encoraged to track removed items |
|
34 * internally. |
|
35 * |
|
36 * Each list is made up of an array of nsIJumpListItem representing items |
|
37 * such as shortcuts, links, and separators. See nsIJumpListItem for information |
|
38 * on adding additional jump list types. |
|
39 */ |
|
40 |
|
41 /** |
|
42 * List Types |
|
43 */ |
|
44 |
|
45 /** |
|
46 * Task List |
|
47 * |
|
48 * Tasks are common actions performed by users within the application. A task |
|
49 * can be represented by an application shortcut and associated command line |
|
50 * parameters or a URI. Task lists should generally be static lists that do not |
|
51 * change often, if at all - similar to an application menu. |
|
52 * |
|
53 * Tasks are given the highest priority of all lists when space is limited. |
|
54 */ |
|
55 const short JUMPLIST_CATEGORY_TASKS = 0; |
|
56 |
|
57 /** |
|
58 * Recent or Frequent list |
|
59 * |
|
60 * Recent and frequent lists are based on Window's recent document lists. The |
|
61 * lists are generated automatically by Windows. Applications that use recent |
|
62 * or frequent lists should keep document use tracking up to date by calling |
|
63 * the SHAddToRecentDocs shell api. |
|
64 */ |
|
65 const short JUMPLIST_CATEGORY_RECENT = 1; |
|
66 const short JUMPLIST_CATEGORY_FREQUENT = 2; |
|
67 |
|
68 /** |
|
69 * Custom Lists |
|
70 * |
|
71 * Custom lists can be made up of tasks, links, and separators. The title of |
|
72 * of the list is passed through the optional string parameter of addBuildList. |
|
73 */ |
|
74 const short JUMPLIST_CATEGORY_CUSTOMLIST = 3; |
|
75 |
|
76 /** |
|
77 * Indicates whether jump list taskbar features are supported by the current |
|
78 * host. |
|
79 */ |
|
80 readonly attribute short available; |
|
81 |
|
82 /** |
|
83 * JumpList management |
|
84 * |
|
85 * @throw NS_ERROR_NOT_AVAILABLE on all calls if taskbar functionality |
|
86 * is not supported by the operating system. |
|
87 */ |
|
88 |
|
89 /** |
|
90 * Indicates if a commit has already occurred in this session. |
|
91 */ |
|
92 readonly attribute boolean isListCommitted; |
|
93 |
|
94 /** |
|
95 * The maximum number of jump list items the current desktop can support. |
|
96 */ |
|
97 readonly attribute short maxListItems; |
|
98 |
|
99 /** |
|
100 * Initializes a jump list build and returns a list of items the user removed |
|
101 * since the last time a jump list was committed. Removed items can become state |
|
102 * after initListBuild is called, lists should be built in single-shot fasion. |
|
103 * |
|
104 * @param removedItems |
|
105 * A list of items that were removed by the user since the last commit. |
|
106 * |
|
107 * @returns true if the operation completed successfully. |
|
108 */ |
|
109 boolean initListBuild(in nsIMutableArray removedItems); |
|
110 |
|
111 /** |
|
112 * Adds a list and if required, a set of items for the list. |
|
113 * |
|
114 * @param aCatType |
|
115 * The type of list to add. |
|
116 * @param items |
|
117 * An array of nsIJumpListItem items to add to the list. |
|
118 * @param catName |
|
119 * For custom lists, the title of the list. |
|
120 * |
|
121 * @returns true if the operation completed successfully. |
|
122 * |
|
123 * @throw NS_ERROR_INVALID_ARG if incorrect parameters are passed for |
|
124 * a particular category or item type. |
|
125 * @throw NS_ERROR_ILLEGAL_VALUE if an item is added that was removed |
|
126 * since the last commit. |
|
127 * @throw NS_ERROR_UNEXPECTED on internal errors. |
|
128 */ |
|
129 boolean addListToBuild(in short aCatType, [optional] in nsIArray items, [optional] in AString catName); |
|
130 |
|
131 /** |
|
132 * Aborts and clears the current jump list build. |
|
133 */ |
|
134 void abortListBuild(); |
|
135 |
|
136 /** |
|
137 * Commits the current jump list build to the Taskbar. |
|
138 * |
|
139 * @returns true if the operation completed successfully. |
|
140 */ |
|
141 boolean commitListBuild(); |
|
142 |
|
143 /** |
|
144 * Deletes any currently applied taskbar jump list for this application. |
|
145 * Common uses would be the enabling of a privacy mode and uninstallation. |
|
146 * |
|
147 * @returns true if the operation completed successfully. |
|
148 * |
|
149 * @throw NS_ERROR_UNEXPECTED on internal errors. |
|
150 */ |
|
151 boolean deleteActiveList(); |
|
152 }; |