Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Static Protected Member Functions
nsClipboardBaseCommand Class Reference
Inheritance diagram for nsClipboardBaseCommand:
Inheritance graph
[legend]
Collaboration diagram for nsClipboardBaseCommand:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean isCommandEnabled (in string aCommandName, in nsISupports aCommandContext)
 Returns true if the command is currently enabled.
void getCommandStateParams (in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext)
void doCommand (in string aCommandName, in nsISupports aCommandContext)
 Execute the name command.
void doCommandParams (in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext)

Protected Member Functions

virtual nsresult IsClipboardCommandEnabled (const char *aCommandName, nsIContentViewerEdit *aEdit, PRBool *outCmdEnabled)=0
virtual nsresult DoClipboardCommand (const char *aCommandName, nsIContentViewerEdit *aEdit, nsICommandParams *aParams)=0

Static Protected Member Functions

static nsresult GetContentViewerEditFromContext (nsISupports *aContext, nsIContentViewerEdit **aEditInterface)

Detailed Description

Definition at line 410 of file nsGlobalWindowCommands.cpp.


Member Function Documentation

virtual nsresult nsClipboardBaseCommand::DoClipboardCommand ( const char *  aCommandName,
nsIContentViewerEdit aEdit,
nsICommandParams aParams 
) [protected, pure virtual]
void nsIControllerCommand::doCommand ( in string  aCommandName,
in nsISupports  aCommandContext 
) [inherited]

Execute the name command.

Parameters:
aCommandNamethe name of the command to execute.
aCommandContexta cookie held by the nsIControllerCommandTable, allowing the command to get some context information. The contents of this cookie are implementation-defined.
void nsIControllerCommand::doCommandParams ( in string  aCommandName,
in nsICommandParams  aParams,
in nsISupports  aCommandContext 
) [inherited]
void nsIControllerCommand::getCommandStateParams ( in string  aCommandName,
in nsICommandParams  aParams,
in nsISupports  aCommandContext 
) [inherited]
nsresult nsClipboardBaseCommand::GetContentViewerEditFromContext ( nsISupports *  aContext,
nsIContentViewerEdit **  aEditInterface 
) [static, protected]

Definition at line 484 of file nsGlobalWindowCommands.cpp.

{
  NS_ENSURE_ARG(aEditInterface);
  *aEditInterface = nsnull;

  nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(aContext);
  NS_ENSURE_TRUE(window, NS_ERROR_INVALID_ARG);

  nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(window));
  NS_ENSURE_TRUE(sgo, NS_ERROR_FAILURE);

  nsIDocShell *docShell = sgo->GetDocShell();
  NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);

  nsCOMPtr<nsIContentViewer> viewer;
  docShell->GetContentViewer(getter_AddRefs(viewer));
  nsCOMPtr<nsIContentViewerEdit> edit(do_QueryInterface(viewer));
  NS_ENSURE_TRUE(edit, NS_ERROR_FAILURE);

  *aEditInterface = edit;
  NS_ADDREF(*aEditInterface);
  return NS_OK;
}

Here is the call graph for this function:

virtual nsresult nsClipboardBaseCommand::IsClipboardCommandEnabled ( const char *  aCommandName,
nsIContentViewerEdit aEdit,
PRBool outCmdEnabled 
) [protected, pure virtual]
boolean nsIControllerCommand::isCommandEnabled ( in string  aCommandName,
in nsISupports  aCommandContext 
) [inherited]

Returns true if the command is currently enabled.

An nsIControllerCommand can implement more than one commands; say, a group of related commands (e.g. delete left/delete right). Because of this, the command name is passed to each method.

Parameters:
aCommandNamethe name of the command for which we want the enabled state.
aCommandContexta cookie held by the nsIControllerCommandTable, allowing the command to get some context information. The contents of this cookie are implementation-defined.

The documentation for this class was generated from the following file: