2002-01-07 17:31:44 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2002-01-07 17:31:44 +03:00
|
|
|
|
|
|
|
#include "nsILocalFile.idl"
|
|
|
|
|
|
|
|
%{C++
|
2009-03-19 20:41:13 +03:00
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
2002-01-07 17:31:44 +03:00
|
|
|
%}
|
|
|
|
|
|
|
|
native OSType(OSType);
|
|
|
|
native FSSpec(FSSpec);
|
2002-09-25 16:23:39 +04:00
|
|
|
native FSRef(FSRef);
|
|
|
|
[ptr] native FSRefPtr(FSRef);
|
|
|
|
native CFURLRef(CFURLRef);
|
2002-01-07 17:31:44 +03:00
|
|
|
|
2012-06-06 20:30:58 +04:00
|
|
|
[scriptable, builtinclass, uuid(E5DE2CC9-BF06-4329-8F91-5D2D45284500)]
|
2002-01-07 17:31:44 +03:00
|
|
|
interface nsILocalFileMac : nsILocalFile
|
|
|
|
{
|
2002-09-25 16:23:39 +04:00
|
|
|
/**
|
|
|
|
* initWithCFURL
|
|
|
|
*
|
|
|
|
* Init this object with a CFURLRef
|
|
|
|
*
|
2010-03-05 23:57:14 +03:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 16:23:39 +04:00
|
|
|
* NOTE: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand.
|
|
|
|
*
|
|
|
|
* @param aCFURL the CoreFoundation URL
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] void initWithCFURL(in CFURLRef aCFURL);
|
2002-09-25 16:23:39 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* initWithFSRef
|
|
|
|
*
|
|
|
|
* Init this object with an FSRef
|
|
|
|
*
|
2010-03-05 23:57:14 +03:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 16:23:39 +04:00
|
|
|
*
|
2009-04-10 04:54:11 +04:00
|
|
|
* @param aFSRef the native FSRef
|
2002-09-25 16:23:39 +04:00
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] void initWithFSRef([const] in FSRefPtr aFSRef);
|
2002-09-25 16:23:39 +04:00
|
|
|
|
2002-11-15 18:35:17 +03:00
|
|
|
/**
|
|
|
|
* getCFURL
|
|
|
|
*
|
|
|
|
* Returns the CFURLRef of the file object. The caller is
|
|
|
|
* responsible for calling CFRelease() on it.
|
|
|
|
*
|
|
|
|
* NOTE: Observes the state of the followLinks attribute.
|
|
|
|
* If the file object is an alias and followLinks is TRUE, returns
|
|
|
|
* the target of the alias. If followLinks is FALSE, returns
|
|
|
|
* the unresolved alias file.
|
|
|
|
*
|
2010-03-05 23:57:14 +03:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-11-15 18:35:17 +03:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] CFURLRef getCFURL();
|
2002-09-25 16:23:39 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* getFSRef
|
|
|
|
*
|
|
|
|
* Returns the FSRef of the file object.
|
|
|
|
*
|
|
|
|
* NOTE: Observes the state of the followLinks attribute.
|
|
|
|
* If the file object is an alias and followLinks is TRUE, returns
|
|
|
|
* the target of the alias. If followLinks is FALSE, returns
|
|
|
|
* the unresolved alias file.
|
|
|
|
*
|
2010-03-05 23:57:14 +03:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 16:23:39 +04:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] FSRef getFSRef();
|
2002-09-25 16:23:39 +04:00
|
|
|
|
2002-01-07 17:31:44 +03:00
|
|
|
/**
|
|
|
|
* getFSSpec
|
|
|
|
*
|
|
|
|
* Returns the FSSpec of the file object.
|
|
|
|
*
|
|
|
|
* NOTE: Observes the state of the followLinks attribute.
|
|
|
|
* If the file object is an alias and followLinks is TRUE, returns
|
|
|
|
* the target of the alias. If followLinks is FALSE, returns
|
|
|
|
* the unresolved alias file.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] FSSpec getFSSpec();
|
2002-01-07 17:31:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* fileSizeWithResFork
|
|
|
|
*
|
|
|
|
* Returns the combined size of both the data fork and the resource
|
|
|
|
* fork (if present) rather than just the size of the data fork
|
|
|
|
* as returned by GetFileSize()
|
|
|
|
*
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute int64_t fileSizeWithResFork;
|
2010-07-22 07:25:24 +04:00
|
|
|
|
2002-01-07 17:31:44 +03:00
|
|
|
/**
|
|
|
|
* fileType, creator
|
|
|
|
*
|
|
|
|
* File type and creator attributes
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
[noscript] attribute OSType fileType;
|
|
|
|
[noscript] attribute OSType fileCreator;
|
2009-05-02 22:01:25 +04:00
|
|
|
|
2002-01-07 17:31:44 +03:00
|
|
|
/**
|
|
|
|
* launchWithDoc
|
|
|
|
*
|
|
|
|
* Launch the application that this file points to with a document.
|
|
|
|
*
|
2012-06-06 06:08:30 +04:00
|
|
|
* @param aDocToLoad Must not be NULL. If no document, use nsIFile::launch
|
2002-01-07 17:31:44 +03:00
|
|
|
* @param aLaunchInBackground TRUE if the application should not come to the front.
|
|
|
|
*
|
|
|
|
*/
|
2012-06-06 06:08:30 +04:00
|
|
|
void launchWithDoc(in nsIFile aDocToLoad, in boolean aLaunchInBackground);
|
2002-01-07 17:31:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* openDocWithApp
|
|
|
|
*
|
|
|
|
* Open the document that this file points to with the given application.
|
|
|
|
*
|
|
|
|
* @param aAppToOpenWith The application with which to open the document.
|
|
|
|
* If NULL, the creator code of the document is used
|
|
|
|
* to determine the application.
|
|
|
|
* @param aLaunchInBackground TRUE if the application should not come to the front.
|
|
|
|
*
|
|
|
|
*/
|
2012-06-06 06:08:30 +04:00
|
|
|
void openDocWithApp(in nsIFile aAppToOpenWith, in boolean aLaunchInBackground);
|
2002-01-07 17:31:44 +03:00
|
|
|
|
2002-01-31 02:53:12 +03:00
|
|
|
/**
|
|
|
|
* isPackage
|
|
|
|
*
|
|
|
|
* returns true if a directory is determined to be a package under Mac OS 9/X
|
|
|
|
*
|
|
|
|
*/
|
2006-06-28 02:38:55 +04:00
|
|
|
boolean isPackage();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* bundleDisplayName
|
|
|
|
*
|
|
|
|
* returns the display name of the application bundle (usually the human
|
|
|
|
* readable name of the application)
|
|
|
|
*/
|
|
|
|
readonly attribute AString bundleDisplayName;
|
2006-12-23 23:17:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* bundleIdentifier
|
|
|
|
*
|
|
|
|
* returns the identifier of the bundle
|
|
|
|
*/
|
|
|
|
readonly attribute AUTF8String bundleIdentifier;
|
2012-04-10 19:56:49 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Last modified time of a bundle's contents (as opposed to its package
|
|
|
|
* directory). Our convention is to make the bundle's Info.plist file
|
|
|
|
* stand in for the rest of its contents -- since this file contains the
|
|
|
|
* bundle's version information and other identifiers. For non-bundles
|
|
|
|
* this is the same as lastModifiedTime.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute int64_t bundleContentsLastModifiedTime;
|
2002-01-07 17:31:44 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2002-04-29 10:22:55 +04:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_EXPORT nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, bool aFollowSymlinks, nsILocalFileMac** result);
|
|
|
|
NS_EXPORT nsresult NS_NewLocalFileWithCFURL(const CFURLRef aURL, bool aFollowSymlinks, nsILocalFileMac** result);
|
2002-04-29 10:22:55 +04:00
|
|
|
}
|
2002-01-07 17:31:44 +03:00
|
|
|
%}
|