PageRenderTime 40ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIProperties.h

http://firefox-mac-pdf.googlecode.com/
C Header | 160 lines | 80 code | 34 blank | 46 comment | 0 complexity | fa3150cfe19ebf5835d7490b71a5bedb MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/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 NS_SCRIPTABLE nsIProperties : public nsISupports {
  19. public:
  20. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) = 0;
  52. };
  53. NS_DEFINE_STATIC_IID_ACCESSOR(nsIProperties, NS_IPROPERTIES_IID)
  54. /* Use this macro when declaring classes that implement this interface. */
  55. #define NS_DECL_NSIPROPERTIES \
  56. NS_SCRIPTABLE NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result); \
  57. NS_SCRIPTABLE NS_IMETHOD Set(const char *prop, nsISupports *value); \
  58. NS_SCRIPTABLE NS_IMETHOD Has(const char *prop, PRBool *_retval); \
  59. NS_SCRIPTABLE NS_IMETHOD Undefine(const char *prop); \
  60. NS_SCRIPTABLE NS_IMETHOD GetKeys(PRUint32 *count, char ***keys);
  61. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  62. #define NS_FORWARD_NSIPROPERTIES(_to) \
  63. NS_SCRIPTABLE NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result) { return _to Get(prop, iid, result); } \
  64. NS_SCRIPTABLE NS_IMETHOD Set(const char *prop, nsISupports *value) { return _to Set(prop, value); } \
  65. NS_SCRIPTABLE NS_IMETHOD Has(const char *prop, PRBool *_retval) { return _to Has(prop, _retval); } \
  66. NS_SCRIPTABLE NS_IMETHOD Undefine(const char *prop) { return _to Undefine(prop); } \
  67. NS_SCRIPTABLE NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return _to GetKeys(count, keys); }
  68. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  69. #define NS_FORWARD_SAFE_NSIPROPERTIES(_to) \
  70. NS_SCRIPTABLE NS_IMETHOD Get(const char *prop, const nsIID & iid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->Get(prop, iid, result); } \
  71. NS_SCRIPTABLE NS_IMETHOD Set(const char *prop, nsISupports *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->Set(prop, value); } \
  72. NS_SCRIPTABLE NS_IMETHOD Has(const char *prop, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Has(prop, _retval); } \
  73. NS_SCRIPTABLE NS_IMETHOD Undefine(const char *prop) { return !_to ? NS_ERROR_NULL_POINTER : _to->Undefine(prop); } \
  74. NS_SCRIPTABLE NS_IMETHOD GetKeys(PRUint32 *count, char ***keys) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeys(count, keys); }
  75. #if 0
  76. /* Use the code below as a template for the implementation class for this interface. */
  77. /* Header file */
  78. class nsProperties : public nsIProperties
  79. {
  80. public:
  81. NS_DECL_ISUPPORTS
  82. NS_DECL_NSIPROPERTIES
  83. nsProperties();
  84. private:
  85. ~nsProperties();
  86. protected:
  87. /* additional members */
  88. };
  89. /* Implementation file */
  90. NS_IMPL_ISUPPORTS1(nsProperties, nsIProperties)
  91. nsProperties::nsProperties()
  92. {
  93. /* member initializers and constructor code */
  94. }
  95. nsProperties::~nsProperties()
  96. {
  97. /* destructor code */
  98. }
  99. /* void get (in string prop, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  100. NS_IMETHODIMP nsProperties::Get(const char *prop, const nsIID & iid, void * *result)
  101. {
  102. return NS_ERROR_NOT_IMPLEMENTED;
  103. }
  104. /* void set (in string prop, in nsISupports value); */
  105. NS_IMETHODIMP nsProperties::Set(const char *prop, nsISupports *value)
  106. {
  107. return NS_ERROR_NOT_IMPLEMENTED;
  108. }
  109. /* boolean has (in string prop); */
  110. NS_IMETHODIMP nsProperties::Has(const char *prop, PRBool *_retval)
  111. {
  112. return NS_ERROR_NOT_IMPLEMENTED;
  113. }
  114. /* void undefine (in string prop); */
  115. NS_IMETHODIMP nsProperties::Undefine(const char *prop)
  116. {
  117. return NS_ERROR_NOT_IMPLEMENTED;
  118. }
  119. /* void getKeys (out PRUint32 count, [array, size_is (count), retval] out string keys); */
  120. NS_IMETHODIMP nsProperties::GetKeys(PRUint32 *count, char ***keys)
  121. {
  122. return NS_ERROR_NOT_IMPLEMENTED;
  123. }
  124. /* End of implementation class template. */
  125. #endif
  126. #endif /* __gen_nsIProperties_h__ */