Interface nsITransferableType

Hierarchy

Properties

contentPolicyType: nsContentPolicyType
converter: nsIFormatConverter
cookieJarSettings: nsICookieJarSettings

The cookieJarSettings of the source dom node this transferable was created from.

isPrivateData: boolean

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.

referrerInfo: nsIReferrerInfo

Used for initializing the referrer when downloading a file promise.

requestingPrincipal: nsIPrincipal

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.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Add the data flavor, indicating that this transferable can receive this type of flavor

    Parameters

    • aDataFlavor: string

      a new data flavor to handle

    Returns void

  • Returns the first flavor which has data.

    Parameters

    • aFlavor: string

      (out parameter) the flavor of data that was retrieved

    • aData: nsISupports

      the data. Some variant of class in nsISupportsPrimitives.idl

    Returns void

  • Given a flavor retrieve the data.

    Parameters

    • aFlavor: string

      (in parameter) the flavor of data to retrieve

    • aData: nsISupports

      the data. Some variant of class in nsISupportsPrimitives.idl

    Returns void

  • 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.

    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.docShell .QueryInterface(Ci.nsILoadContext);

    In C++ callers, if you have the corresponding document, you can just call Document::GetLoadContext to get to the load context object.

    Parameters

    • aContext: nsILoadContext

      the load context associated with the transferable object. This can be set to null if a load context is not available.

    Returns void

  • Removes the data flavor matching the given one (string compare) and the data that goes along with it.

    Parameters

    • aDataFlavor: string

      a data flavor to remove

    Returns void

  • 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.

    Parameters

    • aFlavor: string

      the flavor of data that is being set

    • aData: nsISupports

      the data, either some variant of class in nsISupportsPrimitives.idl, an nsIFile, or an nsIFlavorDataProvider (see above)

    Returns void

Generated using TypeDoc