michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIArray; michael@0: interface nsIMutableArray; michael@0: michael@0: [scriptable, uuid(1FE6A9CD-2B18-4dd5-A176-C2B32FA4F683)] michael@0: interface nsIJumpListBuilder : nsISupports michael@0: { michael@0: /** michael@0: * JumpLists michael@0: * michael@0: * Jump lists are built and then applied. Modifying an applied jump list is not michael@0: * permitted. Callers should begin the creation of a new jump list using michael@0: * initListBuild, add sub lists using addListToBuild, then commit the jump list michael@0: * using commitListBuild. Lists are built in real-time during the sequence of michael@0: * build calls, make sure to check for errors on each individual step. michael@0: * michael@0: * The default number of allowed items in a jump list is ten. Users can change michael@0: * the number through system preferences. User may also pin items to jump lists, michael@0: * which take up additional slots. Applications do not have control over the michael@0: * number of items allowed in jump lists; excess items added are dropped by the michael@0: * system. Item insertion priority is defined as first to last added. michael@0: * michael@0: * Users may remove items from jump lists after they are commited. The system michael@0: * tracks removed items between commits. A list of these items is returned by michael@0: * a call to initListBuild. nsIJumpListBuilder does not filter entries added that michael@0: * have been removed since the last commit. To prevent repeatedly adding entries michael@0: * users have removed, applications are encoraged to track removed items michael@0: * internally. michael@0: * michael@0: * Each list is made up of an array of nsIJumpListItem representing items michael@0: * such as shortcuts, links, and separators. See nsIJumpListItem for information michael@0: * on adding additional jump list types. michael@0: */ michael@0: michael@0: /** michael@0: * List Types michael@0: */ michael@0: michael@0: /** michael@0: * Task List michael@0: * michael@0: * Tasks are common actions performed by users within the application. A task michael@0: * can be represented by an application shortcut and associated command line michael@0: * parameters or a URI. Task lists should generally be static lists that do not michael@0: * change often, if at all - similar to an application menu. michael@0: * michael@0: * Tasks are given the highest priority of all lists when space is limited. michael@0: */ michael@0: const short JUMPLIST_CATEGORY_TASKS = 0; michael@0: michael@0: /** michael@0: * Recent or Frequent list michael@0: * michael@0: * Recent and frequent lists are based on Window's recent document lists. The michael@0: * lists are generated automatically by Windows. Applications that use recent michael@0: * or frequent lists should keep document use tracking up to date by calling michael@0: * the SHAddToRecentDocs shell api. michael@0: */ michael@0: const short JUMPLIST_CATEGORY_RECENT = 1; michael@0: const short JUMPLIST_CATEGORY_FREQUENT = 2; michael@0: michael@0: /** michael@0: * Custom Lists michael@0: * michael@0: * Custom lists can be made up of tasks, links, and separators. The title of michael@0: * of the list is passed through the optional string parameter of addBuildList. michael@0: */ michael@0: const short JUMPLIST_CATEGORY_CUSTOMLIST = 3; michael@0: michael@0: /** michael@0: * Indicates whether jump list taskbar features are supported by the current michael@0: * host. michael@0: */ michael@0: readonly attribute short available; michael@0: michael@0: /** michael@0: * JumpList management michael@0: * michael@0: * @throw NS_ERROR_NOT_AVAILABLE on all calls if taskbar functionality michael@0: * is not supported by the operating system. michael@0: */ michael@0: michael@0: /** michael@0: * Indicates if a commit has already occurred in this session. michael@0: */ michael@0: readonly attribute boolean isListCommitted; michael@0: michael@0: /** michael@0: * The maximum number of jump list items the current desktop can support. michael@0: */ michael@0: readonly attribute short maxListItems; michael@0: michael@0: /** michael@0: * Initializes a jump list build and returns a list of items the user removed michael@0: * since the last time a jump list was committed. Removed items can become state michael@0: * after initListBuild is called, lists should be built in single-shot fasion. michael@0: * michael@0: * @param removedItems michael@0: * A list of items that were removed by the user since the last commit. michael@0: * michael@0: * @returns true if the operation completed successfully. michael@0: */ michael@0: boolean initListBuild(in nsIMutableArray removedItems); michael@0: michael@0: /** michael@0: * Adds a list and if required, a set of items for the list. michael@0: * michael@0: * @param aCatType michael@0: * The type of list to add. michael@0: * @param items michael@0: * An array of nsIJumpListItem items to add to the list. michael@0: * @param catName michael@0: * For custom lists, the title of the list. michael@0: * michael@0: * @returns true if the operation completed successfully. michael@0: * michael@0: * @throw NS_ERROR_INVALID_ARG if incorrect parameters are passed for michael@0: * a particular category or item type. michael@0: * @throw NS_ERROR_ILLEGAL_VALUE if an item is added that was removed michael@0: * since the last commit. michael@0: * @throw NS_ERROR_UNEXPECTED on internal errors. michael@0: */ michael@0: boolean addListToBuild(in short aCatType, [optional] in nsIArray items, [optional] in AString catName); michael@0: michael@0: /** michael@0: * Aborts and clears the current jump list build. michael@0: */ michael@0: void abortListBuild(); michael@0: michael@0: /** michael@0: * Commits the current jump list build to the Taskbar. michael@0: * michael@0: * @returns true if the operation completed successfully. michael@0: */ michael@0: boolean commitListBuild(); michael@0: michael@0: /** michael@0: * Deletes any currently applied taskbar jump list for this application. michael@0: * Common uses would be the enabling of a privacy mode and uninstallation. michael@0: * michael@0: * @returns true if the operation completed successfully. michael@0: * michael@0: * @throw NS_ERROR_UNEXPECTED on internal errors. michael@0: */ michael@0: boolean deleteActiveList(); michael@0: };