nsIconURI.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #ifndef mozilla_image_decoders_icon_nsIconURI_h
  7. #define mozilla_image_decoders_icon_nsIconURI_h
  8. #include "nsIIconURI.h"
  9. #include "nsCOMPtr.h"
  10. #include "nsString.h"
  11. #include "nsIIPCSerializableURI.h"
  12. #include "nsINestedURI.h"
  13. class nsMozIconURI : public nsIMozIconURI
  14. , public nsIIPCSerializableURI
  15. {
  16. public:
  17. NS_DECL_THREADSAFE_ISUPPORTS
  18. NS_DECL_NSIURI
  19. NS_DECL_NSIMOZICONURI
  20. NS_DECL_NSIIPCSERIALIZABLEURI
  21. // nsMozIconURI
  22. nsMozIconURI();
  23. protected:
  24. virtual ~nsMozIconURI();
  25. nsCOMPtr<nsIURL> mIconURL; // a URL that we want the icon for
  26. uint32_t mSize; // the # of pixels in a row that we want for this image.
  27. // Typically 16, 32, 128, etc.
  28. nsCString mContentType; // optional field explicitly specifying the content
  29. // type
  30. nsCString mFileName; // for if we don't have an actual file path, we're just
  31. // given a filename with an extension
  32. nsCString mStockIcon;
  33. int32_t mIconSize; // -1 if not specified, otherwise index into
  34. // kSizeStrings
  35. int32_t mIconState; // -1 if not specified, otherwise index into
  36. // kStateStrings
  37. };
  38. // For moz-icon URIs that point to an actual file on disk and are
  39. // therefore nested URIs
  40. class nsNestedMozIconURI final : public nsMozIconURI
  41. , public nsINestedURI
  42. {
  43. NS_DECL_ISUPPORTS_INHERITED
  44. NS_FORWARD_NSIURI(nsMozIconURI::)
  45. NS_FORWARD_NSIMOZICONURI(nsMozIconURI::)
  46. NS_FORWARD_NSIIPCSERIALIZABLEURI(nsMozIconURI::)
  47. NS_DECL_NSINESTEDURI
  48. nsNestedMozIconURI();
  49. protected:
  50. virtual ~nsNestedMozIconURI();
  51. };
  52. #endif // mozilla_image_decoders_icon_nsIconURI_h