widget/nsIJumpListItem.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIJumpListItem.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,137 @@
     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 nsIURI;
    1.12 +interface nsILocalHandlerApp;
    1.13 +interface nsIMutableArray;
    1.14 +
    1.15 +/**
    1.16 + * Implements Win7 Taskbar jump list item interfaces.
    1.17 + *
    1.18 + * Note to consumers: it's reasonable to expect we'll need support for other types
    1.19 + * of jump list items (an audio file, an email message, etc.). To add types,
    1.20 + * create the specific interface here, add an implementation class to WinJumpListItem,
    1.21 + * and add support to addListBuild & removed items processing.
    1.22 + * 
    1.23 + */
    1.24 +
    1.25 +[scriptable, uuid(ACB8FB3C-E1B0-4044-8A50-E52C3E7C1057)]
    1.26 +interface nsIJumpListItem : nsISupports
    1.27 +{
    1.28 +  const short JUMPLIST_ITEM_EMPTY      = 0; // Empty list item
    1.29 +  const short JUMPLIST_ITEM_SEPARATOR  = 1; // Separator
    1.30 +  const short JUMPLIST_ITEM_LINK       = 2; // Web link item
    1.31 +  const short JUMPLIST_ITEM_SHORTCUT   = 3; // Application shortcut
    1.32 +
    1.33 +  /**
    1.34 +   * Retrieves the jump list item type.
    1.35 +   */
    1.36 +  readonly attribute short type;
    1.37 +
    1.38 +  /**
    1.39 +   * Compare this item to another.
    1.40 +   *
    1.41 +   * Compares the type and other properties specific to this item's
    1.42 +   * type.
    1.43 +   *
    1.44 +   * separator: type
    1.45 +   * link: type, uri, title
    1.46 +   * shortcut: type, handler app
    1.47 +   */
    1.48 +  boolean equals(in nsIJumpListItem item);
    1.49 +};
    1.50 +
    1.51 +/**
    1.52 + * A menu separator.
    1.53 + */
    1.54 +
    1.55 +[scriptable, uuid(69A2D5C5-14DC-47da-925D-869E0BD64D27)]
    1.56 +interface nsIJumpListSeparator : nsIJumpListItem
    1.57 +{
    1.58 +  /* nothing needed here */
    1.59 +};
    1.60 +
    1.61 +/**
    1.62 + * A URI link jump list item.
    1.63 + *
    1.64 + * Note the application must be the registered protocol
    1.65 + * handler for the protocol of the link.
    1.66 + */
    1.67 +
    1.68 +[scriptable, uuid(76EA47B1-C797-49b3-9F18-5E740A688524)]
    1.69 +interface nsIJumpListLink : nsIJumpListItem
    1.70 +{
    1.71 +  /**
    1.72 +   * Set or get the uri for this link item.
    1.73 +   */
    1.74 +  attribute nsIURI uri;
    1.75 +
    1.76 +  /**
    1.77 +   * Set or get the title for a link item.  
    1.78 +   */
    1.79 +  attribute AString uriTitle;
    1.80 +
    1.81 +  /**
    1.82 +   * Get a 'privacy safe' unique string hash of the uri's
    1.83 +   * spec. Useful in tracking removed items using visible
    1.84 +   * data stores such as prefs. Generates an MD5 hash of
    1.85 +   * the URI spec using nsICryptoHash.
    1.86 +   */
    1.87 +  readonly attribute ACString uriHash;
    1.88 +
    1.89 +  /**
    1.90 +   * Compare this item's hash to another uri.
    1.91 +   *
    1.92 +   * Generates a spec hash of the incoming uri and compares
    1.93 +   * it to this item's uri spec hash.
    1.94 +   */
    1.95 +  boolean compareHash(in nsIURI uri);
    1.96 +};
    1.97 +
    1.98 +/**
    1.99 + * A generic application shortcut with command line support.
   1.100 + */
   1.101 +
   1.102 +[scriptable, uuid(CBE3A37C-BCE1-4fec-80A5-5FFBC7F33EEA)]
   1.103 +interface nsIJumpListShortcut : nsIJumpListItem
   1.104 +{
   1.105 +  /**
   1.106 +   * Set or get the handler app for this shortcut item.
   1.107 +   *
   1.108 +   * The handler app may also be used along with iconIndex to generate an icon
   1.109 +   * for the jump list item.
   1.110 +   * 
   1.111 +   * @throw NS_ERROR_FILE_NOT_FOUND if the handler app can
   1.112 +   * not be found on  the system.
   1.113 +   *
   1.114 +   * @see faviconPageUri
   1.115 +   */
   1.116 +  attribute nsILocalHandlerApp app;
   1.117 +
   1.118 +  /**
   1.119 +   * Set or get the icon displayed with the jump list item.
   1.120 +   *
   1.121 +   * Indicates the resource index of the icon contained within the handler
   1.122 +   * executable which may be used as the jump list icon.
   1.123 +   *
   1.124 +   * @see faviconPageUri
   1.125 +   */
   1.126 +  attribute long iconIndex;
   1.127 +
   1.128 +  /**
   1.129 +   * Set or get the URI of a page whose favicon may be used as the icon.
   1.130 +   *
   1.131 +   * When a jump list build occurs, the favicon to be used for the item is
   1.132 +   * obtained using the following steps:
   1.133 +   * - First, attempt to use the asynchronously retrieved and scaled favicon
   1.134 +   * associated with the faviconPageUri.
   1.135 +   * - If faviconPageUri is null, or if retrieving the favicon fails, fall
   1.136 +   * back to using the handler executable and iconIndex.  
   1.137 +   */
   1.138 +  attribute nsIURI faviconPageUri;
   1.139 +};
   1.140 +

mercurial