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