PageRenderTime 48ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIDOMStorage.h

http://firefox-mac-pdf.googlecode.com/
C Header | 171 lines | 81 code | 35 blank | 55 comment | 0 complexity | f165489a18cb0e260771ec574fbaa8e1 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/dom/public/idl/storage/nsIDOMStorage.idl
  3. */
  4. #ifndef __gen_nsIDOMStorage_h__
  5. #define __gen_nsIDOMStorage_h__
  6. #ifndef __gen_domstubs_h__
  7. #include "domstubs.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. class nsIDOMStorageItem; /* forward declaration */
  14. /* starting interface: nsIDOMStorage */
  15. #define NS_IDOMSTORAGE_IID_STR "95cc1383-3b62-4b89-aaef-1004a513ef47"
  16. #define NS_IDOMSTORAGE_IID \
  17. {0x95cc1383, 0x3b62, 0x4b89, \
  18. { 0xaa, 0xef, 0x10, 0x04, 0xa5, 0x13, 0xef, 0x47 }}
  19. class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMStorage : public nsISupports {
  20. public:
  21. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSTORAGE_IID)
  22. /**
  23. * The number of keys stored.
  24. */
  25. /* readonly attribute unsigned long length; */
  26. NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) = 0;
  27. /**
  28. * Retrieve the name of the key at a particular index.
  29. *
  30. * @param index index of the item to retrieve
  31. * @returns the key at index
  32. * @throws INDEX_SIZE_ERR if there is no key at that index
  33. */
  34. /* DOMString key (in unsigned long index); */
  35. NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) = 0;
  36. /**
  37. * Retrieve an item with a given key
  38. *
  39. * @param key key to retrieve
  40. * @returns found item or null if the key was not found
  41. */
  42. /* nsIDOMStorageItem getItem (in DOMString key); */
  43. NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) = 0;
  44. /**
  45. * Assign a value with a key. If the key does not exist already, a new
  46. * key is added associated with that value. If the key already exists,
  47. * then the existing value is replaced with a new value.
  48. *
  49. * @param key key to set
  50. * @param data data to associate with the key
  51. * @returns found item or null if the key was not found
  52. */
  53. /* void setItem (in DOMString key, in DOMString data); */
  54. NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) = 0;
  55. /**
  56. * Remove a key and its corresponding value.
  57. *
  58. * @param key key to remove
  59. */
  60. /* void removeItem (in DOMString key); */
  61. NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) = 0;
  62. };
  63. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMStorage, NS_IDOMSTORAGE_IID)
  64. /* Use this macro when declaring classes that implement this interface. */
  65. #define NS_DECL_NSIDOMSTORAGE \
  66. NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength); \
  67. NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval); \
  68. NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval); \
  69. NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data); \
  70. NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key);
  71. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  72. #define NS_FORWARD_NSIDOMSTORAGE(_to) \
  73. NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) { return _to GetLength(aLength); } \
  74. NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) { return _to Key(index, _retval); } \
  75. NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) { return _to GetItem(key, _retval); } \
  76. NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) { return _to SetItem(key, data); } \
  77. NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) { return _to RemoveItem(key); }
  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_NSIDOMSTORAGE(_to) \
  80. NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  81. NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Key(index, _retval); } \
  82. NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItem(key, _retval); } \
  83. NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetItem(key, data); } \
  84. NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveItem(key); }
  85. #if 0
  86. /* Use the code below as a template for the implementation class for this interface. */
  87. /* Header file */
  88. class nsDOMStorage : public nsIDOMStorage
  89. {
  90. public:
  91. NS_DECL_ISUPPORTS
  92. NS_DECL_NSIDOMSTORAGE
  93. nsDOMStorage();
  94. private:
  95. ~nsDOMStorage();
  96. protected:
  97. /* additional members */
  98. };
  99. /* Implementation file */
  100. NS_IMPL_ISUPPORTS1(nsDOMStorage, nsIDOMStorage)
  101. nsDOMStorage::nsDOMStorage()
  102. {
  103. /* member initializers and constructor code */
  104. }
  105. nsDOMStorage::~nsDOMStorage()
  106. {
  107. /* destructor code */
  108. }
  109. /* readonly attribute unsigned long length; */
  110. NS_IMETHODIMP nsDOMStorage::GetLength(PRUint32 *aLength)
  111. {
  112. return NS_ERROR_NOT_IMPLEMENTED;
  113. }
  114. /* DOMString key (in unsigned long index); */
  115. NS_IMETHODIMP nsDOMStorage::Key(PRUint32 index, nsAString & _retval)
  116. {
  117. return NS_ERROR_NOT_IMPLEMENTED;
  118. }
  119. /* nsIDOMStorageItem getItem (in DOMString key); */
  120. NS_IMETHODIMP nsDOMStorage::GetItem(const nsAString & key, nsIDOMStorageItem **_retval)
  121. {
  122. return NS_ERROR_NOT_IMPLEMENTED;
  123. }
  124. /* void setItem (in DOMString key, in DOMString data); */
  125. NS_IMETHODIMP nsDOMStorage::SetItem(const nsAString & key, const nsAString & data)
  126. {
  127. return NS_ERROR_NOT_IMPLEMENTED;
  128. }
  129. /* void removeItem (in DOMString key); */
  130. NS_IMETHODIMP nsDOMStorage::RemoveItem(const nsAString & key)
  131. {
  132. return NS_ERROR_NOT_IMPLEMENTED;
  133. }
  134. /* End of implementation class template. */
  135. #endif
  136. #endif /* __gen_nsIDOMStorage_h__ */