Linux Mac OSX Windows

  
[scriptable, uuid(1448b42f-cf0d-466e-9a15-64e876ebe857)]
interface nsIMIMEInfo : nsISupports

Constants


        
const long saveToDisk = 0

        
const long alwaysAsk = 1

        
const long useHelperApp = 2

        
const long handleInternally = 3

        
const long useSystemDefault = 4

Attributes

 alwaysAskBeforeHandling: if true, we should always give the user a
 dialog asking how to dispose of this content.
attribute boolean alwaysAskBeforeHandling
 A pretty name description of the preferred application.
attribute AString applicationDescription
 A pretty name description of the associated default application. Only
 usable if hasDefaultHandler is true.
readonly attribute AString defaultDescription
 A human readable description of the MIME info.

 @return The description
attribute AString description
 Indicates whether a default application handler exists,
 i.e. whether launchWithFile with action = useSystemDefault is possible
 and applicationDescription will contain usable information.
readonly attribute boolean hasDefaultHandler

        
attribute PRUint32 macCreator
 Mac Type and creator types
attribute PRUint32 macType
 The MIME type of this MIMEInfo.
 
 @return String representing the MIME type.
readonly attribute ACString MIMEType
 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.
attribute nsMIMEInfoHandleAction preferredAction
 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!!
attribute nsIFile preferredApplicationHandler
 Returns the first extension association in
 the internal set of extensions.

 @return The first extension.
attribute AUTF8String primaryExtension

Methods

 Append a given extension to the set of extensions
void appendExtension(in AUTF8String aExtension)
 Returns whether or not these two MIME infos are logically
 equivalent maintaining the one-to-many relationship between
 MIME types and file extensions.

 @returns TRUE if the two are considered equal
boolean equals(in nsIMIMEInfo aMIMEInfo)
 Returns whether or not the given extension is
 associated with this MIME info.

 @return TRUE if the association exists. 
boolean extensionExists(in AUTF8String aExtension)
 Gives you an array of file types associated with this type.

 @return Number of elements in the array.
 @return Array of extensions.
nsIUTF8StringEnumerator getFileExtensions()
 Launches the application with the specified file, in a way that
 depends on the value of preferredAction. preferredAction must be
 useHelperApp or useSystemDefault.

 @param aFile The file to launch this application with.

 @throw NS_ERROR_INVALID_ARG if action is not valid for this function.
 Other exceptions may be thrown.
void launchWithFile(in nsIFile aFile)
 Set File Extensions. Input is a comma delimited list of extensions.
void setFileExtensions(in AUTF8String aExtensions)