2002-01-07 14:31:44 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00: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 14:31:44 +00:00
|
|
|
|
|
|
|
#include "nsILocalFile.idl"
|
|
|
|
|
|
|
|
%{C++
|
2009-03-19 17:41:13 +00:00
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
2002-01-07 14:31:44 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
native OSType(OSType);
|
|
|
|
native FSSpec(FSSpec);
|
2002-09-25 12:23:39 +00:00
|
|
|
native FSRef(FSRef);
|
|
|
|
[ptr] native FSRefPtr(FSRef);
|
|
|
|
native CFURLRef(CFURLRef);
|
2002-01-07 14:31:44 +00:00
|
|
|
|
2012-06-06 16:30:58 +00:00
|
|
|
[scriptable, builtinclass, uuid(E5DE2CC9-BF06-4329-8F91-5D2D45284500)]
|
2002-01-07 14:31:44 +00:00
|
|
|
interface nsILocalFileMac : nsILocalFile
|
|
|
|
{
|
2002-09-25 12:23:39 +00:00
|
|
|
/**
|
|
|
|
* initWithCFURL
|
|
|
|
*
|
|
|
|
* Init this object with a CFURLRef
|
|
|
|
*
|
2010-03-05 20:57:14 +00:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 12:23:39 +00: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-27 22:38:55 +00:00
|
|
|
[noscript] void initWithCFURL(in CFURLRef aCFURL);
|
2002-09-25 12:23:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* initWithFSRef
|
|
|
|
*
|
|
|
|
* Init this object with an FSRef
|
|
|
|
*
|
2010-03-05 20:57:14 +00:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 12:23:39 +00:00
|
|
|
*
|
2009-04-10 00:54:11 +00:00
|
|
|
* @param aFSRef the native FSRef
|
2002-09-25 12:23:39 +00:00
|
|
|
*
|
|
|
|
*/
|
2006-06-27 22:38:55 +00:00
|
|
|
[noscript] void initWithFSRef([const] in FSRefPtr aFSRef);
|
2002-09-25 12:23:39 +00:00
|
|
|
|
2002-11-15 15:35:17 +00: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 20:57:14 +00:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-11-15 15:35:17 +00:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
*/
|
2006-06-27 22:38:55 +00:00
|
|
|
[noscript] CFURLRef getCFURL();
|
2002-09-25 12:23:39 +00: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 20:57:14 +00:00
|
|
|
* NOTE: Supported only for XP_MACOSX
|
2002-09-25 12:23:39 +00:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
*/
|
2006-06-27 22:38:55 +00:00
|
|
|
[noscript] FSRef getFSRef();
|
2002-09-25 12:23:39 +00:00
|
|
|
|
2002-01-07 14:31:44 +00: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-27 22:38:55 +00:00
|
|
|
[noscript] FSSpec getFSSpec();
|
2002-01-07 14:31:44 +00: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 15:56:38 +00:00
|
|
|
readonly attribute int64_t fileSizeWithResFork;
|
2010-07-22 03:25:24 +00:00
|
|
|
|
2002-01-07 14:31:44 +00:00
|
|
|
/**
|
|
|
|
* fileType, creator
|
|
|
|
*
|
|
|
|
* File type and creator attributes
|
|
|
|
*
|
|
|
|
*/
|
2006-06-27 22:38:55 +00:00
|
|
|
[noscript] attribute OSType fileType;
|
|
|
|
[noscript] attribute OSType fileCreator;
|
2009-05-02 18:01:25 +00:00
|
|
|
|
2002-01-07 14:31:44 +00:00
|
|
|
/**
|
|
|
|
* launchWithDoc
|
|
|
|
*
|
|
|
|
* Launch the application that this file points to with a document.
|
|
|
|
*
|
2012-06-06 02:08:30 +00:00
|
|
|
* @param aDocToLoad Must not be NULL. If no document, use nsIFile::launch
|
2002-01-07 14:31:44 +00:00
|
|
|
* @param aLaunchInBackground TRUE if the application should not come to the front.
|
|
|
|
*
|
|
|
|
*/
|
2012-06-06 02:08:30 +00:00
|
|
|
void launchWithDoc(in nsIFile aDocToLoad, in boolean aLaunchInBackground);
|
2002-01-07 14:31:44 +00: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 02:08:30 +00:00
|
|
|
void openDocWithApp(in nsIFile aAppToOpenWith, in boolean aLaunchInBackground);
|
2002-01-07 14:31:44 +00:00
|
|
|
|
2002-01-30 23:53:12 +00:00
|
|
|
/**
|
|
|
|
* isPackage
|
|
|
|
*
|
|
|
|
* returns true if a directory is determined to be a package under Mac OS 9/X
|
|
|
|
*
|
|
|
|
*/
|
2006-06-27 22:38:55 +00: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 20:17:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* bundleIdentifier
|
|
|
|
*
|
|
|
|
* returns the identifier of the bundle
|
|
|
|
*/
|
|
|
|
readonly attribute AUTF8String bundleIdentifier;
|
2012-04-10 15:56:49 +00: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 15:56:38 +00:00
|
|
|
readonly attribute int64_t bundleContentsLastModifiedTime;
|
2002-01-07 14:31:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2002-04-29 06:22:55 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-09-29 06:19:26 +00: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 06:22:55 +00:00
|
|
|
}
|
2002-01-07 14:31:44 +00:00
|
|
|
%}
|