104 lines
3.7 KiB
Plaintext
104 lines
3.7 KiB
Plaintext
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
*
|
|
* The contents of this file are subject to the Netscape Public
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.mozilla.org/NPL/
|
|
*
|
|
* Software distributed under the License is distributed on an "AS
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
* implied. See the License for the specific language governing
|
|
* rights and limitations under the License.
|
|
*
|
|
* The Original Code is mozilla.org code.
|
|
*
|
|
* The Initial Developer of the Original Code is Netscape
|
|
* Communications Corporation. Portions created by Netscape are
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
* Rights Reserved.
|
|
*
|
|
* Contributor(s):
|
|
*/
|
|
|
|
#include "nsISupports.idl"
|
|
#include "nsICommandParams.idl"
|
|
|
|
/**
|
|
* nsIControllerCommand
|
|
*
|
|
* A generic command interface. You can register an nsIControllerCommand
|
|
* with the nsIControllerCommandManager.
|
|
*/
|
|
|
|
[scriptable, uuid(0eae9a46-1dd2-11b2-aca0-9176f05fe9db)]
|
|
interface nsIControllerCommand : nsISupports
|
|
{
|
|
|
|
/**
|
|
* 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.
|
|
*
|
|
* @param aCommandName the name of the command for which we want the enabled
|
|
* state.
|
|
* @param aCommandRefCon a cookie held by the nsIControllerCommandManager,
|
|
* allowing the command to get some context information.
|
|
* The contents of this cookie are implementation-defined.
|
|
*/
|
|
boolean isCommandEnabled(in DOMString aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
void getCommandState(in nsICommandParams aParams, in nsISupports aCommandRefCon);
|
|
|
|
/**
|
|
* Execute the name command.
|
|
*
|
|
* @param aCommandName the name of the command to execute.
|
|
*
|
|
* @param aCommandRefCon a cookie held by the nsIControllerCommandManager,
|
|
* allowing the command to get some context information.
|
|
* The contents of this cookie are implementation-defined.
|
|
*/
|
|
void doCommand(in DOMString aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
void doCommandParams(in nsICommandParams aParams, in nsISupports aCommandRefCon);
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
* nsIStatefulControllerCommand
|
|
*
|
|
* An extension of the basic nsIControllerCommand interface, for commands
|
|
* that have to update state (e.g. "bold" in an editor). Note that the
|
|
* implementation of the command *must* be stateless (since a given command
|
|
* can be shared between clients of the controller command manager). State
|
|
* must be stored/update via the refCon.
|
|
*/
|
|
|
|
[scriptable, uuid(78ad2381-1ae6-11d4-9f7e-a6d3f6dffffc)]
|
|
interface nsIStateUpdatingControllerCommand : nsISupports
|
|
{
|
|
|
|
/**
|
|
* Update the state of the named command.
|
|
*
|
|
* @param aCommandName the name of the command for which we want to update state.
|
|
*
|
|
* @param aCommandRefCon a cookie held by the nsIControllerCommandManager,
|
|
* allowing the command to get some context information.
|
|
* The contents of this cookie are implementation-defined.
|
|
*/
|
|
void updateCommandState(in DOMString aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
/**
|
|
* Gets the command states based on the input parameters
|
|
* @param aCommandParams this will pass in the states that need to beupdated. the results will be
|
|
* placed in the value portion of the command Params
|
|
*/
|
|
//void getCommandState(in nsICommandParams aCommandParams, in nsISupports aCommandRefCon);
|
|
};
|
|
|
|
|
|
|