nsIIconURI.idl 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #include "nsIURL.idl"
  7. /**
  8. * nsIIconURI
  9. *
  10. * This interface derives from nsIURI, to provide additional information
  11. * about moz-icon URIs.
  12. *
  13. * What *is* a moz-icon URI you ask? Well, it has the following syntax:
  14. *
  15. * moz-icon:[<valid-url> | //<file-with-extension> | //stock/<stock-icon>]?
  16. * ['?'[<parameter-value-pairs>]]
  17. *
  18. * <valid-url> is a valid URL spec.
  19. *
  20. * <file-with-extension> is any filename with an extension, e.g. "dummy.html".
  21. * If the file you want an icon for isn't known to exist, you can use this
  22. * instead of a URL and just place a dummy file name with the extension or
  23. * content type you want.
  24. *
  25. * <stock-icon> is the name of a platform-dependant stock icon.
  26. *
  27. * Legal parameter value pairs are listed below:
  28. *
  29. * Parameter: size
  30. * Values: [<integer> | button | toolbar | toolbarsmall | menu |
  31. * dialog]
  32. * Description: If integer, this is the desired size in square pixels of
  33. * the icon
  34. * Else, use the OS default for the specified keyword context.
  35. *
  36. * Parameter: state
  37. * Values: [normal | disabled]
  38. * Description: The state of the icon.
  39. *
  40. * Parameter: contentType
  41. * Values: <mime-type>
  42. * Description: The mime type we want an icon for. This is ignored by
  43. * stock images.
  44. */
  45. [scriptable, uuid(f8fe5ef2-5f2b-43f3-857d-5b64d192c427)]
  46. interface nsIMozIconURI : nsIURI
  47. {
  48. /// iconFile: the file URL contained within this moz-icon url, or null.
  49. attribute nsIURL iconURL;
  50. /// imageSize: The image area in square pixels, defaults to 16 if unspecified.
  51. attribute unsigned long imageSize;
  52. /// stockIcon: The stock icon name requested from the OS.
  53. readonly attribute ACString stockIcon;
  54. /// iconSize: The stock icon size requested from the OS.
  55. readonly attribute ACString iconSize;
  56. /// iconState: The stock icon state requested from the OS.
  57. readonly attribute ACString iconState;
  58. /// contentType: A valid mime type, or the empty string.
  59. attribute ACString contentType;
  60. /// fileExtension: The file extension of the file which we are looking up.
  61. readonly attribute ACString fileExtension;
  62. };
  63. %{C++
  64. // CID for nsMozIconURI, if implemented on this platform.
  65. #define NS_MOZICONURI_CID \
  66. { \
  67. 0x43a88e0e, \
  68. 0x2d37, \
  69. 0x11d5, \
  70. { 0x99, 0x7, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } \
  71. }
  72. %}