Struct xpcom::interfaces::nsIMIMEInfo
[−]
[src]
#[repr(C)]pub struct nsIMIMEInfo { /* fields omitted */ }
interface nsIMIMEInfo : nsIHandlerInfo
/**
* 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 nsIMIMEService
*/
Methods
impl nsIMIMEInfo
[src]
pub fn coerce<T: nsIMIMEInfoCoerce>(&self) -> &T
[src]
Cast this nsIMIMEInfo
to one of its base interfaces.
impl nsIMIMEInfo
[src]
pub unsafe fn GetFileExtensions(
&self,
_retval: *mut *const nsIUTF8StringEnumerator
) -> nsresult
[src]
&self,
_retval: *mut *const nsIUTF8StringEnumerator
) -> nsresult
/**
* Gives you an array of file types associated with this type.
*
* @return Number of elements in the array.
* @return Array of extensions.
*/
nsIUTF8StringEnumerator getFileExtensions ();
pub unsafe fn SetFileExtensions(&self, aExtensions: &nsACString) -> nsresult
[src]
/**
* Set File Extensions. Input is a comma delimited list of extensions.
*/
void setFileExtensions (in AUTF8String aExtensions);
pub unsafe fn ExtensionExists(
&self,
aExtension: &nsACString,
_retval: *mut bool
) -> nsresult
[src]
&self,
aExtension: &nsACString,
_retval: *mut bool
) -> nsresult
/**
* Returns whether or not the given extension is
* associated with this MIME info.
*
* @return TRUE if the association exists.
*/
boolean extensionExists (in AUTF8String aExtension);
pub unsafe fn AppendExtension(&self, aExtension: &nsACString) -> nsresult
[src]
/**
* Append a given extension to the set of extensions
*/
void appendExtension (in AUTF8String aExtension);
pub unsafe fn GetPrimaryExtension(
&self,
aPrimaryExtension: &mut nsACString
) -> nsresult
[src]
&self,
aPrimaryExtension: &mut nsACString
) -> nsresult
/**
* Returns the first extension association in
* the internal set of extensions.
*
* @return The first extension.
*/
attribute AUTF8String primaryExtension;
pub unsafe fn SetPrimaryExtension(
&self,
aPrimaryExtension: &nsACString
) -> nsresult
[src]
&self,
aPrimaryExtension: &nsACString
) -> nsresult
/**
* Returns the first extension association in
* the internal set of extensions.
*
* @return The first extension.
*/
attribute AUTF8String primaryExtension;
pub unsafe fn GetMIMEType(&self, aMIMEType: &mut nsACString) -> nsresult
[src]
/**
* The MIME type of this MIMEInfo.
*
* @return String representing the MIME type.
*
* @deprecated use nsIHandlerInfo::type instead.
*/
readonly attribute ACString MIMEType;
pub unsafe fn Equals(
&self,
aMIMEInfo: *const nsIMIMEInfo,
_retval: *mut bool
) -> nsresult
[src]
&self,
aMIMEInfo: *const nsIMIMEInfo,
_retval: *mut bool
) -> nsresult
/**
* Returns whether or not these two nsIMIMEInfos are logically
* equivalent.
*
* @returns PR_TRUE if the two are considered equal
*/
boolean equals (in nsIMIMEInfo aMIMEInfo);
pub unsafe fn GetPossibleLocalHandlers(
&self,
aPossibleLocalHandlers: *mut *const nsIArray
) -> nsresult
[src]
&self,
aPossibleLocalHandlers: *mut *const nsIArray
) -> nsresult
/**
* 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.
*
* @return nsIArray of nsILocalHandlerApp
*/
readonly attribute nsIArray possibleLocalHandlers;
pub unsafe fn LaunchWithFile(&self, aFile: *const nsIFile) -> nsresult
[src]
/**
* 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);
Methods from Deref<Target = nsIHandlerInfo>
pub fn coerce<T: nsIHandlerInfoCoerce>(&self) -> &T
[src]
Cast this nsIHandlerInfo
to one of its base interfaces.
pub const saveToDisk: i64
pub const alwaysAsk: i64
pub const useHelperApp: i64
pub const handleInternally: i64
pub const useSystemDefault: i64
pub unsafe fn GetType(&self, aType: &mut nsACString) -> nsresult
[src]
/**
* The type of this handler info. For MIME handlers, this is the MIME type.
* For protocol handlers, it's the scheme.
*
* @return String representing the type.
*/
readonly attribute ACString type;
pub unsafe fn GetDescription(&self, aDescription: &mut nsAString) -> nsresult
[src]
/**
* A human readable description of the handler type
*/
attribute AString description;
pub unsafe fn SetDescription(&self, aDescription: &nsAString) -> nsresult
[src]
/**
* A human readable description of the handler type
*/
attribute AString description;
pub unsafe fn GetPreferredApplicationHandler(
&self,
aPreferredApplicationHandler: *mut *const nsIHandlerApp
) -> nsresult
[src]
&self,
aPreferredApplicationHandler: *mut *const nsIHandlerApp
) -> nsresult
/**
* The application the user has said they want associated with this content
* type. This is not always guaranteed to be set!!
*/
attribute nsIHandlerApp preferredApplicationHandler;
pub unsafe fn SetPreferredApplicationHandler(
&self,
aPreferredApplicationHandler: *const nsIHandlerApp
) -> nsresult
[src]
&self,
aPreferredApplicationHandler: *const nsIHandlerApp
) -> nsresult
/**
* The application the user has said they want associated with this content
* type. This is not always guaranteed to be set!!
*/
attribute nsIHandlerApp preferredApplicationHandler;
pub unsafe fn GetPossibleApplicationHandlers(
&self,
aPossibleApplicationHandlers: *mut *const nsIMutableArray
) -> nsresult
[src]
&self,
aPossibleApplicationHandlers: *mut *const nsIMutableArray
) -> nsresult
/**
* Applications that can handle this content type.
*
* The list will include the preferred handler, if any. Elements of this
* array are nsIHandlerApp objects, and this attribute will always reference
* an array, whether or not there are any possible handlers. If there are
* no possible handlers, the array will contain no elements, so just check
* its length (nsIArray::length) to see if there are any possible handlers.
*/
readonly attribute nsIMutableArray possibleApplicationHandlers;
pub unsafe fn GetHasDefaultHandler(
&self,
aHasDefaultHandler: *mut bool
) -> nsresult
[src]
&self,
aHasDefaultHandler: *mut bool
) -> nsresult
/**
* Indicates whether a default application handler exists,
* i.e. whether launchWithFile with action = useSystemDefault is possible
* and defaultDescription will contain usable information.
*/
readonly attribute boolean hasDefaultHandler;
pub unsafe fn GetDefaultDescription(
&self,
aDefaultDescription: &mut nsAString
) -> nsresult
[src]
&self,
aDefaultDescription: &mut nsAString
) -> nsresult
/**
* A pretty name description of the associated default application. Only
* usable if hasDefaultHandler is true.
*/
readonly attribute AString defaultDescription;
pub unsafe fn LaunchWithURI(
&self,
aURI: *const nsIURI,
aWindowContext: *const nsIInterfaceRequestor
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
aWindowContext: *const nsIInterfaceRequestor
) -> nsresult
/**
* Launches the application with the specified URI, in a way that
* depends on the value of preferredAction. preferredAction must be
* useHelperApp or useSystemDefault.
*
* @note Only the URI scheme is used to determine how to launch. This is
* essentially a pass-by-value operation. This means that in the case of
* a file: URI, the handler that is registered for file: will be launched
* and our code will not make any decision based on the content-type or
* extension, though the invoked file: handler is free to do so.
*
* @param aURI
* The URI to launch this application with
*
* @param aWindowContext
* The window to parent the dialog against, and, if a web handler
* is chosen, it is loaded in this window as well. See
* nsIHandlerApp.launchWithURI for more details.
*
* @throw NS_ERROR_INVALID_ARG if preferredAction is not valid for this
* call. Other exceptions may be thrown.
*/
void launchWithURI (in nsIURI aURI, [optional] in nsIInterfaceRequestor aWindowContext);
pub unsafe fn GetPreferredAction(
&self,
aPreferredAction: *mut nsHandlerInfoAction
) -> nsresult
[src]
&self,
aPreferredAction: *mut nsHandlerInfoAction
) -> nsresult
/**
* 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; possible value constants
* listed below
*/
attribute nsHandlerInfoAction preferredAction;
pub unsafe fn SetPreferredAction(
&self,
aPreferredAction: nsHandlerInfoAction
) -> nsresult
[src]
&self,
aPreferredAction: nsHandlerInfoAction
) -> nsresult
/**
* 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; possible value constants
* listed below
*/
attribute nsHandlerInfoAction preferredAction;
pub unsafe fn GetAlwaysAskBeforeHandling(
&self,
aAlwaysAskBeforeHandling: *mut bool
) -> nsresult
[src]
&self,
aAlwaysAskBeforeHandling: *mut bool
) -> nsresult
/**
* alwaysAskBeforeHandling: if true, we should always give the user a
* dialog asking how to dispose of this content.
*/
attribute boolean alwaysAskBeforeHandling;
pub unsafe fn SetAlwaysAskBeforeHandling(
&self,
aAlwaysAskBeforeHandling: bool
) -> nsresult
[src]
&self,
aAlwaysAskBeforeHandling: bool
) -> nsresult
/**
* alwaysAskBeforeHandling: if true, we should always give the user a
* dialog asking how to dispose of this content.
*/
attribute boolean alwaysAskBeforeHandling;
Trait Implementations
impl XpCom for nsIMIMEInfo
[src]
const IID: nsIID
IID: nsIID = nsID(471969007, 51105, 16582, [157, 64, 162, 4, 128, 238, 83, 161])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIMIMEInfo
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIMIMEInfo
[src]
type Target = nsIHandlerInfo
The resulting type after dereferencing.
fn deref(&self) -> &nsIHandlerInfo
[src]
Dereferences the value.