nsIPrefLocalizedString.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/modules/libpref/public/nsIPrefLocalizedString.idl
  3. */
  4. #ifndef __gen_nsIPrefLocalizedString_h__
  5. #define __gen_nsIPrefLocalizedString_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /* starting interface: nsIPrefLocalizedString */
  14. #define NS_IPREFLOCALIZEDSTRING_IID_STR "ae419e24-1dd1-11b2-b39a-d3e5e7073802"
  15. #define NS_IPREFLOCALIZEDSTRING_IID \
  16. {0xae419e24, 0x1dd1, 0x11b2, \
  17. { 0xb3, 0x9a, 0xd3, 0xe5, 0xe7, 0x07, 0x38, 0x02 }}
  18. /**
  19. * The nsIPrefLocalizedString interface is simply a wrapper interface for
  20. * nsISupportsString so the preferences service can have a unique identifier
  21. * to distinguish between requests for normal wide strings (nsISupportsString)
  22. * and "localized" wide strings, which get their default values from properites
  23. * files.
  24. *
  25. * @see nsIPrefBranch
  26. * @see nsISupportsString
  27. *
  28. * @status FROZEN
  29. */
  30. class NS_NO_VTABLE nsIPrefLocalizedString : public nsISupports {
  31. public:
  32. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPREFLOCALIZEDSTRING_IID)
  33. /**
  34. * Provides access to string data stored in this property.
  35. *
  36. * @return NS_OK The operation succeeded.
  37. * @return Other An error occured.
  38. */
  39. /* attribute wstring data; */
  40. NS_IMETHOD GetData(PRUnichar * *aData) = 0;
  41. NS_IMETHOD SetData(const PRUnichar * aData) = 0;
  42. /**
  43. * Used to retrieve the contents of this object into a wide string.
  44. *
  45. * @return wstring The string containing the data stored within this object.
  46. */
  47. /* wstring toString (); */
  48. NS_IMETHOD ToString(PRUnichar **_retval) = 0;
  49. /**
  50. * Used to set the contents of this object.
  51. *
  52. * @param length The length of the string. This value should not include
  53. * space for the null terminator, nor should it account for the
  54. * size of a character. It should only be the number of
  55. * characters for which there is space in the string.
  56. * @param data The string data to be stored.
  57. *
  58. * @note
  59. * This makes a copy of the string argument passed in.
  60. *
  61. * @return NS_OK The data was successfully stored.
  62. */
  63. /* void setDataWithLength (in unsigned long length, [size_is (length)] in wstring data); */
  64. NS_IMETHOD SetDataWithLength(PRUint32 length, const PRUnichar *data) = 0;
  65. };
  66. /* Use this macro when declaring classes that implement this interface. */
  67. #define NS_DECL_NSIPREFLOCALIZEDSTRING \
  68. NS_IMETHOD GetData(PRUnichar * *aData); \
  69. NS_IMETHOD SetData(const PRUnichar * aData); \
  70. NS_IMETHOD ToString(PRUnichar **_retval); \
  71. NS_IMETHOD SetDataWithLength(PRUint32 length, const PRUnichar *data);
  72. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  73. #define NS_FORWARD_NSIPREFLOCALIZEDSTRING(_to) \
  74. NS_IMETHOD GetData(PRUnichar * *aData) { return _to GetData(aData); } \
  75. NS_IMETHOD SetData(const PRUnichar * aData) { return _to SetData(aData); } \
  76. NS_IMETHOD ToString(PRUnichar **_retval) { return _to ToString(_retval); } \
  77. NS_IMETHOD SetDataWithLength(PRUint32 length, const PRUnichar *data) { return _to SetDataWithLength(length, data); }
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  79. #define NS_FORWARD_SAFE_NSIPREFLOCALIZEDSTRING(_to) \
  80. NS_IMETHOD GetData(PRUnichar * *aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetData(aData); } \
  81. NS_IMETHOD SetData(const PRUnichar * aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetData(aData); } \
  82. NS_IMETHOD ToString(PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); } \
  83. NS_IMETHOD SetDataWithLength(PRUint32 length, const PRUnichar *data) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDataWithLength(length, data); }
  84. #if 0
  85. /* Use the code below as a template for the implementation class for this interface. */
  86. /* Header file */
  87. class nsPrefLocalizedString : public nsIPrefLocalizedString
  88. {
  89. public:
  90. NS_DECL_ISUPPORTS
  91. NS_DECL_NSIPREFLOCALIZEDSTRING
  92. nsPrefLocalizedString();
  93. private:
  94. ~nsPrefLocalizedString();
  95. protected:
  96. /* additional members */
  97. };
  98. /* Implementation file */
  99. NS_IMPL_ISUPPORTS1(nsPrefLocalizedString, nsIPrefLocalizedString)
  100. nsPrefLocalizedString::nsPrefLocalizedString()
  101. {
  102. /* member initializers and constructor code */
  103. }
  104. nsPrefLocalizedString::~nsPrefLocalizedString()
  105. {
  106. /* destructor code */
  107. }
  108. /* attribute wstring data; */
  109. NS_IMETHODIMP nsPrefLocalizedString::GetData(PRUnichar * *aData)
  110. {
  111. return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113. NS_IMETHODIMP nsPrefLocalizedString::SetData(const PRUnichar * aData)
  114. {
  115. return NS_ERROR_NOT_IMPLEMENTED;
  116. }
  117. /* wstring toString (); */
  118. NS_IMETHODIMP nsPrefLocalizedString::ToString(PRUnichar **_retval)
  119. {
  120. return NS_ERROR_NOT_IMPLEMENTED;
  121. }
  122. /* void setDataWithLength (in unsigned long length, [size_is (length)] in wstring data); */
  123. NS_IMETHODIMP nsPrefLocalizedString::SetDataWithLength(PRUint32 length, const PRUnichar *data)
  124. {
  125. return NS_ERROR_NOT_IMPLEMENTED;
  126. }
  127. /* End of implementation class template. */
  128. #endif
  129. #define NS_PREFLOCALIZEDSTRING_CID \
  130. { /* {064d9cee-1dd2-11b2-83e3-d25ab0193c26} */ \
  131. 0x064d9cee, \
  132. 0x1dd2, \
  133. 0x11b2, \
  134. { 0x83, 0xe3, 0xd2, 0x5a, 0xb0, 0x19, 0x3c, 0x26 } \
  135. }
  136. #define NS_PREFLOCALIZEDSTRING_CONTRACTID "@mozilla.org/pref-localizedstring;1"
  137. #define NS_PREFLOCALIZEDSTRING_CLASSNAME "Pref LocalizedString"
  138. #endif /* __gen_nsIPrefLocalizedString_h__ */