You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIClipboardCommands


This interface allows for embedding clients to interact with the system-wide OS clipboard. Gecko does not use a private clipboard: instead it places its data directly onto the system clipboard. The webshell implements this interface. It is scriptable.

Methods
canCutSelection

Determines if there is a selection that it is not read-only.

Syntax:

boolean nsIClipboardCommands::canCutSelection()  

Parameters:

None.

Returns:

TRUE if the current selection can be cut.
FALSE otherwise.
canCopySelection

Determines if there is a selection that is copyable.

Syntax:

boolean nsIClipboardCommands::canCopySelection()  

Parameters:

None.

Returns:

TRUE if there is a selection.
FALSE otherwise.
canCopyLinkLocation

Determines if there is a selection that is a copyable link location.

Syntax:

boolean nsIClipboardCommands::canCopyLinkLocation()  

Parameters:

None.

Returns:

TRUE if a link is selected.
FALSE otherwise.
canCopyImageContents

Determines whether the current contents of the clipboard can be pasted and if the current selection is not read-only.

Parameters:

None.

Returns:

TRUE if there is data to paste on the clipboard and the current selection is not readonly.
FALSE otherwise.
canCopyImageLocation

Determines if there is a selection that is a copyable image location.

Syntax:

boolean nsIClipboardCommands::canCopyImageLocation()  

Parameters:

None.

Returns:

TRUE if an image is selected.
FALSE otherwise.
canPaste

Determines if the current contents of the clipboard can be pasted and if the current selection is not read-only

Syntax:

boolean nsIClipboardCommands::canPaste()  

Parameters:

None.

Returns:

TRUE if there is data to paste on the clipboard and the current selection is not read-only.
FALSE otherwise.
cutSelection

Cuts the current selection onto the clipboard.

Syntax:

void nsIClipboardCommands::cutSelection()  

Parameters:

None.

nsresult:

NS_OK if successful.
copySelection

Copies the current selection onto the clipboard.

Syntax:

void nsIClipboardCommands::copySelection()  

Parameters:

None.

nsresult:

NS_OK if successful.
copyLinkLocation

Copies the link location of the current selection (e.g., the href attribute of a selected a tag).

Syntax:

void nsIClipboardCommands::copyLinkLocation()  

Parameters:

None.

nsresult:

NS_OK if successful.
copyImageLocation

Copies the location of the selected image.

Syntax:

void nsIClipboardCommands::copyImageLocation()  

Parameters:

None.

nsresult:

NS_OK if successful.
copyImageContents

Copies the contents of the selected image.

Syntax:

void nsIClipboardCommands::copyImageContents() 

Parameters:

None.

nsresult:

NS_OK if successful.
paste

Pastes the contents of the clipboard into the current selection.

Syntax:

void nsIClipboardCommands::paste()  

Parameters:

None.

nsresult:

NS_OK if successful.
selectAll

Selects the entire contents.

Syntax:

void nsIClipboardCommands::selectAll()  

Parameters:

None.

nsresult:

NS_OK if successful.
selectNone

Clears the current selection (if any). The insertion point ends up at beginning of current selection.

Syntax:

void nsIClipboardCommands::selectNone()  

Parameters:

None.

nsresult:

NS_OK if successful.

Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX