PageRenderTime 163ms CodeModel.GetById 141ms app.highlight 4ms RepoModel.GetById 16ms 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
  5#ifndef __gen_nsIDOMStorage_h__
  6#define __gen_nsIDOMStorage_h__
  7
  8
  9#ifndef __gen_domstubs_h__
 10#include "domstubs.h"
 11#endif
 12
 13/* For IDL files that don't want to include root IDL files. */
 14#ifndef NS_NO_VTABLE
 15#define NS_NO_VTABLE
 16#endif
 17class nsIDOMStorageItem; /* forward declaration */
 18
 19
 20/* starting interface:    nsIDOMStorage */
 21#define NS_IDOMSTORAGE_IID_STR "95cc1383-3b62-4b89-aaef-1004a513ef47"
 22
 23#define NS_IDOMSTORAGE_IID \
 24  {0x95cc1383, 0x3b62, 0x4b89, \
 25    { 0xaa, 0xef, 0x10, 0x04, 0xa5, 0x13, 0xef, 0x47 }}
 26
 27class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMStorage : public nsISupports {
 28 public: 
 29
 30  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSTORAGE_IID)
 31
 32  /**
 33   * The number of keys stored.
 34   */
 35  /* readonly attribute unsigned long length; */
 36  NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) = 0;
 37
 38  /**
 39   * Retrieve the name of the key at a particular index.
 40   *
 41   * @param index index of the item to retrieve
 42   * @returns the key at index
 43   * @throws INDEX_SIZE_ERR if there is no key at that index
 44   */
 45  /* DOMString key (in unsigned long index); */
 46  NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) = 0;
 47
 48  /**
 49   * Retrieve an item with a given key
 50   *
 51   * @param key key to retrieve
 52   * @returns found item or null if the key was not found
 53   */
 54  /* nsIDOMStorageItem getItem (in DOMString key); */
 55  NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) = 0;
 56
 57  /**
 58   * Assign a value with a key. If the key does not exist already, a new
 59   * key is added associated with that value. If the key already exists,
 60   * then the existing value is replaced with a new value.
 61   *
 62   * @param key key to set
 63   * @param data data to associate with the key
 64   * @returns found item or null if the key was not found
 65   */
 66  /* void setItem (in DOMString key, in DOMString data); */
 67  NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) = 0;
 68
 69  /**
 70   * Remove a key and its corresponding value.
 71   *
 72   * @param key key to remove
 73   */
 74  /* void removeItem (in DOMString key); */
 75  NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) = 0;
 76
 77};
 78
 79  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMStorage, NS_IDOMSTORAGE_IID)
 80
 81/* Use this macro when declaring classes that implement this interface. */
 82#define NS_DECL_NSIDOMSTORAGE \
 83  NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength); \
 84  NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval); \
 85  NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval); \
 86  NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data); \
 87  NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key); 
 88
 89/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 90#define NS_FORWARD_NSIDOMSTORAGE(_to) \
 91  NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) { return _to GetLength(aLength); } \
 92  NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) { return _to Key(index, _retval); } \
 93  NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) { return _to GetItem(key, _retval); } \
 94  NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) { return _to SetItem(key, data); } \
 95  NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) { return _to RemoveItem(key); } 
 96
 97/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 98#define NS_FORWARD_SAFE_NSIDOMSTORAGE(_to) \
 99  NS_SCRIPTABLE NS_IMETHOD GetLength(PRUint32 *aLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
100  NS_SCRIPTABLE NS_IMETHOD Key(PRUint32 index, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Key(index, _retval); } \
101  NS_SCRIPTABLE NS_IMETHOD GetItem(const nsAString & key, nsIDOMStorageItem **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItem(key, _retval); } \
102  NS_SCRIPTABLE NS_IMETHOD SetItem(const nsAString & key, const nsAString & data) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetItem(key, data); } \
103  NS_SCRIPTABLE NS_IMETHOD RemoveItem(const nsAString & key) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveItem(key); } 
104
105#if 0
106/* Use the code below as a template for the implementation class for this interface. */
107
108/* Header file */
109class nsDOMStorage : public nsIDOMStorage
110{
111public:
112  NS_DECL_ISUPPORTS
113  NS_DECL_NSIDOMSTORAGE
114
115  nsDOMStorage();
116
117private:
118  ~nsDOMStorage();
119
120protected:
121  /* additional members */
122};
123
124/* Implementation file */
125NS_IMPL_ISUPPORTS1(nsDOMStorage, nsIDOMStorage)
126
127nsDOMStorage::nsDOMStorage()
128{
129  /* member initializers and constructor code */
130}
131
132nsDOMStorage::~nsDOMStorage()
133{
134  /* destructor code */
135}
136
137/* readonly attribute unsigned long length; */
138NS_IMETHODIMP nsDOMStorage::GetLength(PRUint32 *aLength)
139{
140    return NS_ERROR_NOT_IMPLEMENTED;
141}
142
143/* DOMString key (in unsigned long index); */
144NS_IMETHODIMP nsDOMStorage::Key(PRUint32 index, nsAString & _retval)
145{
146    return NS_ERROR_NOT_IMPLEMENTED;
147}
148
149/* nsIDOMStorageItem getItem (in DOMString key); */
150NS_IMETHODIMP nsDOMStorage::GetItem(const nsAString & key, nsIDOMStorageItem **_retval)
151{
152    return NS_ERROR_NOT_IMPLEMENTED;
153}
154
155/* void setItem (in DOMString key, in DOMString data); */
156NS_IMETHODIMP nsDOMStorage::SetItem(const nsAString & key, const nsAString & data)
157{
158    return NS_ERROR_NOT_IMPLEMENTED;
159}
160
161/* void removeItem (in DOMString key); */
162NS_IMETHODIMP nsDOMStorage::RemoveItem(const nsAString & key)
163{
164    return NS_ERROR_NOT_IMPLEMENTED;
165}
166
167/* End of implementation class template. */
168#endif
169
170
171#endif /* __gen_nsIDOMStorage_h__ */