Bug 1073336 part 5 - Add AnimationPlayerCollection::PlayerUpdated; r=dbaron
[gecko.git] / widget / nsIJumpListBuilder.idl
blob35846f005d4686a9cf97c12da9ab1ddeb51f8456
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/. */
6 #include "nsISupports.idl"
8 interface nsIArray;
9 interface nsIMutableArray;
11 [scriptable, uuid(1FE6A9CD-2B18-4dd5-A176-C2B32FA4F683)]
12 interface nsIJumpListBuilder : nsISupports
14 /**
15 * JumpLists
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.
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.
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.
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.
41 /**
42 * List Types
45 /**
46 * Task List
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.
53 * Tasks are given the highest priority of all lists when space is limited.
55 const short JUMPLIST_CATEGORY_TASKS = 0;
57 /**
58 * Recent or Frequent list
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.
65 const short JUMPLIST_CATEGORY_RECENT = 1;
66 const short JUMPLIST_CATEGORY_FREQUENT = 2;
68 /**
69 * Custom Lists
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.
74 const short JUMPLIST_CATEGORY_CUSTOMLIST = 3;
76 /**
77 * Indicates whether jump list taskbar features are supported by the current
78 * host.
80 readonly attribute short available;
82 /**
83 * JumpList management
85 * @throw NS_ERROR_NOT_AVAILABLE on all calls if taskbar functionality
86 * is not supported by the operating system.
89 /**
90 * Indicates if a commit has already occurred in this session.
92 readonly attribute boolean isListCommitted;
94 /**
95 * The maximum number of jump list items the current desktop can support.
97 readonly attribute short maxListItems;
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.
104 * @param removedItems
105 * A list of items that were removed by the user since the last commit.
107 * @returns true if the operation completed successfully.
109 boolean initListBuild(in nsIMutableArray removedItems);
112 * Adds a list and if required, a set of items for the list.
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.
121 * @returns true if the operation completed successfully.
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.
129 boolean addListToBuild(in short aCatType, [optional] in nsIArray items, [optional] in AString catName);
132 * Aborts and clears the current jump list build.
134 void abortListBuild();
137 * Commits the current jump list build to the Taskbar.
139 * @returns true if the operation completed successfully.
141 boolean commitListBuild();
144 * Deletes any currently applied taskbar jump list for this application.
145 * Common uses would be the enabling of a privacy mode and uninstallation.
147 * @returns true if the operation completed successfully.
149 * @throw NS_ERROR_UNEXPECTED on internal errors.
151 boolean deleteActiveList();