Struct xpcom::interfaces::nsIURIContentListener
[−]
[src]
#[repr(C)]pub struct nsIURIContentListener { /* fields omitted */ }
interface nsIURIContentListener : nsISupports
/**
* nsIURIContentListener is an interface used by components which
* want to know (and have a chance to handle) a particular content type.
* Typical usage scenarios will include running applications which register
* a nsIURIContentListener for each of its content windows with the uri
* dispatcher service.
*/
Methods
impl nsIURIContentListener
[src]
pub fn coerce<T: nsIURIContentListenerCoerce>(&self) -> &T
[src]
Cast this nsIURIContentListener
to one of its base interfaces.
impl nsIURIContentListener
[src]
pub unsafe fn OnStartURIOpen(
&self,
aURI: *const nsIURI,
_retval: *mut bool
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
_retval: *mut bool
) -> nsresult
/**
* Gives the original content listener first crack at stopping a load before
* it happens.
*
* @param aURI URI that is being opened.
*
* @return <code>false</code> if the load can continue;
* <code>true</code> if the open should be aborted.
*/
boolean onStartURIOpen (in nsIURI aURI);
pub unsafe fn DoContent(
&self,
aContentType: &nsACString,
aIsContentPreferred: bool,
aRequest: *const nsIRequest,
aContentHandler: *mut *const nsIStreamListener,
_retval: *mut bool
) -> nsresult
[src]
&self,
aContentType: &nsACString,
aIsContentPreferred: bool,
aRequest: *const nsIRequest,
aContentHandler: *mut *const nsIStreamListener,
_retval: *mut bool
) -> nsresult
/**
* Notifies the content listener to hook up an nsIStreamListener capable of
* consuming the data stream.
*
* @param aContentType Content type of the data.
* @param aIsContentPreferred Indicates whether the content should be
* preferred by this listener.
* @param aRequest Request that is providing the data.
* @param aContentHandler nsIStreamListener that will consume the data.
* This should be set to <code>nullptr</code> if
* this content listener can't handle the content
* type; in this case, doContent should also fail
* (i.e., return failure nsresult).
*
* @return <code>true</code> if the load should
* be aborted and consumer wants to
* handle the load completely by itself. This
* causes the URI Loader do nothing else...
* <code>false</code> if the URI Loader should
* continue handling the load and call the
* returned streamlistener's methods.
*/
boolean doContent (in ACString aContentType, in boolean aIsContentPreferred, in nsIRequest aRequest, out nsIStreamListener aContentHandler);
pub unsafe fn IsPreferred(
&self,
aContentType: *const c_char,
aDesiredContentType: *mut *const c_char,
_retval: *mut bool
) -> nsresult
[src]
&self,
aContentType: *const c_char,
aDesiredContentType: *mut *const c_char,
_retval: *mut bool
) -> nsresult
/**
* When given a uri to dispatch, if the URI is specified as 'preferred
* content' then the uri loader tries to find a preferred content handler
* for the content type. The thought is that many content listeners may
* be able to handle the same content type if they have to. i.e. the mail
* content window can handle text/html just like a browser window content
* listener. However, if the user clicks on a link with text/html content,
* then the browser window should handle that content and not the mail
* window where the user may have clicked the link. This is the difference
* between isPreferred and canHandleContent.
*
* @param aContentType Content type of the data.
* @param aDesiredContentType Indicates that aContentType must be converted
* to aDesiredContentType before processing the
* data. This causes a stream converted to be
* inserted into the nsIStreamListener chain.
* This argument can be <code>nullptr</code> if
* the content should be consumed directly as
* aContentType.
*
* @return <code>true</code> if this is a preferred
* content handler for aContentType;
* <code>false<code> otherwise.
*/
boolean isPreferred (in string aContentType, out string aDesiredContentType);
pub unsafe fn CanHandleContent(
&self,
aContentType: *const c_char,
aIsContentPreferred: bool,
aDesiredContentType: *mut *const c_char,
_retval: *mut bool
) -> nsresult
[src]
&self,
aContentType: *const c_char,
aIsContentPreferred: bool,
aDesiredContentType: *mut *const c_char,
_retval: *mut bool
) -> nsresult
/**
* When given a uri to dispatch, if the URI is not specified as 'preferred
* content' then the uri loader calls canHandleContent to see if the content
* listener is capable of handling the content.
*
* @param aContentType Content type of the data.
* @param aIsContentPreferred Indicates whether the content should be
* preferred by this listener.
* @param aDesiredContentType Indicates that aContentType must be converted
* to aDesiredContentType before processing the
* data. This causes a stream converted to be
* inserted into the nsIStreamListener chain.
* This argument can be <code>nullptr</code> if
* the content should be consumed directly as
* aContentType.
*
* @return <code>true</code> if the data can be consumed.
* <code>false</code> otherwise.
*
* Note: I really envision canHandleContent as a method implemented
* by the docshell as the implementation is generic to all doc
* shells. The isPreferred decision is a decision made by a top level
* application content listener that sits at the top of the docshell
* hierarchy.
*/
boolean canHandleContent (in string aContentType, in boolean aIsContentPreferred, out string aDesiredContentType);
pub unsafe fn GetLoadCookie(
&self,
aLoadCookie: *mut *const nsISupports
) -> nsresult
[src]
&self,
aLoadCookie: *mut *const nsISupports
) -> nsresult
/**
* The load context associated with a particular content listener.
* The URI Loader stores and accesses this value as needed.
*/
attribute nsISupports loadCookie;
pub unsafe fn SetLoadCookie(&self, aLoadCookie: *const nsISupports) -> nsresult
[src]
/**
* The load context associated with a particular content listener.
* The URI Loader stores and accesses this value as needed.
*/
attribute nsISupports loadCookie;
pub unsafe fn GetParentContentListener(
&self,
aParentContentListener: *mut *const nsIURIContentListener
) -> nsresult
[src]
&self,
aParentContentListener: *mut *const nsIURIContentListener
) -> nsresult
/**
* The parent content listener if this particular listener is part of a chain
* of content listeners (i.e. a docshell!)
*
* @note If this attribute is set to an object that implements
* nsISupportsWeakReference, the implementation should get the
* nsIWeakReference and hold that. Otherwise, the implementation
* should not refcount this interface; it should assume that a non
* null value is always valid. In that case, the caller is
* responsible for explicitly setting this value back to null if the
* parent content listener is destroyed.
*/
attribute nsIURIContentListener parentContentListener;
pub unsafe fn SetParentContentListener(
&self,
aParentContentListener: *const nsIURIContentListener
) -> nsresult
[src]
&self,
aParentContentListener: *const nsIURIContentListener
) -> nsresult
/**
* The parent content listener if this particular listener is part of a chain
* of content listeners (i.e. a docshell!)
*
* @note If this attribute is set to an object that implements
* nsISupportsWeakReference, the implementation should get the
* nsIWeakReference and hold that. Otherwise, the implementation
* should not refcount this interface; it should assume that a non
* null value is always valid. In that case, the caller is
* responsible for explicitly setting this value back to null if the
* parent content listener is destroyed.
*/
attribute nsIURIContentListener parentContentListener;
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIURIContentListener
[src]
const IID: nsIID
IID: nsIID = nsID(279088952, 13032, 19555, [138, 161, 18, 234, 174, 188, 54, 154])
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 nsIURIContentListener
[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 nsIURIContentListener
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.