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.
aContext | the load context associated with the transferable object. This can be set to null if a load context is not available. |
Computes a list of flavors (mime types as nsISupportsCString) that the transferable
can export, either through intrinsic knowledge or output data converters.
aDataFlavorList | fills list with supported flavors. This is a copy of the internal list, so it may be edited w/out affecting the transferable. |
Given a flavor retrieve the data.
aFlavor | (in parameter) the flavor of data to retrieve |
aData | the data. Some variant of class in nsISupportsPrimitives.idl |
aDataLen | the length of the data |
Returns the best flavor in the transferable, given those that have
been added to it with |AddFlavor()|
aFlavor | (out parameter) the flavor of data that was retrieved |
aData | the data. Some variant of class in nsISupportsPrimitives.idl |
aDataLen | the length of the data |
Returns true if the data is large.
Computes a list of flavors (mime types as nsISupportsCString) that the transferable can
accept into it, either through intrinsic knowledge or input data converters.
outFlavorList | fills list with supported flavors. This is a copy of the internal list, so it may be edited w/out affecting the transferable. |
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.
aFlavor | the flavor of data that is being set |
aData | the data, either some variant of class in nsISupportsPrimitives.idl, an nsIFile, or an nsIFlavorDataProvider (see above) |
aDataLen | the length of the data, or 0 if passing a nsIFlavorDataProvider |
Add the data flavor, indicating that this transferable
can receive this type of flavor
aDataFlavor | a new data flavor to handle |
Removes the data flavor matching the given one (string compare) and the data
that goes along with it.
aDataFlavor | a data flavor to remove |
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.
The source dom node this transferable was created from.
Note, currently only in use on Windows for network principal
information in drag operations.