Search completed in 1.38 seconds.
15 results for "nsitransferable":
nsITransferable
widget/
nsITransferable.idlScriptable A container for typed data that can be transferred from one place or owner to another, possibly involving format conversion. These objects are used during drag-and-drop operations. Inherits from: nsISupports Last changed in Gecko 13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10) Implemented by: @mozilla.org/widget/transferable;1. To create an instance, use: var transferable = Components.classes["@mozilla.org/widget/transferable;1"] .createInstance(Components.interfaces.
nsITransferable); It's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the MIME type of the format supported by the flavor. Method overview void addData...
Using the clipboard
to the clipboard. The clipboard model in Mozilla requires you to perform the following steps to copy data: Create an XPCOM wrapper for the data which you want to put on the clipboard. This is needed because you can put anything on the clipboard from text to images. Create a transferring object. This object can be the component @mozilla.org/widget/transferable;1 which implements the interface
nsITransferable. Initialize the transferring object with the nsILoadContext obtained from the window that is the source of the clipboard data. This ensures that if the copied data comes from a window in private browsing mode, the clipboard will be cleared when private browsing mode ends. For reading from the clipboard you can call the init method of the transferable with null as nsILoadContext, but you have to ...
... if (source instanceof Ci.nsIDOMWindow) // Note: in Gecko versions >16, you can import the ...
... if (source instanceof Ci.nsIDOMWindow) // Note: in Gecko versions >16, you can import the PrivateBrowsingUtils.jsm module // and use P...
...And 3 more matches
nsIClipboard
basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data. ...
... The kSelectionClipboard is peculiar to the X Windows System, where it refers to...
... for putting data on the clipboard This method forces the data onto the clipboard in its various formats This may be used if the application going away. void forceDataToClipboard( in long aWhichClipboard ); Parameters aWhichClipboard Specifies the clipboard to which this operation applies. getData() This method retrieves data from the clipboard into a transferable. void getData( in
nsITransferable aTransferable, in long aWhichClipboard ); Parameters aTransferable The transferable to receive data from the clipboard. aWhichClipboard Specifies the clipboard to which this operation applies. hasDataMatchingFlavors() This method provides a way to give correct UI feedback about, for instance, whether a paste should be allowed. It does not actually retrieve the data and should be a ve...
...And 2 more matches
nsIClipboardDragDropHooks
action so no further processing will occur. If any errors occur (without setting the boolean result) the default action will occur. AllowDrop() will be called MANY times during drag so ensure that it is efficient. Method overview boolean allowDrop(in nsIDOMEvent event, in nsIDragSession session); boolean allowStartDrag(in nsIDOMEvent event); boolean onCopyOrDrag(in nsIDOMEvent aEvent, in
nsITransferable trans); boolean onPasteOrDrop(in nsIDOMEvent event, in
nsITransferable trans); Methods allowDrop() Tells gecko whether a drop is allowed on this content area. boolean allowDrop( in nsIDOMEvent event, in nsIDragSession session ); Parameters event The DOM event (drag gesture). session The drag session from which client can get the flavors present or the actual data. Return value true in...
...he drag can proceed. Otherwise, false to show the drag is canceled (Does not go to Operating System). onCopyOrDrag() Alters the flavors or data presented to the OS. Used for drag and copy actions. Because this can be called many times, it is highly recommended that the implementation be very efficient so user feedback is not negatively impacted. boolean onCopyOrDrag( in nsIDOMEvent aEvent, in
nsITransferable trans ); Parameters aEvent The DOM event (drag drop). null if triggered by copy. trans The transferable holding the list of flavors and the data for each flavor. Return value true to indicate that copy/drag can proceed. Otherwise, false to indicate that the copy/drag is canceled, does not go to Operating System. onPasteOrDrop() Provide an alternative action to the built-in behavior when someth...
...ferable holding the list of flavors and the data for each flavor. Return value true to indicate that copy/drag can proceed. Otherwise, false to indicate that the copy/drag is canceled, does not go to Operating System. onPasteOrDrop() Provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onPasteOrDrop( in nsIDOMEvent event, in
nsITransferable trans ); Parameters event The DOM event (drag drop); null if triggered by paste. trans The transferable holding the list of flavors and the data for each flavor. Return value true to indicate the action was handled, do not perform built-in behavior. Otherwise, false to indicate the action was not overridden, do built-in behavior. See also nsIClipboard ...
nsIClipboardOwner
The nsIClipboardOwner interface notifies the clipboard owner about the current status of ownership of the clipboard transferable at given situation and time. widget/public/nsIClipboardOwner.idlScriptable Please add a summary to this article. ...
...t changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Inherits from: nsISupports Method overview void LosingOwnership(in
nsITransferable aTransferable); Methods LosingOwnership() This method notifies the owner of the clipboard transferable that the transferable is being removed from the clipboard. It results into a NS_Ok if there are no errors. ...
...od overview void LosingOwnership(in
nsITransferable aTransferable); Methods LosingOwnership() This method notifies the owner of the clipboard transferable that the transferable is being removed from the clipboard. It results into a NS_Ok if there are no errors. void LosingOwnership( in
nsITransferable aTransferable ); Parameters aTransferable The transferable. ...
Updating addons broken by private browsing changes - Archive of obsolete content
After reading this document, contact Josh Matthews with further questions or clarifications, or file a bug if your extension has stopped working due to a change described here and you are having trouble updating it. ...
... if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete Then your addon will require updating to correctly support the new per-window private browser feature in Firefox 20 (and will require updating to work correctly in releases of Firefox since the ones listed). IDLs
nsITransferable: See Using the clipboard for information about the new init method. imgICache: This must no longer be obtained as a service. See the imgICache article for more information. mozIAsyncFavicons/nsIFaviconService: setAndFetchFaviconForPage/setAndLoadFaviconForPage now take a required privacy status argument, either nsIFaviconService.FAVICON_LOAD_PRIVATE or nsIFaviconService.FAVICON_LOAD_NON_PRI...
Drag and Drop - Archive of obsolete content
an ondraggesture event handler. Once this function is called, a drag has started. The function invokeDragSession takes four parameters, as described below: invokeDragSession(element, transferableArray, region, actions) element A reference to the element that is being dragged. This can be retrieved by getting the property event.target during the event handler. transferableArray An array of
nsITransferable objects, one for each item being dragged. An array is used because you might want to drag several objects at once, such as a set of files. region A region used for feedback indication. This should usually be set to null. actions The actions that the drag uses. This should be set to one of the following constants, or several added together. The action can be changed during the drag depending o...
...nt handlers. dragAction Set to the current action to be performed, which should be one or more of the constants described earlier. This can be used to provide extra feedback to the user. numDropItems The number of items being dragged. For example, this will be set to 5 if five bookmarks are being dragged. getData(transfer,index) Get the data being dragged. The first argument should be an
nsITransferable object to hold the data. The second argument, index, should be the index of the item to return. sourceDocument The document where the drag started. sourceNode The DOM node where the drag started. isDataFlavorSupported(flavor) Returns true if the data being dragged contains data of the specified flavor. Next >> Original Document Information Author(s): Neil Deakin Original Docume...
nsIDOMWindowUtils
esContext); Native code only! ...
...ng composition event. getClassName() Returns the real classname (possibly of the mostly-transparent security wrapper) of aObj. sendContentCommandEvent() Generate a content command event. Cannot be accessed from unprivileged context (not content-accessible) Will throw a DOM security error if called without UniversalXPConnect privileges. void sendContentCommandEvent( in AString aType, in
nsITransferable aTransferable Optional ); Parameters aType Type of command content event to send. Can be one of "cut", "copy", "paste", "delete", "undo", "redo", or "pasteTransferable". aTransferable Optional An instance of
nsITransferable when aType is "pasteTransferable" sendKeyEvent() Synthesize a key event to the window. The event types supported are: keydown, keyup, keypress. Key events generall...
nsIDragSession
widget/public/nsIDragSession.idlScriptable Provides support for interacting with an ongoing drag session during a drag and drop operation. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void getData( in
nsITransferable aTransferable, in unsigned long aItemIndex ); boolean isDataFlavorSupported( in string aDataFlavor ); Attributes Attribute Type Description canDrop boolean Set the current state of the drag, whether it can be dropped or not. Usually the target "frame" sets this so the native system can render the correct feedback. dataTransfer nsIDOMDataTransfer The data transfer object for the current drag operation. dragAction unsigned lo...
... originated outside the application. Read only. targetSize nsSize Sets the current width and height of the drag target area. It will contain the current size of the Frame that the drag is currently in. Native code only! Methods getData() Gets data from a drag and drop operation. Can be called while the drag is in process or after the drop has completed. void getData( in
nsITransferable aTransferable, in unsigned long aItemIndex ); Parameters aTransferable The transferable for the data to be put into. aItemIndex Which of multiple drag items, zero-based. Must be less than numDropItems. isDataFlavorSupported() Checks to see if any of the native data on the clipboard matches a given data flavor. If numDropItems is greater than one, there is no indication as to which of...
Drag & Drop - Archive of obsolete content
la.org/network/io-service;1'].getService(Components.interfaces.nsIIOService); var uris = new Array(); // If sourceNode is not null, then the drop was from inside the application if (dragSession.sourceNode) return; // Setup a transfer item to retrieve the file data var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.
nsITransferable); trans.addDataFlavor("text/x-moz-url"); trans.addDataFlavor("application/x-moz-file"); for (var i=0; i<dragSession.numDropItems; i++) { var uri = null; dragSession.getData(trans, i); var flavor = {}, data = {}, length = {}; trans.getAnyTransferData(flavor, data, length); if (data) { try { var str = data.value.QueryInterface(Components...
Supporting per-window private browsing - Archive of obsolete content
getService(Components.interfaces.nsIPrivateBrowsingService). privateBrowsingEnabled; if (!inPrivateBrowsing) { ... } } catch(e) { Components.utils.reportError(e); return; } } Obtaining an nsILoadContext for privacy-sensitive APIs Some APIs (such as
nsITransferable and nsIWebBrowserPersist) take nsILoadContext arguments that are used to determine whether they should be classed as private or not (for example, whether the URI being persisted by saveURI should be added to the permanent download history). To do this, import resource://gre/modules/PrivateBrowsingUtils.jsm and use PrivateBrowsingUtils.getPrivacyContextFromWindow(win), passing a Window object that...
Index
ter a nsITransactionManager begins a batch. 1022 nsITransactionManager Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference Adds a listener to the transaction manager's notification list. Listeners are notified whenever a transaction is done, undone, or redone. The listener's nsITransactionListener.AddRef() method is called. 1023
nsITransferable Gecko, Interface, Mozilla, Reference, Reference(2), XPCOM, XPCOM Interface Reference Implemented by: @mozilla.org/widget/transferable;1. To create an instance, use: 1024 nsITransport Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference This interface provides methods to open blocking or non-blocking, buffered or unbuffered streams...
XPCOM Interface Reference
nsITaskbarWindowPreviewnsITelemetrynsITextInputProcessornsITextInputProcessorCallbacknsITextInputProcessorNotificationnsIThreadnsIThreadEventFilternsIThreadInternalnsIThreadManagernsIThreadObservernsIThreadPoolnsIThreadPoolListenernsITimernsITimerCallbacknsIToolkitnsIToolkitProfilensIToolkitProfileServicensITraceableChannelnsITransactionnsITransactionListnsITransactionListenernsITransactionManager
nsITransferablensITransportnsITransportEventSinknsITransportSecurityInfonsITreeBoxObjectnsITreeColumnnsITreeColumnsnsITreeContentViewnsITreeSelectionnsITreeViewnsIURInsIURIFixupnsIURIFixupInfonsIURLnsIURLFormatternsIURLParsernsIUTF8ConverterServicensIUTF8StringEnumeratornsIUUIDGeneratornsIUpdatensIUpdateCheckListenernsIUpdateCheckernsIUpdateItemnsIUpdateManagernsIUpdatePatchnsIUpdatePromptnsIUpdateTimerManagerns...
XPCOM primitive
An XPCOM primitive is an XPCOM object that "boxes" a value of a primitive type. All XPCOM primitives are scriptable, and they all implement an XPCOM interface from the table below. Primitives are rarely useful. The main use case is to store primitive values in a data structure that can only store XPCOM objects, such as nsIArray. Also, certain APIs, such as
nsITransferable.setTransferData(), require primitives. (However, if you are designing that kind of API today, you should probably use nsIVariant instead.) IDL data type Interface Component IDL nsIDPtr nsISupportsID @mozilla.org/supports-id;1 [scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)] interface nsISupportsID : nsISupportsPrimitive { attribute nsIDPtr data; string toString(); }; AString nsISupportsString @mozilla.org/...
Working with out parameters
void getTransferData ( in string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ; ... } The getTransferData method takes three parameters, aFlavor, aData, and aDataLen, and returns nothing. aData and aDataLen are marked as out, meaning that they act as "return values" for this method, and are changed during the method call. These are so-called out parameters. ...