On x86 compilers without fastcall, simulate it when invoking traces and un-simulate...
[wine-gecko.git] / xpcom / io / nsILocalFileMac.idl
blob0ffc2cecc04503e89f7be7ef58e3ea6f3bc193b6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2001
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Conrad Carlen <ccarlen@netscape.com>
24 * Mark Mentovai <mark@moxienet.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include "nsILocalFile.idl"
42 %{C++
43 #include <Files.h>
44 #include <CFURL.h>
47 native OSType(OSType);
48 native FSSpec(FSSpec);
49 [ptr] native FSSpecPtr(FSSpec);
50 native FSRef(FSRef);
51 [ptr] native FSRefPtr(FSRef);
52 native CFURLRef(CFURLRef);
54 [scriptable, uuid(748f3ffe-27d9-4402-9de9-494badbeebf4)]
55 interface nsILocalFileMac : nsILocalFile
57 /**
58 * initWithCFURL
60 * Init this object with a CFURLRef
62 * NOTE: Supported only for XP_MACOSX or TARGET_CARBON
63 * NOTE: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand.
65 * @param aCFURL the CoreFoundation URL
68 [noscript] void initWithCFURL(in CFURLRef aCFURL);
70 /**
71 * initWithFSRef
73 * Init this object with an FSRef
75 * NOTE: Supported only for XP_MACOSX or TARGET_CARBON
77 * @param aFSRef the native file spec
80 [noscript] void initWithFSRef([const] in FSRefPtr aFSRef);
82 /**
83 * initWithFSSpec
85 * Init this object with an FSSpec
86 * Legacy method - leaving in place for now
88 * @param aFileSpec the native file spec
91 [noscript] void initWithFSSpec([const] in FSSpecPtr aFileSpec);
93 /**
94 * initToAppWithCreatorCode
96 * Init this object to point to an application having the given
97 * creator code. If this app is missing, this will fail. It will first
98 * look for running application with the given creator.
100 * @param aAppCreator the signature of the app
103 [noscript] void initToAppWithCreatorCode(in OSType aAppCreator);
106 * getCFURL
108 * Returns the CFURLRef of the file object. The caller is
109 * responsible for calling CFRelease() on it.
111 * NOTE: Observes the state of the followLinks attribute.
112 * If the file object is an alias and followLinks is TRUE, returns
113 * the target of the alias. If followLinks is FALSE, returns
114 * the unresolved alias file.
116 * NOTE: Supported only for XP_MACOSX or TARGET_CARBON
118 * @return
121 [noscript] CFURLRef getCFURL();
124 * getFSRef
126 * Returns the FSRef of the file object.
128 * NOTE: Observes the state of the followLinks attribute.
129 * If the file object is an alias and followLinks is TRUE, returns
130 * the target of the alias. If followLinks is FALSE, returns
131 * the unresolved alias file.
133 * NOTE: Supported only for XP_MACOSX or TARGET_CARBON
135 * @return
138 [noscript] FSRef getFSRef();
141 * getFSSpec
143 * Returns the FSSpec of the file object.
145 * NOTE: Observes the state of the followLinks attribute.
146 * If the file object is an alias and followLinks is TRUE, returns
147 * the target of the alias. If followLinks is FALSE, returns
148 * the unresolved alias file.
150 * @return
153 [noscript] FSSpec getFSSpec();
156 * fileSizeWithResFork
158 * Returns the combined size of both the data fork and the resource
159 * fork (if present) rather than just the size of the data fork
160 * as returned by GetFileSize()
163 readonly attribute PRInt64 fileSizeWithResFork;
166 * Use with SetFileType() to specify the signature of current process
168 const unsigned long CURRENT_PROCESS_CREATOR = 0x8000000;
171 * fileType, creator
173 * File type and creator attributes
176 [noscript] attribute OSType fileType;
177 [noscript] attribute OSType fileCreator;
180 * setFileTypeAndCreatorFromMIMEType
182 * Sets the file type and creator code from a MIME type.
183 * Internet Config is used to determine the mapping.
185 * @param aMIMEType
188 void setFileTypeAndCreatorFromMIMEType(in string aMIMEType);
191 * setFileTypeAndCreatorFromExtension
193 * Sets the file type and creator code from a file extension
194 * Internet Config is used to determine the mapping.
196 * @param aExtension
199 void setFileTypeAndCreatorFromExtension(in string aExtension);
202 * launchWithDoc
204 * Launch the application that this file points to with a document.
206 * @param aDocToLoad Must not be NULL. If no document, use nsILocalFile::launch
207 * @param aLaunchInBackground TRUE if the application should not come to the front.
210 void launchWithDoc(in nsILocalFile aDocToLoad, in boolean aLaunchInBackground);
213 * openDocWithApp
215 * Open the document that this file points to with the given application.
217 * @param aAppToOpenWith The application with which to open the document.
218 * If NULL, the creator code of the document is used
219 * to determine the application.
220 * @param aLaunchInBackground TRUE if the application should not come to the front.
223 void openDocWithApp(in nsILocalFile aAppToOpenWith, in boolean aLaunchInBackground);
226 * isPackage
228 * returns true if a directory is determined to be a package under Mac OS 9/X
231 boolean isPackage();
234 * bundleDisplayName
236 * returns the display name of the application bundle (usually the human
237 * readable name of the application)
239 readonly attribute AString bundleDisplayName;
242 * bundleIdentifier
244 * returns the identifier of the bundle
246 readonly attribute AUTF8String bundleIdentifier;
249 %{C++
250 extern "C"
253 #ifndef XP_MACOSX
254 NS_EXPORT const char* NS_TruncNodeName(const char *aNode, char *outBuf);
255 #endif
257 NS_EXPORT nsresult NS_NewLocalFileWithFSSpec(const FSSpec* inSpec, PRBool followSymlinks, nsILocalFileMac* *result);
259 // NS_NewLocalFileWithFSRef is available since Mozilla 1.8.1.
260 NS_EXPORT nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, PRBool aFollowSymlinks, nsILocalFileMac** result);