Inherits From:nsISupports

This interface is implemented by the following components:


PRInt32 saveToDisk = 0
PRInt32 alwaysAsk = 1
PRInt32 useHelperApp = 2
PRInt32 handleInternally = 3
PRInt32 useSystemDefault = 4


PRBool alwaysAskBeforeHandling

AlwaysAskBeforeHandling: if true, we should always give the user a dialog asking how to dispose of this content.

PRUnichar* applicationDescription

A pretty name description of the preferred application.

readonly PRUnichar* defaultDescription

A pretty name description of the associated default application. Only usable if hasDefaultHandler is true.

PRUnichar* Description

A human readable description of the MIME info.

readonly PRBool hasDefaultHandler

Indicates whether a default application handler exists, i.e. whether launchWithFile with action = useSystemDefault is possible and applicationDescription will contain usable information.

PRUint32 MacCreator

PRUint32 MacType

Mac Type and creator types

char* MIMEType

The MIME type of this MIMEInfo.

nsMIMEInfoHandleAction preferredAction

PreferredAction is how the user specified they would like to handle this content type: save to disk, use specified helper app, use OS default handler or handle using navigator.

nsIFile preferredApplicationHandler

Returns a nsIFile that points to the application the user has said they want associated with this content type. This is not always guaranteed to be set!!

char* primaryExtension

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


void AppendExtension ( char* extension ) PRBool Equals ( nsIMIMEInfo MIMEInfo ) PRBool ExtensionExists ( char* extension ) nsIUTF8StringEnumerator getFileExtensions ( ) void launchWithFile ( nsIFile file ) void SetFileExtensions ( char* extensions )

void AppendExtension ( char* extension )

Append a given extension to the set of extensions


PRBool Equals ( nsIMIMEInfo MIMEInfo )

Returns whether or not these two MIME infos are logically equivalent maintaining the one-to-many relationship between MIME types and file extensions.


PRBool ExtensionExists ( char* extension )

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

TRUE if the association exists.

nsIUTF8StringEnumerator getFileExtensions ( )

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

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.

file: The file to launch this application with.

void SetFileExtensions ( char* extensions )

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



This interface is the type of the following properties:

nsIDownload.MIMEInfo, nsIHelperAppLauncher.MIMEInfo

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

nsIDownload.init, nsIDownloadManager.addDownload, nsIMIMEInfo.Equals

This interface is returned from the following methods:


Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com