nsIPrefLocalizedString.idl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. /**
  7. * The nsIPrefLocalizedString interface is simply a wrapper interface for
  8. * nsISupportsString so the preferences service can have a unique identifier
  9. * to distinguish between requests for normal wide strings (nsISupportsString)
  10. * and "localized" wide strings, which get their default values from properites
  11. * files.
  12. *
  13. * @see nsIPrefBranch
  14. * @see nsISupportsString
  15. */
  16. [scriptable, uuid(ae419e24-1dd1-11b2-b39a-d3e5e7073802)]
  17. interface nsIPrefLocalizedString : nsISupports
  18. {
  19. /**
  20. * Provides access to string data stored in this property.
  21. *
  22. * @throws Error An error occurred.
  23. */
  24. attribute wstring data;
  25. /**
  26. * Used to retrieve the contents of this object into a wide string.
  27. *
  28. * @return wstring The string containing the data stored within this object.
  29. */
  30. wstring toString();
  31. /**
  32. * Used to set the contents of this object.
  33. *
  34. * @param length The length of the string. This value should not include
  35. * space for the null terminator, nor should it account for the
  36. * size of a character. It should only be the number of
  37. * characters for which there is space in the string.
  38. * @param data The string data to be stored.
  39. *
  40. * @note
  41. * This makes a copy of the string argument passed in.
  42. */
  43. void setDataWithLength(in unsigned long length,
  44. [size_is(length)] in wstring data);
  45. };
  46. %{C++
  47. #define NS_PREFLOCALIZEDSTRING_CID \
  48. { /* {064d9cee-1dd2-11b2-83e3-d25ab0193c26} */ \
  49. 0x064d9cee, \
  50. 0x1dd2, \
  51. 0x11b2, \
  52. { 0x83, 0xe3, 0xd2, 0x5a, 0xb0, 0x19, 0x3c, 0x26 } \
  53. }
  54. #define NS_PREFLOCALIZEDSTRING_CONTRACTID "@mozilla.org/pref-localizedstring;1"
  55. %}