Struct xpcom::interfaces::nsITransferable
[−]
[src]
#[repr(C)]pub struct nsITransferable { /* fields omitted */ }
interface nsITransferable : nsISupports
/**
* nsIFlavorDataProvider allows a flavor to 'promise' data later,
* supplying the data lazily.
*
* To use it, call setTransferData, passing the flavor string,
* a nsIFlavorDataProvider QI'd to nsISupports, and a data size of 0.
*
* When someone calls getTransferData later, if the data size is
* stored as 0, the nsISupports will be QI'd to nsIFlavorDataProvider,
* and its getFlavorData called.
*
*/
Methods
impl nsITransferable
[src]
pub fn coerce<T: nsITransferableCoerce>(&self) -> &T
[src]
Cast this nsITransferable
to one of its base interfaces.
impl nsITransferable
[src]
pub const kFlavorHasDataProvider: i64
kFlavorHasDataProvider: i64 = 0
pub unsafe fn Init(&self, aContext: *const nsILoadContext) -> nsresult
[src]
/**
* Initializes a transferable object. This should be called on all
* transferable objects. Failure to do so will result in fatal assertions in
* debug builds.
*
* The load context is used to track whether the transferable is storing privacy-
* sensitive information. For example, we try to delete data that you copy
* to the clipboard when you close a Private Browsing window.
*
* To get the appropriate load context in Javascript callers, one needs to get
* to the document that the transferable corresponds to, and then get the load
* context from the document like this:
*
* var loadContext = doc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
* .getInterface(Ci.nsIWebNavigation)
* .QueryInterface(Ci.nsILoadContext);
*
* In C++ callers, if you have the corresponding document, you can just call
* nsIDocument::GetLoadContext to get to the load context object.
*
* @param aContext the load context associated with the transferable object.
* This can be set to null if a load context is not available.
*/
void init (in nsILoadContext aContext);
pub unsafe fn FlavorsTransferableCanExport(
&self,
_retval: *mut *const nsIArray
) -> nsresult
[src]
&self,
_retval: *mut *const nsIArray
) -> nsresult
/**
* Computes a list of flavors (mime types as nsISupportsCString) that the transferable
* can export, either through intrinsic knowledge or output data converters.
*
* @param aDataFlavorList fills list with supported flavors. This is a copy of
* the internal list, so it may be edited w/out affecting the transferable.
*/
nsIArray flavorsTransferableCanExport ();
pub unsafe fn GetTransferData(
&self,
aFlavor: *const c_char,
aData: *mut *const nsISupports,
aDataLen: *mut uint32_t
) -> nsresult
[src]
&self,
aFlavor: *const c_char,
aData: *mut *const nsISupports,
aDataLen: *mut uint32_t
) -> nsresult
/**
* Given a flavor retrieve the data.
*
* @param aFlavor (in parameter) the flavor of data to retrieve
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
* @param aDataLen the length of the data
*/
void getTransferData (in string aFlavor, out nsISupports aData, out unsigned long aDataLen);
pub unsafe fn GetAnyTransferData(
&self,
aFlavor: &mut nsACString,
aData: *mut *const nsISupports,
aDataLen: *mut uint32_t
) -> nsresult
[src]
&self,
aFlavor: &mut nsACString,
aData: *mut *const nsISupports,
aDataLen: *mut uint32_t
) -> nsresult
/**
* Returns the best flavor in the transferable, given those that have
* been added to it with |AddFlavor()|
*
* @param aFlavor (out parameter) the flavor of data that was retrieved
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
* @param aDataLen the length of the data
*/
void getAnyTransferData (out ACString aFlavor, out nsISupports aData, out unsigned long aDataLen);
pub unsafe fn IsLargeDataSet(&self, _retval: *mut bool) -> nsresult
[src]
/**
* Returns true if the data is large.
*/
boolean isLargeDataSet ();
pub unsafe fn FlavorsTransferableCanImport(
&self,
_retval: *mut *const nsIArray
) -> nsresult
[src]
&self,
_retval: *mut *const nsIArray
) -> nsresult
/**
* Computes a list of flavors (mime types as nsISupportsCString) that the transferable can
* accept into it, either through intrinsic knowledge or input data converters.
*
* @param outFlavorList fills list with supported flavors. This is a copy of
* the internal list, so it may be edited w/out affecting the transferable.
*/
nsIArray flavorsTransferableCanImport ();
pub unsafe fn SetTransferData(
&self,
aFlavor: *const c_char,
aData: *const nsISupports,
aDataLen: uint32_t
) -> nsresult
[src]
&self,
aFlavor: *const c_char,
aData: *const nsISupports,
aDataLen: uint32_t
) -> nsresult
/**
* Sets the data in the transferable with the specified flavor. The transferable
* will maintain its own copy the data, so it is not necessary to do that beforehand.
*
* @param aFlavor the flavor of data that is being set
* @param aData the data, either some variant of class in nsISupportsPrimitives.idl,
* an nsIFile, or an nsIFlavorDataProvider (see above)
* @param aDataLen the length of the data, or 0 if passing a nsIFlavorDataProvider
*/
void setTransferData (in string aFlavor, in nsISupports aData, in unsigned long aDataLen);
pub unsafe fn AddDataFlavor(&self, aDataFlavor: *const c_char) -> nsresult
[src]
/**
* Add the data flavor, indicating that this transferable
* can receive this type of flavor
*
* @param aDataFlavor a new data flavor to handle
*/
void addDataFlavor (in string aDataFlavor);
pub unsafe fn RemoveDataFlavor(&self, aDataFlavor: *const c_char) -> nsresult
[src]
/**
* Removes the data flavor matching the given one (string compare) and the data
* that goes along with it.
*
* @param aDataFlavor a data flavor to remove
*/
void removeDataFlavor (in string aDataFlavor);
pub unsafe fn GetConverter(
&self,
aConverter: *mut *const nsIFormatConverter
) -> nsresult
[src]
&self,
aConverter: *mut *const nsIFormatConverter
) -> nsresult
attribute nsIFormatConverter converter;
pub unsafe fn SetConverter(
&self,
aConverter: *const nsIFormatConverter
) -> nsresult
[src]
&self,
aConverter: *const nsIFormatConverter
) -> nsresult
attribute nsIFormatConverter converter;
pub unsafe fn GetIsPrivateData(&self, aIsPrivateData: *mut bool) -> nsresult
[src]
/**
* Use of the SetIsPrivateData() method generated by isPrivateData attribute should
* be avoided as much as possible because the value set may not reflect the status
* of the context in which the transferable was created.
*/
[noscript] attribute boolean isPrivateData;
pub unsafe fn SetIsPrivateData(&self, aIsPrivateData: bool) -> nsresult
[src]
/**
* Use of the SetIsPrivateData() method generated by isPrivateData attribute should
* be avoided as much as possible because the value set may not reflect the status
* of the context in which the transferable was created.
*/
[noscript] attribute boolean isPrivateData;
pub unsafe fn GetRequestingPrincipal(
&self,
aRequestingPrincipal: *mut *const nsIPrincipal
) -> nsresult
[src]
&self,
aRequestingPrincipal: *mut *const nsIPrincipal
) -> nsresult
/**
* The principal of the source dom node this transferable was
* created from and the contentPolicyType for the transferable.
* Note, currently only used on Windows for network principal and
* contentPolicyType information in clipboard and drag operations.
*/
[noscript] attribute nsIPrincipal requestingPrincipal;
pub unsafe fn SetRequestingPrincipal(
&self,
aRequestingPrincipal: *const nsIPrincipal
) -> nsresult
[src]
&self,
aRequestingPrincipal: *const nsIPrincipal
) -> nsresult
/**
* The principal of the source dom node this transferable was
* created from and the contentPolicyType for the transferable.
* Note, currently only used on Windows for network principal and
* contentPolicyType information in clipboard and drag operations.
*/
[noscript] attribute nsIPrincipal requestingPrincipal;
pub unsafe fn GetContentPolicyType(
&self,
aContentPolicyType: *mut nsContentPolicyType
) -> nsresult
[src]
&self,
aContentPolicyType: *mut nsContentPolicyType
) -> nsresult
[noscript] attribute nsContentPolicyType contentPolicyType;
pub unsafe fn SetContentPolicyType(
&self,
aContentPolicyType: nsContentPolicyType
) -> nsresult
[src]
&self,
aContentPolicyType: nsContentPolicyType
) -> nsresult
[noscript] attribute nsContentPolicyType contentPolicyType;
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 nsITransferable
[src]
const IID: nsIID
IID: nsIID = nsID(2548089880, 7198, 16646, [186, 209, 159, 203, 17, 223, 242, 254])
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 nsITransferable
[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 nsITransferable
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.