1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/io/nsILocalFileMac.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,179 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsILocalFile.idl" 1.10 + 1.11 +%{C++ 1.12 +#include <Carbon/Carbon.h> 1.13 +#include <CoreFoundation/CoreFoundation.h> 1.14 +%} 1.15 + 1.16 + native OSType(OSType); 1.17 + native FSSpec(FSSpec); 1.18 + native FSRef(FSRef); 1.19 +[ptr] native FSRefPtr(FSRef); 1.20 + native CFURLRef(CFURLRef); 1.21 + 1.22 +[scriptable, builtinclass, uuid(E5DE2CC9-BF06-4329-8F91-5D2D45284500)] 1.23 +interface nsILocalFileMac : nsILocalFile 1.24 +{ 1.25 + /** 1.26 + * initWithCFURL 1.27 + * 1.28 + * Init this object with a CFURLRef 1.29 + * 1.30 + * NOTE: Supported only for XP_MACOSX 1.31 + * NOTE: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand. 1.32 + * 1.33 + * @param aCFURL the CoreFoundation URL 1.34 + * 1.35 + */ 1.36 + [noscript] void initWithCFURL(in CFURLRef aCFURL); 1.37 + 1.38 + /** 1.39 + * initWithFSRef 1.40 + * 1.41 + * Init this object with an FSRef 1.42 + * 1.43 + * NOTE: Supported only for XP_MACOSX 1.44 + * 1.45 + * @param aFSRef the native FSRef 1.46 + * 1.47 + */ 1.48 + [noscript] void initWithFSRef([const] in FSRefPtr aFSRef); 1.49 + 1.50 + /** 1.51 + * getCFURL 1.52 + * 1.53 + * Returns the CFURLRef of the file object. The caller is 1.54 + * responsible for calling CFRelease() on it. 1.55 + * 1.56 + * NOTE: Observes the state of the followLinks attribute. 1.57 + * If the file object is an alias and followLinks is TRUE, returns 1.58 + * the target of the alias. If followLinks is FALSE, returns 1.59 + * the unresolved alias file. 1.60 + * 1.61 + * NOTE: Supported only for XP_MACOSX 1.62 + * 1.63 + * @return 1.64 + * 1.65 + */ 1.66 + [noscript] CFURLRef getCFURL(); 1.67 + 1.68 + /** 1.69 + * getFSRef 1.70 + * 1.71 + * Returns the FSRef of the file object. 1.72 + * 1.73 + * NOTE: Observes the state of the followLinks attribute. 1.74 + * If the file object is an alias and followLinks is TRUE, returns 1.75 + * the target of the alias. If followLinks is FALSE, returns 1.76 + * the unresolved alias file. 1.77 + * 1.78 + * NOTE: Supported only for XP_MACOSX 1.79 + * 1.80 + * @return 1.81 + * 1.82 + */ 1.83 + [noscript] FSRef getFSRef(); 1.84 + 1.85 + /** 1.86 + * getFSSpec 1.87 + * 1.88 + * Returns the FSSpec of the file object. 1.89 + * 1.90 + * NOTE: Observes the state of the followLinks attribute. 1.91 + * If the file object is an alias and followLinks is TRUE, returns 1.92 + * the target of the alias. If followLinks is FALSE, returns 1.93 + * the unresolved alias file. 1.94 + * 1.95 + * @return 1.96 + * 1.97 + */ 1.98 + [noscript] FSSpec getFSSpec(); 1.99 + 1.100 + /** 1.101 + * fileSizeWithResFork 1.102 + * 1.103 + * Returns the combined size of both the data fork and the resource 1.104 + * fork (if present) rather than just the size of the data fork 1.105 + * as returned by GetFileSize() 1.106 + * 1.107 + */ 1.108 + readonly attribute int64_t fileSizeWithResFork; 1.109 + 1.110 + /** 1.111 + * fileType, creator 1.112 + * 1.113 + * File type and creator attributes 1.114 + * 1.115 + */ 1.116 + [noscript] attribute OSType fileType; 1.117 + [noscript] attribute OSType fileCreator; 1.118 + 1.119 + /** 1.120 + * launchWithDoc 1.121 + * 1.122 + * Launch the application that this file points to with a document. 1.123 + * 1.124 + * @param aDocToLoad Must not be NULL. If no document, use nsIFile::launch 1.125 + * @param aLaunchInBackground TRUE if the application should not come to the front. 1.126 + * 1.127 + */ 1.128 + void launchWithDoc(in nsIFile aDocToLoad, in boolean aLaunchInBackground); 1.129 + 1.130 + /** 1.131 + * openDocWithApp 1.132 + * 1.133 + * Open the document that this file points to with the given application. 1.134 + * 1.135 + * @param aAppToOpenWith The application with which to open the document. 1.136 + * If NULL, the creator code of the document is used 1.137 + * to determine the application. 1.138 + * @param aLaunchInBackground TRUE if the application should not come to the front. 1.139 + * 1.140 + */ 1.141 + void openDocWithApp(in nsIFile aAppToOpenWith, in boolean aLaunchInBackground); 1.142 + 1.143 + /** 1.144 + * isPackage 1.145 + * 1.146 + * returns true if a directory is determined to be a package under Mac OS 9/X 1.147 + * 1.148 + */ 1.149 + boolean isPackage(); 1.150 + 1.151 + /** 1.152 + * bundleDisplayName 1.153 + * 1.154 + * returns the display name of the application bundle (usually the human 1.155 + * readable name of the application) 1.156 + */ 1.157 + readonly attribute AString bundleDisplayName; 1.158 + 1.159 + /** 1.160 + * bundleIdentifier 1.161 + * 1.162 + * returns the identifier of the bundle 1.163 + */ 1.164 + readonly attribute AUTF8String bundleIdentifier; 1.165 + 1.166 + /** 1.167 + * Last modified time of a bundle's contents (as opposed to its package 1.168 + * directory). Our convention is to make the bundle's Info.plist file 1.169 + * stand in for the rest of its contents -- since this file contains the 1.170 + * bundle's version information and other identifiers. For non-bundles 1.171 + * this is the same as lastModifiedTime. 1.172 + */ 1.173 + readonly attribute int64_t bundleContentsLastModifiedTime; 1.174 +}; 1.175 + 1.176 +%{C++ 1.177 +extern "C" 1.178 +{ 1.179 +NS_EXPORT nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, bool aFollowSymlinks, nsILocalFileMac** result); 1.180 +NS_EXPORT nsresult NS_NewLocalFileWithCFURL(const CFURLRef aURL, bool aFollowSymlinks, nsILocalFileMac** result); 1.181 +} 1.182 +%}