PageRenderTime 31ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIDirectoryService.h

http://firefox-mac-pdf.googlecode.com/
C Header | 338 lines | 145 code | 73 blank | 120 comment | 0 complexity | 336fa3b6e87179ac72aaf09056250182 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/io/nsIDirectoryService.idl
  3. */
  4. #ifndef __gen_nsIDirectoryService_h__
  5. #define __gen_nsIDirectoryService_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. #ifndef __gen_nsIFile_h__
  10. #include "nsIFile.h"
  11. #endif
  12. /* For IDL files that don't want to include root IDL files. */
  13. #ifndef NS_NO_VTABLE
  14. #define NS_NO_VTABLE
  15. #endif
  16. /* starting interface: nsIDirectoryServiceProvider */
  17. #define NS_IDIRECTORYSERVICEPROVIDER_IID_STR "bbf8cab0-d43a-11d3-8cc2-00609792278c"
  18. #define NS_IDIRECTORYSERVICEPROVIDER_IID \
  19. {0xbbf8cab0, 0xd43a, 0x11d3, \
  20. { 0x8c, 0xc2, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c }}
  21. /**
  22. * nsIDirectoryServiceProvider
  23. *
  24. * Used by Directory Service to get file locations.
  25. *
  26. * @status FROZEN
  27. */
  28. class NS_NO_VTABLE NS_SCRIPTABLE nsIDirectoryServiceProvider : public nsISupports {
  29. public:
  30. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDIRECTORYSERVICEPROVIDER_IID)
  31. /**
  32. * getFile
  33. *
  34. * Directory Service calls this when it gets the first request for
  35. * a prop or on every request if the prop is not persistent.
  36. *
  37. * @param prop The symbolic name of the file.
  38. * @param persistent TRUE - The returned file will be cached by Directory
  39. * Service. Subsequent requests for this prop will
  40. * bypass the provider and use the cache.
  41. * FALSE - The provider will be asked for this prop
  42. * each time it is requested.
  43. *
  44. * @return The file represented by the property.
  45. *
  46. */
  47. /* nsIFile getFile (in string prop, out PRBool persistent); */
  48. NS_SCRIPTABLE NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) = 0;
  49. };
  50. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDirectoryServiceProvider, NS_IDIRECTORYSERVICEPROVIDER_IID)
  51. /* Use this macro when declaring classes that implement this interface. */
  52. #define NS_DECL_NSIDIRECTORYSERVICEPROVIDER \
  53. NS_SCRIPTABLE NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval);
  54. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  55. #define NS_FORWARD_NSIDIRECTORYSERVICEPROVIDER(_to) \
  56. NS_SCRIPTABLE NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) { return _to GetFile(prop, persistent, _retval); }
  57. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  58. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICEPROVIDER(_to) \
  59. NS_SCRIPTABLE NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(prop, persistent, _retval); }
  60. #if 0
  61. /* Use the code below as a template for the implementation class for this interface. */
  62. /* Header file */
  63. class nsDirectoryServiceProvider : public nsIDirectoryServiceProvider
  64. {
  65. public:
  66. NS_DECL_ISUPPORTS
  67. NS_DECL_NSIDIRECTORYSERVICEPROVIDER
  68. nsDirectoryServiceProvider();
  69. private:
  70. ~nsDirectoryServiceProvider();
  71. protected:
  72. /* additional members */
  73. };
  74. /* Implementation file */
  75. NS_IMPL_ISUPPORTS1(nsDirectoryServiceProvider, nsIDirectoryServiceProvider)
  76. nsDirectoryServiceProvider::nsDirectoryServiceProvider()
  77. {
  78. /* member initializers and constructor code */
  79. }
  80. nsDirectoryServiceProvider::~nsDirectoryServiceProvider()
  81. {
  82. /* destructor code */
  83. }
  84. /* nsIFile getFile (in string prop, out PRBool persistent); */
  85. NS_IMETHODIMP nsDirectoryServiceProvider::GetFile(const char *prop, PRBool *persistent, nsIFile **_retval)
  86. {
  87. return NS_ERROR_NOT_IMPLEMENTED;
  88. }
  89. /* End of implementation class template. */
  90. #endif
  91. /* starting interface: nsIDirectoryServiceProvider2 */
  92. #define NS_IDIRECTORYSERVICEPROVIDER2_IID_STR "2f977d4b-5485-11d4-87e2-0010a4e75ef2"
  93. #define NS_IDIRECTORYSERVICEPROVIDER2_IID \
  94. {0x2f977d4b, 0x5485, 0x11d4, \
  95. { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 }}
  96. /**
  97. * nsIDirectoryServiceProvider2
  98. *
  99. * An extension of nsIDirectoryServiceProvider which allows
  100. * multiple files to be returned for the given key.
  101. *
  102. * @status FROZEN
  103. */
  104. class NS_NO_VTABLE NS_SCRIPTABLE nsIDirectoryServiceProvider2 : public nsIDirectoryServiceProvider {
  105. public:
  106. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDIRECTORYSERVICEPROVIDER2_IID)
  107. /**
  108. * getFiles
  109. *
  110. * Directory Service calls this when it gets a request for
  111. * a prop and the requested type is nsISimpleEnumerator.
  112. *
  113. * @param prop The symbolic name of the file list.
  114. *
  115. * @return An enumerator for a list of file locations.
  116. * The elements in the enumeration are nsIFile
  117. * @returnCode NS_SUCCESS_AGGREGATE_RESULT if this result should be
  118. * aggregated with other "lower" providers.
  119. */
  120. /* nsISimpleEnumerator getFiles (in string prop); */
  121. NS_SCRIPTABLE NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) = 0;
  122. };
  123. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDirectoryServiceProvider2, NS_IDIRECTORYSERVICEPROVIDER2_IID)
  124. /* Use this macro when declaring classes that implement this interface. */
  125. #define NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 \
  126. NS_SCRIPTABLE NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval);
  127. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  128. #define NS_FORWARD_NSIDIRECTORYSERVICEPROVIDER2(_to) \
  129. NS_SCRIPTABLE NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) { return _to GetFiles(prop, _retval); }
  130. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  131. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICEPROVIDER2(_to) \
  132. NS_SCRIPTABLE NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFiles(prop, _retval); }
  133. #if 0
  134. /* Use the code below as a template for the implementation class for this interface. */
  135. /* Header file */
  136. class nsDirectoryServiceProvider2 : public nsIDirectoryServiceProvider2
  137. {
  138. public:
  139. NS_DECL_ISUPPORTS
  140. NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
  141. nsDirectoryServiceProvider2();
  142. private:
  143. ~nsDirectoryServiceProvider2();
  144. protected:
  145. /* additional members */
  146. };
  147. /* Implementation file */
  148. NS_IMPL_ISUPPORTS1(nsDirectoryServiceProvider2, nsIDirectoryServiceProvider2)
  149. nsDirectoryServiceProvider2::nsDirectoryServiceProvider2()
  150. {
  151. /* member initializers and constructor code */
  152. }
  153. nsDirectoryServiceProvider2::~nsDirectoryServiceProvider2()
  154. {
  155. /* destructor code */
  156. }
  157. /* nsISimpleEnumerator getFiles (in string prop); */
  158. NS_IMETHODIMP nsDirectoryServiceProvider2::GetFiles(const char *prop, nsISimpleEnumerator **_retval)
  159. {
  160. return NS_ERROR_NOT_IMPLEMENTED;
  161. }
  162. /* End of implementation class template. */
  163. #endif
  164. /* starting interface: nsIDirectoryService */
  165. #define NS_IDIRECTORYSERVICE_IID_STR "57a66a60-d43a-11d3-8cc2-00609792278c"
  166. #define NS_IDIRECTORYSERVICE_IID \
  167. {0x57a66a60, 0xd43a, 0x11d3, \
  168. { 0x8c, 0xc2, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c }}
  169. /**
  170. * nsIDirectoryService
  171. *
  172. * @status FROZEN
  173. */
  174. class NS_NO_VTABLE NS_SCRIPTABLE nsIDirectoryService : public nsISupports {
  175. public:
  176. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDIRECTORYSERVICE_IID)
  177. /**
  178. * init
  179. *
  180. * Must be called. Used internally by XPCOM initialization.
  181. *
  182. */
  183. /* void init (); */
  184. NS_SCRIPTABLE NS_IMETHOD Init(void) = 0;
  185. /**
  186. * registerProvider
  187. *
  188. * Register a provider with the service.
  189. *
  190. * @param prov The service will keep a strong reference
  191. * to this object. It will be released when
  192. * the service is released.
  193. *
  194. */
  195. /* void registerProvider (in nsIDirectoryServiceProvider prov); */
  196. NS_SCRIPTABLE NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) = 0;
  197. /**
  198. * unregisterProvider
  199. *
  200. * Unregister a provider with the service.
  201. *
  202. * @param prov
  203. *
  204. */
  205. /* void unregisterProvider (in nsIDirectoryServiceProvider prov); */
  206. NS_SCRIPTABLE NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) = 0;
  207. };
  208. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDirectoryService, NS_IDIRECTORYSERVICE_IID)
  209. /* Use this macro when declaring classes that implement this interface. */
  210. #define NS_DECL_NSIDIRECTORYSERVICE \
  211. NS_SCRIPTABLE NS_IMETHOD Init(void); \
  212. NS_SCRIPTABLE NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov); \
  213. NS_SCRIPTABLE NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov);
  214. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  215. #define NS_FORWARD_NSIDIRECTORYSERVICE(_to) \
  216. NS_SCRIPTABLE NS_IMETHOD Init(void) { return _to Init(); } \
  217. NS_SCRIPTABLE NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) { return _to RegisterProvider(prov); } \
  218. NS_SCRIPTABLE NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) { return _to UnregisterProvider(prov); }
  219. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  220. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICE(_to) \
  221. NS_SCRIPTABLE NS_IMETHOD Init(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(); } \
  222. NS_SCRIPTABLE NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterProvider(prov); } \
  223. NS_SCRIPTABLE NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterProvider(prov); }
  224. #if 0
  225. /* Use the code below as a template for the implementation class for this interface. */
  226. /* Header file */
  227. class nsDirectoryService : public nsIDirectoryService
  228. {
  229. public:
  230. NS_DECL_ISUPPORTS
  231. NS_DECL_NSIDIRECTORYSERVICE
  232. nsDirectoryService();
  233. private:
  234. ~nsDirectoryService();
  235. protected:
  236. /* additional members */
  237. };
  238. /* Implementation file */
  239. NS_IMPL_ISUPPORTS1(nsDirectoryService, nsIDirectoryService)
  240. nsDirectoryService::nsDirectoryService()
  241. {
  242. /* member initializers and constructor code */
  243. }
  244. nsDirectoryService::~nsDirectoryService()
  245. {
  246. /* destructor code */
  247. }
  248. /* void init (); */
  249. NS_IMETHODIMP nsDirectoryService::Init()
  250. {
  251. return NS_ERROR_NOT_IMPLEMENTED;
  252. }
  253. /* void registerProvider (in nsIDirectoryServiceProvider prov); */
  254. NS_IMETHODIMP nsDirectoryService::RegisterProvider(nsIDirectoryServiceProvider *prov)
  255. {
  256. return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. /* void unregisterProvider (in nsIDirectoryServiceProvider prov); */
  259. NS_IMETHODIMP nsDirectoryService::UnregisterProvider(nsIDirectoryServiceProvider *prov)
  260. {
  261. return NS_ERROR_NOT_IMPLEMENTED;
  262. }
  263. /* End of implementation class template. */
  264. #endif
  265. #endif /* __gen_nsIDirectoryService_h__ */