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]

[src]

Cast this nsITransferable to one of its base interfaces.

impl nsITransferable
[src]

kFlavorHasDataProvider: i64 = 0

[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);

[src]

/**
    * 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 ();

[src]

/**
    * 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);

[src]

/**
    * 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);

[src]

/**
    * Returns true if the data is large.
    */

boolean isLargeDataSet ();

[src]

/**
    * 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 ();

[src]

/**
    * 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);

[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);

[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);

[src]

attribute nsIFormatConverter converter;

[src]

attribute nsIFormatConverter converter;

[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;

[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;

[src]

/**
   * 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;

[src]

/**
   * 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;

[src]

[noscript] attribute nsContentPolicyType contentPolicyType;

[src]

[noscript] attribute nsContentPolicyType contentPolicyType;

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsITransferable
[src]

IID: nsIID = nsID(2548089880, 7198, 16646, [186, 209, 159, 203, 17, 223, 242, 254])

[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]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsITransferable
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.