WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIMIMEInfo

IID:cd7083f8-5fe9-4248-bb09-0b0e2982fde8
Inherits From:nsIHandlerInfo

This interface is implemented by the following components:


Properties

PRUint32 macCreator

PRUint32 macType

Mac Type and creator types

readonly ACString MIMEType

The MIME type of this MIMEInfo.

readonly nsIArray possibleLocalHandlers

Returns a list of nsILocalHandlerApp objects containing handlers associated with this mimeinfo. Implemented per platform using information in this object to generate the best list. Typically used for an "open with" style user option.

AUTF8String primaryExtension

Returns the first extension association in the internal set of extensions.


Methods

void appendExtension ( AUTF8String extension ) PRBool equals ( nsIMIMEInfo MIMEInfo ) PRBool extensionExists ( AUTF8String extension ) nsIUTF8StringEnumerator getFileExtensions ( ) void launchWithFile ( nsIFile file ) void setFileExtensions ( AUTF8String extensions )

void appendExtension ( AUTF8String extension )

Append a given extension to the set of extensions

Arguments:
extension

PRBool equals ( nsIMIMEInfo MIMEInfo )

Returns whether or not these two nsIMIMEInfos are logically equivalent.

Arguments:
MIMEInfo

PRBool extensionExists ( AUTF8String extension )

Returns whether or not the given extension is associated with this MIME info.

Arguments:
extension
Returns:
TRUE if the association exists.

nsIUTF8StringEnumerator getFileExtensions ( )

Gives you an array of file types associated with this type.

Returns:
Array of extensions.

void launchWithFile ( nsIFile file )

Launches the application with the specified file, in a way that depends on the value of preferredAction. preferredAction must be useHelperApp or useSystemDefault.

Arguments:
file: The file to launch this application with.

void setFileExtensions ( AUTF8String extensions )

Set File Extensions. Input is a comma delimited list of extensions.

Arguments:
extensions

References

This interface is the type of the following properties:

nsIDownload.MIMEInfo, nsIHelperAppLauncher.MIMEInfo

This interface is passed as an argument to the following methods:

nsIDownloadManager.addDownload, nsIInternetConfigService.fillInMIMEInfo, nsIInternetConfigService.getMIMEInfoFromExtension, nsIInternetConfigService.getMIMEInfoFromTypeCreator, nsIMIMEInfo.equals, nsITransfer.init

This interface is returned from the following methods:

nsIMIMEService.getFromTypeAndExtension

Reference documentation is generated from Mozilla's source.