nsIDirectoryService.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/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 nsIDirectoryServiceProvider : public nsISupports {
  29. public:
  30. NS_DEFINE_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_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) = 0;
  49. };
  50. /* Use this macro when declaring classes that implement this interface. */
  51. #define NS_DECL_NSIDIRECTORYSERVICEPROVIDER \
  52. NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval);
  53. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  54. #define NS_FORWARD_NSIDIRECTORYSERVICEPROVIDER(_to) \
  55. NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) { return _to GetFile(prop, persistent, _retval); }
  56. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  57. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICEPROVIDER(_to) \
  58. NS_IMETHOD GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(prop, persistent, _retval); }
  59. #if 0
  60. /* Use the code below as a template for the implementation class for this interface. */
  61. /* Header file */
  62. class nsDirectoryServiceProvider : public nsIDirectoryServiceProvider
  63. {
  64. public:
  65. NS_DECL_ISUPPORTS
  66. NS_DECL_NSIDIRECTORYSERVICEPROVIDER
  67. nsDirectoryServiceProvider();
  68. private:
  69. ~nsDirectoryServiceProvider();
  70. protected:
  71. /* additional members */
  72. };
  73. /* Implementation file */
  74. NS_IMPL_ISUPPORTS1(nsDirectoryServiceProvider, nsIDirectoryServiceProvider)
  75. nsDirectoryServiceProvider::nsDirectoryServiceProvider()
  76. {
  77. /* member initializers and constructor code */
  78. }
  79. nsDirectoryServiceProvider::~nsDirectoryServiceProvider()
  80. {
  81. /* destructor code */
  82. }
  83. /* nsIFile getFile (in string prop, out PRBool persistent); */
  84. NS_IMETHODIMP nsDirectoryServiceProvider::GetFile(const char *prop, PRBool *persistent, nsIFile **_retval)
  85. {
  86. return NS_ERROR_NOT_IMPLEMENTED;
  87. }
  88. /* End of implementation class template. */
  89. #endif
  90. /* starting interface: nsIDirectoryServiceProvider2 */
  91. #define NS_IDIRECTORYSERVICEPROVIDER2_IID_STR "2f977d4b-5485-11d4-87e2-0010a4e75ef2"
  92. #define NS_IDIRECTORYSERVICEPROVIDER2_IID \
  93. {0x2f977d4b, 0x5485, 0x11d4, \
  94. { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 }}
  95. /**
  96. * nsIDirectoryServiceProvider2
  97. *
  98. * An extension of nsIDirectoryServiceProvider which allows
  99. * multiple files to be returned for the given key.
  100. *
  101. * @status FROZEN
  102. */
  103. class NS_NO_VTABLE nsIDirectoryServiceProvider2 : public nsIDirectoryServiceProvider {
  104. public:
  105. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDIRECTORYSERVICEPROVIDER2_IID)
  106. /**
  107. * getFiles
  108. *
  109. * Directory Service calls this when it gets a request for
  110. * a prop and the requested type is nsISimpleEnumerator.
  111. *
  112. * @param prop The symbolic name of the file list.
  113. *
  114. * @return An enumerator for a list of file locations.
  115. * The elements in the enumeration are nsIFile
  116. * @returnCode NS_SUCCESS_AGGREGATE_RESULT if this result should be
  117. * aggregated with other "lower" providers.
  118. */
  119. /* nsISimpleEnumerator getFiles (in string prop); */
  120. NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) = 0;
  121. };
  122. /* Use this macro when declaring classes that implement this interface. */
  123. #define NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 \
  124. NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval);
  125. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  126. #define NS_FORWARD_NSIDIRECTORYSERVICEPROVIDER2(_to) \
  127. NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) { return _to GetFiles(prop, _retval); }
  128. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  129. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICEPROVIDER2(_to) \
  130. NS_IMETHOD GetFiles(const char *prop, nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFiles(prop, _retval); }
  131. #if 0
  132. /* Use the code below as a template for the implementation class for this interface. */
  133. /* Header file */
  134. class nsDirectoryServiceProvider2 : public nsIDirectoryServiceProvider2
  135. {
  136. public:
  137. NS_DECL_ISUPPORTS
  138. NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
  139. nsDirectoryServiceProvider2();
  140. private:
  141. ~nsDirectoryServiceProvider2();
  142. protected:
  143. /* additional members */
  144. };
  145. /* Implementation file */
  146. NS_IMPL_ISUPPORTS1(nsDirectoryServiceProvider2, nsIDirectoryServiceProvider2)
  147. nsDirectoryServiceProvider2::nsDirectoryServiceProvider2()
  148. {
  149. /* member initializers and constructor code */
  150. }
  151. nsDirectoryServiceProvider2::~nsDirectoryServiceProvider2()
  152. {
  153. /* destructor code */
  154. }
  155. /* nsISimpleEnumerator getFiles (in string prop); */
  156. NS_IMETHODIMP nsDirectoryServiceProvider2::GetFiles(const char *prop, nsISimpleEnumerator **_retval)
  157. {
  158. return NS_ERROR_NOT_IMPLEMENTED;
  159. }
  160. /* End of implementation class template. */
  161. #endif
  162. /* starting interface: nsIDirectoryService */
  163. #define NS_IDIRECTORYSERVICE_IID_STR "57a66a60-d43a-11d3-8cc2-00609792278c"
  164. #define NS_IDIRECTORYSERVICE_IID \
  165. {0x57a66a60, 0xd43a, 0x11d3, \
  166. { 0x8c, 0xc2, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c }}
  167. /**
  168. * nsIDirectoryService
  169. *
  170. * @status FROZEN
  171. */
  172. class NS_NO_VTABLE nsIDirectoryService : public nsISupports {
  173. public:
  174. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDIRECTORYSERVICE_IID)
  175. /**
  176. * init
  177. *
  178. * Must be called. Used internally by XPCOM initialization.
  179. *
  180. */
  181. /* void init (); */
  182. NS_IMETHOD Init(void) = 0;
  183. /**
  184. * registerProvider
  185. *
  186. * Register a provider with the service.
  187. *
  188. * @param prov The service will keep a strong reference
  189. * to this object. It will be released when
  190. * the service is released.
  191. *
  192. */
  193. /* void registerProvider (in nsIDirectoryServiceProvider prov); */
  194. NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) = 0;
  195. /**
  196. * unregisterProvider
  197. *
  198. * Unregister a provider with the service.
  199. *
  200. * @param prov
  201. *
  202. */
  203. /* void unregisterProvider (in nsIDirectoryServiceProvider prov); */
  204. NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) = 0;
  205. };
  206. /* Use this macro when declaring classes that implement this interface. */
  207. #define NS_DECL_NSIDIRECTORYSERVICE \
  208. NS_IMETHOD Init(void); \
  209. NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov); \
  210. NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov);
  211. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  212. #define NS_FORWARD_NSIDIRECTORYSERVICE(_to) \
  213. NS_IMETHOD Init(void) { return _to Init(); } \
  214. NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) { return _to RegisterProvider(prov); } \
  215. NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) { return _to UnregisterProvider(prov); }
  216. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  217. #define NS_FORWARD_SAFE_NSIDIRECTORYSERVICE(_to) \
  218. NS_IMETHOD Init(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(); } \
  219. NS_IMETHOD RegisterProvider(nsIDirectoryServiceProvider *prov) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterProvider(prov); } \
  220. NS_IMETHOD UnregisterProvider(nsIDirectoryServiceProvider *prov) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterProvider(prov); }
  221. #if 0
  222. /* Use the code below as a template for the implementation class for this interface. */
  223. /* Header file */
  224. class nsDirectoryService : public nsIDirectoryService
  225. {
  226. public:
  227. NS_DECL_ISUPPORTS
  228. NS_DECL_NSIDIRECTORYSERVICE
  229. nsDirectoryService();
  230. private:
  231. ~nsDirectoryService();
  232. protected:
  233. /* additional members */
  234. };
  235. /* Implementation file */
  236. NS_IMPL_ISUPPORTS1(nsDirectoryService, nsIDirectoryService)
  237. nsDirectoryService::nsDirectoryService()
  238. {
  239. /* member initializers and constructor code */
  240. }
  241. nsDirectoryService::~nsDirectoryService()
  242. {
  243. /* destructor code */
  244. }
  245. /* void init (); */
  246. NS_IMETHODIMP nsDirectoryService::Init()
  247. {
  248. return NS_ERROR_NOT_IMPLEMENTED;
  249. }
  250. /* void registerProvider (in nsIDirectoryServiceProvider prov); */
  251. NS_IMETHODIMP nsDirectoryService::RegisterProvider(nsIDirectoryServiceProvider *prov)
  252. {
  253. return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255. /* void unregisterProvider (in nsIDirectoryServiceProvider prov); */
  256. NS_IMETHODIMP nsDirectoryService::UnregisterProvider(nsIDirectoryServiceProvider *prov)
  257. {
  258. return NS_ERROR_NOT_IMPLEMENTED;
  259. }
  260. /* End of implementation class template. */
  261. #endif
  262. #endif /* __gen_nsIDirectoryService_h__ */