nsIProperties.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/ds/nsIProperties.idl
  3. */
  4. #ifndef __gen_nsIProperties_h__
  5. #define __gen_nsIProperties_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: nsIProperties */
  14. #define NS_IPROPERTIES_IID_STR "78650582-4e93-4b60-8e85-26ebd3eb14ca"
  15. #define NS_IPROPERTIES_IID \
  16. {0x78650582, 0x4e93, 0x4b60, \
  17. { 0x8e, 0x85, 0x26, 0xeb, 0xd3, 0xeb, 0x14, 0xca }}
  18. class NS_NO_VTABLE nsIProperties : public nsISupports {
  19. public:
  20. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPROPERTIES_IID)
  21. /**
  22. * Gets a property with a given name.
  23. *
  24. * @return NS_ERROR_FAILURE if a property with that name doesn't exist.
  25. * @return NS_ERROR_NO_INTERFACE if the found property fails to QI to the
  26. * given iid.
  27. */
  28. /* void get (in string prop, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  29. NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result) = 0;
  30. /**
  31. * Sets a property with a given name to a given value.
  32. */
  33. /* void set (in string prop, in nsISupports value); */
  34. NS_IMETHOD Set(const char *prop, nsISupports *value) = 0;
  35. /**
  36. * Returns true if the property with the given name exists.
  37. */
  38. /* boolean has (in string prop); */
  39. NS_IMETHOD Has(const char *prop, PRBool *_retval) = 0;
  40. /**
  41. * Undefines a property.
  42. * @return NS_ERROR_FAILURE if a property with that name doesn't
  43. * already exist.
  44. */
  45. /* void undefine (in string prop); */
  46. NS_IMETHOD Undefine(const char *prop) = 0;
  47. /**
  48. * Returns an array of the keys.
  49. */
  50. /* void getKeys (out PRUint32 count, [array, size_is (count), retval] out string keys); */
  51. NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) = 0;
  52. };
  53. /* Use this macro when declaring classes that implement this interface. */
  54. #define NS_DECL_NSIPROPERTIES \
  55. NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result); \
  56. NS_IMETHOD Set(const char *prop, nsISupports *value); \
  57. NS_IMETHOD Has(const char *prop, PRBool *_retval); \
  58. NS_IMETHOD Undefine(const char *prop); \
  59. NS_IMETHOD GetKeys(PRUint32 *count, char ***keys);
  60. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  61. #define NS_FORWARD_NSIPROPERTIES(_to) \
  62. NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result) { return _to Get(prop, iid, result); } \
  63. NS_IMETHOD Set(const char *prop, nsISupports *value) { return _to Set(prop, value); } \
  64. NS_IMETHOD Has(const char *prop, PRBool *_retval) { return _to Has(prop, _retval); } \
  65. NS_IMETHOD Undefine(const char *prop) { return _to Undefine(prop); } \
  66. NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return _to GetKeys(count, keys); }
  67. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  68. #define NS_FORWARD_SAFE_NSIPROPERTIES(_to) \
  69. NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->Get(prop, iid, result); } \
  70. NS_IMETHOD Set(const char *prop, nsISupports *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->Set(prop, value); } \
  71. NS_IMETHOD Has(const char *prop, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Has(prop, _retval); } \
  72. NS_IMETHOD Undefine(const char *prop) { return !_to ? NS_ERROR_NULL_POINTER : _to->Undefine(prop); } \
  73. NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeys(count, keys); }
  74. #if 0
  75. /* Use the code below as a template for the implementation class for this interface. */
  76. /* Header file */
  77. class nsProperties : public nsIProperties
  78. {
  79. public:
  80. NS_DECL_ISUPPORTS
  81. NS_DECL_NSIPROPERTIES
  82. nsProperties();
  83. private:
  84. ~nsProperties();
  85. protected:
  86. /* additional members */
  87. };
  88. /* Implementation file */
  89. NS_IMPL_ISUPPORTS1(nsProperties, nsIProperties)
  90. nsProperties::nsProperties()
  91. {
  92. /* member initializers and constructor code */
  93. }
  94. nsProperties::~nsProperties()
  95. {
  96. /* destructor code */
  97. }
  98. /* void get (in string prop, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  99. NS_IMETHODIMP nsProperties::Get(const char *prop, const nsIID & iid, void * *result)
  100. {
  101. return NS_ERROR_NOT_IMPLEMENTED;
  102. }
  103. /* void set (in string prop, in nsISupports value); */
  104. NS_IMETHODIMP nsProperties::Set(const char *prop, nsISupports *value)
  105. {
  106. return NS_ERROR_NOT_IMPLEMENTED;
  107. }
  108. /* boolean has (in string prop); */
  109. NS_IMETHODIMP nsProperties::Has(const char *prop, PRBool *_retval)
  110. {
  111. return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113. /* void undefine (in string prop); */
  114. NS_IMETHODIMP nsProperties::Undefine(const char *prop)
  115. {
  116. return NS_ERROR_NOT_IMPLEMENTED;
  117. }
  118. /* void getKeys (out PRUint32 count, [array, size_is (count), retval] out string keys); */
  119. NS_IMETHODIMP nsProperties::GetKeys(PRUint32 *count, char ***keys)
  120. {
  121. return NS_ERROR_NOT_IMPLEMENTED;
  122. }
  123. /* End of implementation class template. */
  124. #endif
  125. #endif /* __gen_nsIProperties_h__ */