nsIIconURI.idl (2968B)
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsIURL.idl" 8 9 /** 10 * nsIIconURI 11 * 12 * This interface derives from nsIURI, to provide additional information 13 * about moz-icon URIs. 14 * 15 * What *is* a moz-icon URI you ask? Well, it has the following syntax: 16 * 17 * moz-icon:[<valid-url> | //<file-with-extension> | //stock/<stock-icon>]? 18 * ['?'[<parameter-value-pairs>]] 19 * 20 * <valid-url> is a valid URL spec. 21 * 22 * <file-with-extension> is any filename with an extension, e.g. "dummy.html". 23 * If the file you want an icon for isn't known to exist, you can use this 24 * instead of a URL and just place a dummy file name with the extension or 25 * content type you want. 26 * 27 * <stock-icon> is the name of a platform-dependant stock icon. 28 * 29 * Legal parameter value pairs are listed below: 30 * 31 * Parameter: size 32 * Values: [<integer> | button | toolbar | toolbarsmall | menu | 33 * dialog] 34 * Description: If integer, this is the desired size in square pixels of 35 * the icon 36 * Else, use the OS default for the specified keyword context. 37 * 38 * Parameter: state 39 * Values: [normal | disabled] 40 * Description: The state of the icon. 41 * 42 * Parameter: contentType 43 * Values: <mime-type> 44 * Description: The mime type we want an icon for. This is ignored by 45 * stock images. 46 */ 47 48 [scriptable, builtinclass, uuid(f8fe5ef2-5f2b-43f3-857d-5b64d192c427)] 49 interface nsIMozIconURI : nsIURI 50 { 51 /// iconFile: the file URL contained within this moz-icon url, or null. 52 readonly attribute nsIURL iconURL; 53 54 /// imageSize: The image area in square pixels, defaults to 16 if unspecified. 55 [infallible] readonly attribute unsigned long imageSize; 56 57 /// The scale of the icon. 58 [infallible] readonly attribute unsigned long imageScale; 59 60 /// imageDark: Returns whether dark or light mode was specified. Fails if not 61 /// specified at all. 62 readonly attribute boolean imageDark; 63 64 /// stockIcon: The stock icon name requested from the OS. 65 readonly attribute ACString stockIcon; 66 67 /// contentType: A valid mime type, or the empty string. 68 readonly attribute ACString contentType; 69 70 /// fileExtension: The file extension of the file which we are looking up. 71 readonly attribute ACString fileExtension; 72 }; 73 74 %{C++ 75 #define NS_MOZICONURIMUTATOR_CID \ 76 { \ 77 0x1460df3b, \ 78 0x774c, \ 79 0x4205, \ 80 {0x83, 0x49, 0x83, 0x8e, 0x50, 0x7c, 0x3e, 0xf9} \ 81 } 82 %}