1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIJumpListBuilder.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,152 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIArray; 1.12 +interface nsIMutableArray; 1.13 + 1.14 +[scriptable, uuid(1FE6A9CD-2B18-4dd5-A176-C2B32FA4F683)] 1.15 +interface nsIJumpListBuilder : nsISupports 1.16 +{ 1.17 + /** 1.18 + * JumpLists 1.19 + * 1.20 + * Jump lists are built and then applied. Modifying an applied jump list is not 1.21 + * permitted. Callers should begin the creation of a new jump list using 1.22 + * initListBuild, add sub lists using addListToBuild, then commit the jump list 1.23 + * using commitListBuild. Lists are built in real-time during the sequence of 1.24 + * build calls, make sure to check for errors on each individual step. 1.25 + * 1.26 + * The default number of allowed items in a jump list is ten. Users can change 1.27 + * the number through system preferences. User may also pin items to jump lists, 1.28 + * which take up additional slots. Applications do not have control over the 1.29 + * number of items allowed in jump lists; excess items added are dropped by the 1.30 + * system. Item insertion priority is defined as first to last added. 1.31 + * 1.32 + * Users may remove items from jump lists after they are commited. The system 1.33 + * tracks removed items between commits. A list of these items is returned by 1.34 + * a call to initListBuild. nsIJumpListBuilder does not filter entries added that 1.35 + * have been removed since the last commit. To prevent repeatedly adding entries 1.36 + * users have removed, applications are encoraged to track removed items 1.37 + * internally. 1.38 + * 1.39 + * Each list is made up of an array of nsIJumpListItem representing items 1.40 + * such as shortcuts, links, and separators. See nsIJumpListItem for information 1.41 + * on adding additional jump list types. 1.42 + */ 1.43 + 1.44 + /** 1.45 + * List Types 1.46 + */ 1.47 + 1.48 + /** 1.49 + * Task List 1.50 + * 1.51 + * Tasks are common actions performed by users within the application. A task 1.52 + * can be represented by an application shortcut and associated command line 1.53 + * parameters or a URI. Task lists should generally be static lists that do not 1.54 + * change often, if at all - similar to an application menu. 1.55 + * 1.56 + * Tasks are given the highest priority of all lists when space is limited. 1.57 + */ 1.58 + const short JUMPLIST_CATEGORY_TASKS = 0; 1.59 + 1.60 + /** 1.61 + * Recent or Frequent list 1.62 + * 1.63 + * Recent and frequent lists are based on Window's recent document lists. The 1.64 + * lists are generated automatically by Windows. Applications that use recent 1.65 + * or frequent lists should keep document use tracking up to date by calling 1.66 + * the SHAddToRecentDocs shell api. 1.67 + */ 1.68 + const short JUMPLIST_CATEGORY_RECENT = 1; 1.69 + const short JUMPLIST_CATEGORY_FREQUENT = 2; 1.70 + 1.71 + /** 1.72 + * Custom Lists 1.73 + * 1.74 + * Custom lists can be made up of tasks, links, and separators. The title of 1.75 + * of the list is passed through the optional string parameter of addBuildList. 1.76 + */ 1.77 + const short JUMPLIST_CATEGORY_CUSTOMLIST = 3; 1.78 + 1.79 + /** 1.80 + * Indicates whether jump list taskbar features are supported by the current 1.81 + * host. 1.82 + */ 1.83 + readonly attribute short available; 1.84 + 1.85 + /** 1.86 + * JumpList management 1.87 + * 1.88 + * @throw NS_ERROR_NOT_AVAILABLE on all calls if taskbar functionality 1.89 + * is not supported by the operating system. 1.90 + */ 1.91 + 1.92 + /** 1.93 + * Indicates if a commit has already occurred in this session. 1.94 + */ 1.95 + readonly attribute boolean isListCommitted; 1.96 + 1.97 + /** 1.98 + * The maximum number of jump list items the current desktop can support. 1.99 + */ 1.100 + readonly attribute short maxListItems; 1.101 + 1.102 + /** 1.103 + * Initializes a jump list build and returns a list of items the user removed 1.104 + * since the last time a jump list was committed. Removed items can become state 1.105 + * after initListBuild is called, lists should be built in single-shot fasion. 1.106 + * 1.107 + * @param removedItems 1.108 + * A list of items that were removed by the user since the last commit. 1.109 + * 1.110 + * @returns true if the operation completed successfully. 1.111 + */ 1.112 + boolean initListBuild(in nsIMutableArray removedItems); 1.113 + 1.114 + /** 1.115 + * Adds a list and if required, a set of items for the list. 1.116 + * 1.117 + * @param aCatType 1.118 + * The type of list to add. 1.119 + * @param items 1.120 + * An array of nsIJumpListItem items to add to the list. 1.121 + * @param catName 1.122 + * For custom lists, the title of the list. 1.123 + * 1.124 + * @returns true if the operation completed successfully. 1.125 + * 1.126 + * @throw NS_ERROR_INVALID_ARG if incorrect parameters are passed for 1.127 + * a particular category or item type. 1.128 + * @throw NS_ERROR_ILLEGAL_VALUE if an item is added that was removed 1.129 + * since the last commit. 1.130 + * @throw NS_ERROR_UNEXPECTED on internal errors. 1.131 + */ 1.132 + boolean addListToBuild(in short aCatType, [optional] in nsIArray items, [optional] in AString catName); 1.133 + 1.134 + /** 1.135 + * Aborts and clears the current jump list build. 1.136 + */ 1.137 + void abortListBuild(); 1.138 + 1.139 + /** 1.140 + * Commits the current jump list build to the Taskbar. 1.141 + * 1.142 + * @returns true if the operation completed successfully. 1.143 + */ 1.144 + boolean commitListBuild(); 1.145 + 1.146 + /** 1.147 + * Deletes any currently applied taskbar jump list for this application. 1.148 + * Common uses would be the enabling of a privacy mode and uninstallation. 1.149 + * 1.150 + * @returns true if the operation completed successfully. 1.151 + * 1.152 + * @throw NS_ERROR_UNEXPECTED on internal errors. 1.153 + */ 1.154 + boolean deleteActiveList(); 1.155 +};