nsILocalFileMac 编辑

xpcom/io/nsILocalFileMac.idlScriptable Please add a summary to this article. Inherits from: nsILocalFile Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

CFURLRef getCFURL(); Native code only!
FSRef getFSRef(); Native code only!
FSSpec getFSSpec(); Native code only!
void initToAppWithCreatorCode(in OSType aAppCreator); Native code only! Obsolete since Gecko 2.0
void initWithCFURL(in CFURLRef aCFURL); Native code only!
void initWithFSRef([const] in FSRefPtr aFSRef); Native code only!
void initWithFSSpec([const] in FSSpecPtr aFileSpec); Native code only! Obsolete since Gecko 1.9.2
boolean isPackage();
void launchWithDoc(in nsILocalFile aDocToLoad, in boolean aLaunchInBackground);
void openDocWithApp(in nsILocalFile aAppToOpenWith, in boolean aLaunchInBackground);
void setFileTypeAndCreatorFromExtension(in string aExtension); Obsolete since Gecko 1.9.2
void setFileTypeAndCreatorFromMIMEType(in string aMIMEType); Obsolete since Gecko 1.9.2

Attributes

AttributeTypeDescription
bundleDisplayNameAStringReturns the display name of the application bundle (usually the human readable name of the application) Read only.
bundleIdentifierAUTF8StringReturns the identifier of the bundle. Read only.
fileCreatorOSTypeNative code only!
fileSizeWithResForkPRInt64Returns 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() Read only.
fileTypeOSTypeFile type and creator attributes. Native code only!

Constants

ConstantValueDescription
CURRENT_PROCESS_CREATOR0x8000000Use with SetFileType() to specify the signature of current process. Obsolete since Gecko 2.0

Methods

Native code only!

getCFURL

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. Note: Supported only for XP_MACOSX.
CFURLRef getCFURL();
Parameters

None.

Return value

The CFURLRef of the file object. The caller is responsible for calling CFRelease() on it.

Native code only!

getFSRef

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. Note: Supported only for XP_MACOSX.
FSRef getFSRef();
Parameters

None.

Return value

The FSRef of the file object.

Native code only!

getFSSpec

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.
FSSpec getFSSpec();
Parameters

None.

Return value

The FSSpec of the file object.

Native code only!

initToAppWithCreatorCode

Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Init this object to point to an application having the given creator code. If this app is missing, this will fail. It will first look for running application with the given creator.

void initToAppWithCreatorCode(
  in OSType aAppCreator
);
Parameters
aAppCreator
The signature of the app.
Native code only!

initWithCFURL

Init this object with a CFURLRef.

Note: Supported only for XP_MACOSX. Note: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand.
void initWithCFURL(
  in CFURLRef aCFURL
);
Parameters
aCFURL
The CoreFoundation URL.
Native code only!

initWithFSRef

Init this object with an FSRef.

Note: Supported only for XP_MACOSX.
void initWithFSRef(
  [const] in FSRefPtr aFSRef
);
Parameters
aFSRef
The native FSRef.
Native code only!

initWithFSSpec

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Init this object with an FSSpec Legacy method - leaving in place for now.

void initWithFSSpec(
  [const] in FSSpecPtr aFileSpec
);
Parameters
aFileSpec
The native file spec.

isPackage()

boolean isPackage();
Parameters

None.

Return value

true if a directory is determined to be a package under Mac OS 9/X.

launchWithDoc()

Launch the application that this file points to with a document.

void launchWithDoc(
  in nsILocalFile aDocToLoad,
  in boolean aLaunchInBackground
);
Parameters
aDocToLoad
Must not be null. If no document, use nsILocalFile::launch.
aLaunchInBackground
true if the application should not come to the front.

openDocWithApp()

Open the document that this file points to with the given application.

void openDocWithApp(
  in nsILocalFile aAppToOpenWith,
  in boolean aLaunchInBackground
);
Parameters
aAppToOpenWith
The application with which to open the document. If null, the creator code of the document is used to determine the application.
aLaunchInBackground
true if the application should not come to the front.

setFileTypeAndCreatorFromExtension()

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

Sets the file type and creator code from a file extension Internet Config is used to determine the mapping.

void setFileTypeAndCreatorFromExtension(
  in string aExtension
);
Parameters
aExtension

setFileTypeAndCreatorFromMIMEType()

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

Sets the file type and creator code from a MIME type. Internet Config is used to determine the mapping.

void setFileTypeAndCreatorFromMIMEType(
  in string aMIMEType
);
Parameters
aMIMEType

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:112 次

字数:10834

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文