PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsILocalFile.h

http://firefox-mac-pdf.googlecode.com/
C Header | 387 lines | 179 code | 54 blank | 154 comment | 0 complexity | 37d213570b0d92fb7cc46b35b279d13d 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/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 NS_SCRIPTABLE nsILocalFile : public nsIFile {
  30. public:
  31. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) = 0;
  73. NS_SCRIPTABLE NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) = 0;
  74. /**
  75. * Return the result of PR_Open on the file. The caller is
  76. * responsible for calling PR_Close on the result.
  77. */
  78. /* [noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode); */
  79. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) = 0;
  80. /**
  81. * Return the result of fopen on the file. The caller is
  82. * responsible for calling fclose on the result.
  83. */
  84. /* [noscript] FILE openANSIFileDesc (in string mode); */
  85. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) = 0;
  86. /**
  87. * Return the result of PR_LoadLibrary on the file. The caller is
  88. * responsible for calling PR_UnloadLibrary on the result.
  89. */
  90. /* [noscript] PRLibraryStar load (); */
  91. NS_IMETHOD Load(PRLibrary * *_retval) = 0;
  92. /* readonly attribute PRInt64 diskSpaceAvailable; */
  93. NS_SCRIPTABLE NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) = 0;
  94. /**
  95. * appendRelative[Native]Path
  96. *
  97. * Append a relative path to the current path of the nsILocalFile object.
  98. *
  99. * @param relativeFilePath
  100. * relativeFilePath is a native relative path. For security reasons,
  101. * this cannot contain .. or cannot start with a directory separator.
  102. * For the |appendRelativeNativePath| method, the relativeFilePath
  103. * must be in the native filesystem charset.
  104. */
  105. /* void appendRelativePath (in AString relativeFilePath); */
  106. NS_SCRIPTABLE NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) = 0;
  107. /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */
  108. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) = 0;
  109. /**
  110. * Accessor to a null terminated string which will specify
  111. * the file in a persistent manner for disk storage.
  112. *
  113. * The character set of this attribute is undefined. DO NOT TRY TO
  114. * INTERPRET IT AS HUMAN READABLE TEXT!
  115. */
  116. /* attribute ACString persistentDescriptor; */
  117. NS_SCRIPTABLE NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) = 0;
  118. NS_SCRIPTABLE NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) = 0;
  119. /**
  120. * reveal
  121. *
  122. * Ask the operating system to open the folder which contains
  123. * this file or folder. This routine only works on platforms which
  124. * support the ability to open a folder...
  125. */
  126. /* void reveal (); */
  127. NS_SCRIPTABLE NS_IMETHOD Reveal(void) = 0;
  128. /**
  129. * launch
  130. *
  131. * Ask the operating system to attempt to open the file.
  132. * this really just simulates "double clicking" the file on your platform.
  133. * This routine only works on platforms which support this functionality.
  134. */
  135. /* void launch (); */
  136. NS_SCRIPTABLE NS_IMETHOD Launch(void) = 0;
  137. /**
  138. * getRelativeDescriptor
  139. *
  140. * Returns a relative file path in an opaque, XP format. It is therefore
  141. * not a native path.
  142. *
  143. * The character set of the string returned from this function is
  144. * undefined. DO NOT TRY TO INTERPRET IT AS HUMAN READABLE TEXT!
  145. *
  146. * @param fromFile
  147. * the file from which the descriptor is relative.
  148. * There is no defined result if this param is null.
  149. */
  150. /* ACString getRelativeDescriptor (in nsILocalFile fromFile); */
  151. NS_SCRIPTABLE NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) = 0;
  152. /**
  153. * setRelativeDescriptor
  154. *
  155. * Initializes the file to the location relative to fromFile using
  156. * a string returned by getRelativeDescriptor.
  157. *
  158. * @param fromFile
  159. * the file to which the descriptor is relative
  160. * @param relative
  161. * the relative descriptor obtained from getRelativeDescriptor
  162. */
  163. /* void setRelativeDescriptor (in nsILocalFile fromFile, in ACString relativeDesc); */
  164. NS_SCRIPTABLE NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) = 0;
  165. };
  166. NS_DEFINE_STATIC_IID_ACCESSOR(nsILocalFile, NS_ILOCALFILE_IID)
  167. /* Use this macro when declaring classes that implement this interface. */
  168. #define NS_DECL_NSILOCALFILE \
  169. NS_SCRIPTABLE NS_IMETHOD InitWithPath(const nsAString & filePath); \
  170. NS_IMETHOD InitWithNativePath(const nsACString & filePath); \
  171. NS_SCRIPTABLE NS_IMETHOD InitWithFile(nsILocalFile *aFile); \
  172. NS_SCRIPTABLE NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks); \
  173. NS_SCRIPTABLE NS_IMETHOD SetFollowLinks(PRBool aFollowLinks); \
  174. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval); \
  175. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval); \
  176. NS_IMETHOD Load(PRLibrary * *_retval); \
  177. NS_SCRIPTABLE NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable); \
  178. NS_SCRIPTABLE NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath); \
  179. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath); \
  180. NS_SCRIPTABLE NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor); \
  181. NS_SCRIPTABLE NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor); \
  182. NS_SCRIPTABLE NS_IMETHOD Reveal(void); \
  183. NS_SCRIPTABLE NS_IMETHOD Launch(void); \
  184. NS_SCRIPTABLE NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval); \
  185. NS_SCRIPTABLE NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc);
  186. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  187. #define NS_FORWARD_NSILOCALFILE(_to) \
  188. NS_SCRIPTABLE NS_IMETHOD InitWithPath(const nsAString & filePath) { return _to InitWithPath(filePath); } \
  189. NS_IMETHOD InitWithNativePath(const nsACString & filePath) { return _to InitWithNativePath(filePath); } \
  190. NS_SCRIPTABLE NS_IMETHOD InitWithFile(nsILocalFile *aFile) { return _to InitWithFile(aFile); } \
  191. NS_SCRIPTABLE NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) { return _to GetFollowLinks(aFollowLinks); } \
  192. NS_SCRIPTABLE NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) { return _to SetFollowLinks(aFollowLinks); } \
  193. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) { return _to OpenNSPRFileDesc(flags, mode, _retval); } \
  194. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) { return _to OpenANSIFileDesc(mode, _retval); } \
  195. NS_IMETHOD Load(PRLibrary * *_retval) { return _to Load(_retval); } \
  196. NS_SCRIPTABLE NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) { return _to GetDiskSpaceAvailable(aDiskSpaceAvailable); } \
  197. NS_SCRIPTABLE NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) { return _to AppendRelativePath(relativeFilePath); } \
  198. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) { return _to AppendRelativeNativePath(relativeFilePath); } \
  199. NS_SCRIPTABLE NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) { return _to GetPersistentDescriptor(aPersistentDescriptor); } \
  200. NS_SCRIPTABLE NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) { return _to SetPersistentDescriptor(aPersistentDescriptor); } \
  201. NS_SCRIPTABLE NS_IMETHOD Reveal(void) { return _to Reveal(); } \
  202. NS_SCRIPTABLE NS_IMETHOD Launch(void) { return _to Launch(); } \
  203. NS_SCRIPTABLE NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) { return _to GetRelativeDescriptor(fromFile, _retval); } \
  204. NS_SCRIPTABLE NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) { return _to SetRelativeDescriptor(fromFile, relativeDesc); }
  205. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  206. #define NS_FORWARD_SAFE_NSILOCALFILE(_to) \
  207. NS_SCRIPTABLE NS_IMETHOD InitWithPath(const nsAString & filePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithPath(filePath); } \
  208. NS_IMETHOD InitWithNativePath(const nsACString & filePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithNativePath(filePath); } \
  209. NS_SCRIPTABLE NS_IMETHOD InitWithFile(nsILocalFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithFile(aFile); } \
  210. NS_SCRIPTABLE NS_IMETHOD GetFollowLinks(PRBool *aFollowLinks) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFollowLinks(aFollowLinks); } \
  211. NS_SCRIPTABLE NS_IMETHOD SetFollowLinks(PRBool aFollowLinks) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFollowLinks(aFollowLinks); } \
  212. NS_IMETHOD OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenNSPRFileDesc(flags, mode, _retval); } \
  213. NS_IMETHOD OpenANSIFileDesc(const char *mode, FILE * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenANSIFileDesc(mode, _retval); } \
  214. NS_IMETHOD Load(PRLibrary * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Load(_retval); } \
  215. NS_SCRIPTABLE NS_IMETHOD GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDiskSpaceAvailable(aDiskSpaceAvailable); } \
  216. NS_SCRIPTABLE NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativePath(relativeFilePath); } \
  217. NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativeNativePath(relativeFilePath); } \
  218. NS_SCRIPTABLE NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPersistentDescriptor(aPersistentDescriptor); } \
  219. NS_SCRIPTABLE NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPersistentDescriptor(aPersistentDescriptor); } \
  220. NS_SCRIPTABLE NS_IMETHOD Reveal(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Reveal(); } \
  221. NS_SCRIPTABLE NS_IMETHOD Launch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Launch(); } \
  222. NS_SCRIPTABLE NS_IMETHOD GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeDescriptor(fromFile, _retval); } \
  223. NS_SCRIPTABLE NS_IMETHOD SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRelativeDescriptor(fromFile, relativeDesc); }
  224. #if 0
  225. /* Use the code below as a template for the implementation class for this interface. */
  226. /* Header file */
  227. class nsLocalFile : public nsILocalFile
  228. {
  229. public:
  230. NS_DECL_ISUPPORTS
  231. NS_DECL_NSILOCALFILE
  232. nsLocalFile();
  233. private:
  234. ~nsLocalFile();
  235. protected:
  236. /* additional members */
  237. };
  238. /* Implementation file */
  239. NS_IMPL_ISUPPORTS1(nsLocalFile, nsILocalFile)
  240. nsLocalFile::nsLocalFile()
  241. {
  242. /* member initializers and constructor code */
  243. }
  244. nsLocalFile::~nsLocalFile()
  245. {
  246. /* destructor code */
  247. }
  248. /* void initWithPath (in AString filePath); */
  249. NS_IMETHODIMP nsLocalFile::InitWithPath(const nsAString & filePath)
  250. {
  251. return NS_ERROR_NOT_IMPLEMENTED;
  252. }
  253. /* [noscript] void initWithNativePath (in ACString filePath); */
  254. NS_IMETHODIMP nsLocalFile::InitWithNativePath(const nsACString & filePath)
  255. {
  256. return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. /* void initWithFile (in nsILocalFile aFile); */
  259. NS_IMETHODIMP nsLocalFile::InitWithFile(nsILocalFile *aFile)
  260. {
  261. return NS_ERROR_NOT_IMPLEMENTED;
  262. }
  263. /* attribute PRBool followLinks; */
  264. NS_IMETHODIMP nsLocalFile::GetFollowLinks(PRBool *aFollowLinks)
  265. {
  266. return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268. NS_IMETHODIMP nsLocalFile::SetFollowLinks(PRBool aFollowLinks)
  269. {
  270. return NS_ERROR_NOT_IMPLEMENTED;
  271. }
  272. /* [noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode); */
  273. NS_IMETHODIMP nsLocalFile::OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval)
  274. {
  275. return NS_ERROR_NOT_IMPLEMENTED;
  276. }
  277. /* [noscript] FILE openANSIFileDesc (in string mode); */
  278. NS_IMETHODIMP nsLocalFile::OpenANSIFileDesc(const char *mode, FILE * *_retval)
  279. {
  280. return NS_ERROR_NOT_IMPLEMENTED;
  281. }
  282. /* [noscript] PRLibraryStar load (); */
  283. NS_IMETHODIMP nsLocalFile::Load(PRLibrary * *_retval)
  284. {
  285. return NS_ERROR_NOT_IMPLEMENTED;
  286. }
  287. /* readonly attribute PRInt64 diskSpaceAvailable; */
  288. NS_IMETHODIMP nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
  289. {
  290. return NS_ERROR_NOT_IMPLEMENTED;
  291. }
  292. /* void appendRelativePath (in AString relativeFilePath); */
  293. NS_IMETHODIMP nsLocalFile::AppendRelativePath(const nsAString & relativeFilePath)
  294. {
  295. return NS_ERROR_NOT_IMPLEMENTED;
  296. }
  297. /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */
  298. NS_IMETHODIMP nsLocalFile::AppendRelativeNativePath(const nsACString & relativeFilePath)
  299. {
  300. return NS_ERROR_NOT_IMPLEMENTED;
  301. }
  302. /* attribute ACString persistentDescriptor; */
  303. NS_IMETHODIMP nsLocalFile::GetPersistentDescriptor(nsACString & aPersistentDescriptor)
  304. {
  305. return NS_ERROR_NOT_IMPLEMENTED;
  306. }
  307. NS_IMETHODIMP nsLocalFile::SetPersistentDescriptor(const nsACString & aPersistentDescriptor)
  308. {
  309. return NS_ERROR_NOT_IMPLEMENTED;
  310. }
  311. /* void reveal (); */
  312. NS_IMETHODIMP nsLocalFile::Reveal()
  313. {
  314. return NS_ERROR_NOT_IMPLEMENTED;
  315. }
  316. /* void launch (); */
  317. NS_IMETHODIMP nsLocalFile::Launch()
  318. {
  319. return NS_ERROR_NOT_IMPLEMENTED;
  320. }
  321. /* ACString getRelativeDescriptor (in nsILocalFile fromFile); */
  322. NS_IMETHODIMP nsLocalFile::GetRelativeDescriptor(nsILocalFile *fromFile, nsACString & _retval)
  323. {
  324. return NS_ERROR_NOT_IMPLEMENTED;
  325. }
  326. /* void setRelativeDescriptor (in nsILocalFile fromFile, in ACString relativeDesc); */
  327. NS_IMETHODIMP nsLocalFile::SetRelativeDescriptor(nsILocalFile *fromFile, const nsACString & relativeDesc)
  328. {
  329. return NS_ERROR_NOT_IMPLEMENTED;
  330. }
  331. /* End of implementation class template. */
  332. #endif
  333. #endif /* __gen_nsILocalFile_h__ */