nsILocalFile.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/io/nsILocalFile.idl
  3. */
  4. #ifndef __gen_nsILocalFile_h__
  5. #define __gen_nsILocalFile_h__
  6. #ifndef __gen_nsIFile_h__
  7. #include "nsIFile.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. #include "prio.h"
  14. #include "prlink.h"
  15. #include <stdio.h>
  16. /* starting interface: nsILocalFile */
  17. #define NS_ILOCALFILE_IID_STR "aa610f20-a889-11d3-8c81-000064657374"
  18. #define NS_ILOCALFILE_IID \
  19. {0xaa610f20, 0xa889, 0x11d3, \
  20. { 0x8c, 0x81, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
  21. /**
  22. * This interface adds methods to nsIFile that are particular to a file
  23. * that is accessible via the local file system.
  24. *
  25. * It follows the same string conventions as nsIFile.
  26. *
  27. * @status FROZEN
  28. */
  29. class NS_NO_VTABLE nsILocalFile : public nsIFile {
  30. public:
  31. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILOCALFILE_IID)
  32. /**
  33. * initWith[Native]Path
  34. *
  35. * This function will initialize the nsILocalFile object. Any
  36. * internal state information will be reset.
  37. *
  38. * NOTE: This function has a known bug on the macintosh and
  39. * other OSes which do not represent file locations as paths.
  40. * If you do use this function, be very aware of this problem!
  41. *
  42. * @param filePath
  43. * A string which specifies a full file path to a
  44. * location. Relative paths will be treated as an
  45. * error (NS_ERROR_FILE_UNRECOGNIZED_PATH). For
  46. * initWithNativePath, the filePath must be in the native
  47. * filesystem charset.
  48. */
  49. /* void initWithPath (in AString filePath); */
  50. NS_IMETHOD InitWithPath(const nsAString & filePath) = 0;
  51. /* [noscript] void initWithNativePath (in ACString filePath); */
  52. NS_IMETHOD InitWithNativePath(const nsACString & filePath) = 0;
  53. /**
  54. * initWithFile
  55. *
  56. * Initialize this object with another file
  57. *
  58. * @param aFile
  59. * the file this becomes equivalent to
  60. */
  61. /* void initWithFile (in nsILocalFile aFile); */
  62. NS_IMETHOD InitWithFile(nsILocalFile *aFile) = 0;
  63. /**
  64. * followLinks
  65. *
  66. * This attribute will determine if the nsLocalFile will auto
  67. * resolve symbolic links. By default, this value will be false
  68. * on all non unix systems. On unix, this attribute is effectively
  69. * a noop.
  70. */
  71. /* attribute PRBool followLinks; */
  72. NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) = 0;
  73. NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) = 0;
  74. /* [noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode); */
  75. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) = 0;
  76. /* [noscript] FILE openANSIFileDesc (in string mode); */
  77. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) = 0;
  78. /* [noscript] PRLibraryStar load (); */
  79. NS_IMETHOD Load(PRLibrary * *_retval) = 0;
  80. /* readonly attribute PRInt64 diskSpaceAvailable; */
  81. NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) = 0;
  82. /**
  83. * appendRelative[Native]Path
  84. *
  85. * Append a relative path to the current path of the nsILocalFile object.
  86. *
  87. * @param relativeFilePath
  88. * relativeFilePath is a native relative path. For security reasons,
  89. * this cannot contain .. or cannot start with a directory separator.
  90. * For the |appendRelativeNativePath| method, the relativeFilePath
  91. * must be in the native filesystem charset.
  92. */
  93. /* void appendRelativePath (in AString relativeFilePath); */
  94. NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) = 0;
  95. /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */
  96. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) = 0;
  97. /**
  98. * Accessor to a null terminated string which will specify
  99. * the file in a persistent manner for disk storage.
  100. *
  101. * The character set of this attribute is undefined. DO NOT TRY TO
  102. * INTERPRET IT AS HUMAN READABLE TEXT!
  103. */
  104. /* attribute ACString persistentDescriptor; */
  105. NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) = 0;
  106. NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) = 0;
  107. /**
  108. * reveal
  109. *
  110. * Ask the operating system to open the folder which contains
  111. * this file or folder. This routine only works on platforms which
  112. * support the ability to open a folder...
  113. */
  114. /* void reveal (); */
  115. NS_IMETHOD Reveal(void) = 0;
  116. /**
  117. * launch
  118. *
  119. * Ask the operating system to attempt to open the file.
  120. * this really just simulates "double clicking" the file on your platform.
  121. * This routine only works on platforms which support this functionality.
  122. */
  123. /* void launch (); */
  124. NS_IMETHOD Launch(void) = 0;
  125. /**
  126. * getRelativeDescriptor
  127. *
  128. * Returns a relative file path in an opaque, XP format. It is therefore
  129. * not a native path.
  130. *
  131. * The character set of the string returned from this function is
  132. * undefined. DO NOT TRY TO INTERPRET IT AS HUMAN READABLE TEXT!
  133. *
  134. * @param fromFile
  135. * the file from which the descriptor is relative.
  136. * There is no defined result if this param is null.
  137. */
  138. /* ACString getRelativeDescriptor (in nsILocalFile fromFile); */
  139. NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) = 0;
  140. /**
  141. * setRelativeDescriptor
  142. *
  143. * Initializes the file to the location relative to fromFile using
  144. * a string returned by getRelativeDescriptor.
  145. *
  146. * @param fromFile
  147. * the file to which the descriptor is relative
  148. * @param relative
  149. * the relative descriptor obtained from getRelativeDescriptor
  150. */
  151. /* void setRelativeDescriptor (in nsILocalFile fromFile, in ACString relativeDesc); */
  152. NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) = 0;
  153. };
  154. /* Use this macro when declaring classes that implement this interface. */
  155. #define NS_DECL_NSILOCALFILE \
  156. NS_IMETHOD InitWithPath(const nsAString & filePath); \
  157. NS_IMETHOD InitWithNativePath(const nsACString & filePath); \
  158. NS_IMETHOD InitWithFile(nsILocalFile *aFile); \
  159. NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks); \
  160. NS_IMETHOD SetFollowLinks(PRBool aFollowLinks); \
  161. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval); \
  162. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval); \
  163. NS_IMETHOD Load(PRLibrary * *_retval); \
  164. NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable); \
  165. NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath); \
  166. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath); \
  167. NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor); \
  168. NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor); \
  169. NS_IMETHOD Reveal(void); \
  170. NS_IMETHOD Launch(void); \
  171. NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval); \
  172. NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc);
  173. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  174. #define NS_FORWARD_NSILOCALFILE(_to) \
  175. NS_IMETHOD InitWithPath(const nsAString & filePath) { return _to InitWithPath(filePath); } \
  176. NS_IMETHOD InitWithNativePath(const nsACString & filePath) { return _to InitWithNativePath(filePath); } \
  177. NS_IMETHOD InitWithFile(nsILocalFile *aFile) { return _to InitWithFile(aFile); } \
  178. NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) { return _to GetFollowLinks(aFollowLinks); } \
  179. NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) { return _to SetFollowLinks(aFollowLinks); } \
  180. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) { return _to OpenNSPRFileDesc(flags, mode, _retval); } \
  181. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) { return _to OpenANSIFileDesc(mode, _retval); } \
  182. NS_IMETHOD Load(PRLibrary * *_retval) { return _to Load(_retval); } \
  183. NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) { return _to GetDiskSpaceAvailable(aDiskSpaceAvailable); } \
  184. NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) { return _to AppendRelativePath(relativeFilePath); } \
  185. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) { return _to AppendRelativeNativePath(relativeFilePath); } \
  186. NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) { return _to GetPersistentDescriptor(aPersistentDescriptor); } \
  187. NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) { return _to SetPersistentDescriptor(aPersistentDescriptor); } \
  188. NS_IMETHOD Reveal(void) { return _to Reveal(); } \
  189. NS_IMETHOD Launch(void) { return _to Launch(); } \
  190. NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) { return _to GetRelativeDescriptor(fromFile, _retval); } \
  191. NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) { return _to SetRelativeDescriptor(fromFile, relativeDesc); }
  192. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  193. #define NS_FORWARD_SAFE_NSILOCALFILE(_to) \
  194. NS_IMETHOD InitWithPath(const nsAString & filePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithPath(filePath); } \
  195. NS_IMETHOD InitWithNativePath(const nsACString & filePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithNativePath(filePath); } \
  196. NS_IMETHOD InitWithFile(nsILocalFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithFile(aFile); } \
  197. NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFollowLinks(aFollowLinks); } \
  198. NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFollowLinks(aFollowLinks); } \
  199. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenNSPRFileDesc(flags, mode, _retval); } \
  200. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenANSIFileDesc(mode, _retval); } \
  201. NS_IMETHOD Load(PRLibrary * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Load(_retval); } \
  202. NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDiskSpaceAvailable(aDiskSpaceAvailable); } \
  203. NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativePath(relativeFilePath); } \
  204. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativeNativePath(relativeFilePath); } \
  205. NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPersistentDescriptor(aPersistentDescriptor); } \
  206. NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPersistentDescriptor(aPersistentDescriptor); } \
  207. NS_IMETHOD Reveal(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Reveal(); } \
  208. NS_IMETHOD Launch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Launch(); } \
  209. NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeDescriptor(fromFile, _retval); } \
  210. NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRelativeDescriptor(fromFile, relativeDesc); }
  211. #if 0
  212. /* Use the code below as a template for the implementation class for this interface. */
  213. /* Header file */
  214. class nsLocalFile : public nsILocalFile
  215. {
  216. public:
  217. NS_DECL_ISUPPORTS
  218. NS_DECL_NSILOCALFILE
  219. nsLocalFile();
  220. private:
  221. ~nsLocalFile();
  222. protected:
  223. /* additional members */
  224. };
  225. /* Implementation file */
  226. NS_IMPL_ISUPPORTS1(nsLocalFile, nsILocalFile)
  227. nsLocalFile::nsLocalFile()
  228. {
  229. /* member initializers and constructor code */
  230. }
  231. nsLocalFile::~nsLocalFile()
  232. {
  233. /* destructor code */
  234. }
  235. /* void initWithPath (in AString filePath); */
  236. NS_IMETHODIMP nsLocalFile::InitWithPath(const nsAString & filePath)
  237. {
  238. return NS_ERROR_NOT_IMPLEMENTED;
  239. }
  240. /* [noscript] void initWithNativePath (in ACString filePath); */
  241. NS_IMETHODIMP nsLocalFile::InitWithNativePath(const nsACString & filePath)
  242. {
  243. return NS_ERROR_NOT_IMPLEMENTED;
  244. }
  245. /* void initWithFile (in nsILocalFile aFile); */
  246. NS_IMETHODIMP nsLocalFile::InitWithFile(nsILocalFile *aFile)
  247. {
  248. return NS_ERROR_NOT_IMPLEMENTED;
  249. }
  250. /* attribute PRBool followLinks; */
  251. NS_IMETHODIMP nsLocalFile::GetFollowLinks(PRBool *aFollowLinks)
  252. {
  253. return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255. NS_IMETHODIMP nsLocalFile::SetFollowLinks(PRBool aFollowLinks)
  256. {
  257. return NS_ERROR_NOT_IMPLEMENTED;
  258. }
  259. /* [noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode); */
  260. NS_IMETHODIMP nsLocalFile::OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval)
  261. {
  262. return NS_ERROR_NOT_IMPLEMENTED;
  263. }
  264. /* [noscript] FILE openANSIFileDesc (in string mode); */
  265. NS_IMETHODIMP nsLocalFile::OpenANSIFileDesc(const char *mode, FILE * *_retval)
  266. {
  267. return NS_ERROR_NOT_IMPLEMENTED;
  268. }
  269. /* [noscript] PRLibraryStar load (); */
  270. NS_IMETHODIMP nsLocalFile::Load(PRLibrary * *_retval)
  271. {
  272. return NS_ERROR_NOT_IMPLEMENTED;
  273. }
  274. /* readonly attribute PRInt64 diskSpaceAvailable; */
  275. NS_IMETHODIMP nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
  276. {
  277. return NS_ERROR_NOT_IMPLEMENTED;
  278. }
  279. /* void appendRelativePath (in AString relativeFilePath); */
  280. NS_IMETHODIMP nsLocalFile::AppendRelativePath(const nsAString & relativeFilePath)
  281. {
  282. return NS_ERROR_NOT_IMPLEMENTED;
  283. }
  284. /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */
  285. NS_IMETHODIMP nsLocalFile::AppendRelativeNativePath(const nsACString & relativeFilePath)
  286. {
  287. return NS_ERROR_NOT_IMPLEMENTED;
  288. }
  289. /* attribute ACString persistentDescriptor; */
  290. NS_IMETHODIMP nsLocalFile::GetPersistentDescriptor(nsACString & aPersistentDescriptor)
  291. {
  292. return NS_ERROR_NOT_IMPLEMENTED;
  293. }
  294. NS_IMETHODIMP nsLocalFile::SetPersistentDescriptor(const nsACString & aPersistentDescriptor)
  295. {
  296. return NS_ERROR_NOT_IMPLEMENTED;
  297. }
  298. /* void reveal (); */
  299. NS_IMETHODIMP nsLocalFile::Reveal()
  300. {
  301. return NS_ERROR_NOT_IMPLEMENTED;
  302. }
  303. /* void launch (); */
  304. NS_IMETHODIMP nsLocalFile::Launch()
  305. {
  306. return NS_ERROR_NOT_IMPLEMENTED;
  307. }
  308. /* ACString getRelativeDescriptor (in nsILocalFile fromFile); */
  309. NS_IMETHODIMP nsLocalFile::GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval)
  310. {
  311. return NS_ERROR_NOT_IMPLEMENTED;
  312. }
  313. /* void setRelativeDescriptor (in nsILocalFile fromFile, in ACString relativeDesc); */
  314. NS_IMETHODIMP nsLocalFile::SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc)
  315. {
  316. return NS_ERROR_NOT_IMPLEMENTED;
  317. }
  318. /* End of implementation class template. */
  319. #endif
  320. #endif /* __gen_nsILocalFile_h__ */