Public Member Functions | Public Attributes

nsIMIMEInfo Interface Reference

nsIMIMEInfo extends nsIHandlerInfo with a bunch of information specific to MIME content-types. More...

import "nsIMIMEInfo.idl";

Inheritance diagram for nsIMIMEInfo:
Collaboration diagram for nsIMIMEInfo:

List of all members.

Public Member Functions

nsIUTF8StringEnumerator getFileExtensions ()
 Gives you an array of file types associated with this type.
void setFileExtensions (in AUTF8String aExtensions)
 Set File Extensions.
boolean extensionExists (in AUTF8String aExtension)
 Returns whether or not the given extension is associated with this MIME info.
void appendExtension (in AUTF8String aExtension)
 Append a given extension to the set of extensions.
boolean equals (in nsIMIMEInfo aMIMEInfo)
 Returns whether or not these two nsIMIMEInfos are logically equivalent.
void launchWithFile (in nsIFile aFile)
 Launches the application with the specified file, in a way that depends on the value of preferredAction.

Public Attributes

attribute AUTF8String primaryExtension
 Returns the first extension association in the internal set of extensions.
readonly attribute ACString MIMEType
 The MIME type of this MIMEInfo.
readonly attribute nsIArray possibleLocalHandlers
 Returns a list of nsILocalHandlerApp objects containing handlers associated with this mimeinfo.

Detailed Description

nsIMIMEInfo extends nsIHandlerInfo with a bunch of information specific to MIME content-types.

There is a one-to-many relationship between MIME types and file extensions. This means that a MIMEInfo object may have multiple file extensions associated with it. However, the reverse is not true.

MIMEInfo objects are generally retrieved from the MIME Service

See also:
nsIMIMEService

Member Function Documentation

void nsIMIMEInfo::appendExtension ( in AUTF8String  aExtension  ) 

Append a given extension to the set of extensions.

boolean nsIMIMEInfo::equals ( in nsIMIMEInfo  aMIMEInfo  ) 

Returns whether or not these two nsIMIMEInfos are logically equivalent.

Returns:
PR_TRUE if the two are considered equal
boolean nsIMIMEInfo::extensionExists ( in AUTF8String  aExtension  ) 

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

Returns:
TRUE if the association exists.
nsIUTF8StringEnumerator nsIMIMEInfo::getFileExtensions (  ) 

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

Returns:
Number of elements in the array.
Array of extensions.
void nsIMIMEInfo::launchWithFile ( in nsIFile  aFile  ) 

Launches the application with the specified file, in a way that depends on the value of preferredAction.

preferredAction must be useHelperApp or useSystemDefault.

Parameters:
aFile The file to launch this application with.
Exceptions:
NS_ERROR_INVALID_ARG if action is not valid for this function. Other exceptions may be thrown.
void nsIMIMEInfo::setFileExtensions ( in AUTF8String  aExtensions  ) 

Set File Extensions.

Input is a comma delimited list of extensions.


Member Data Documentation

readonly attribute ACString nsIMIMEInfo::MIMEType

The MIME type of this MIMEInfo.

Returns:
String representing the MIME type.
Deprecated:
use nsIHandlerInfo::type instead.

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.

Returns:
nsIArray of nsILocalHandlerApp
attribute AUTF8String nsIMIMEInfo::primaryExtension

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

Returns:
The first extension.

The documentation for this interface was generated from the following file: