sfraser%netscape.com 4a0df27c9c Fix bug 201257 -- clean up use of nsIControllerCommandManager by editor:
Renaming nsIControllerCommandManager to nsIControllerCommandTable to reduce confusion.
Moving the immutability flag from the nsBaseCommandController to the nsControllerCommandTable.
Renaming the 'refcon' on nsIControllerContext to 'context', and giving nsIControllerContext an Init() method that optionally takes a command table.
Fixing the editor and composer module code to create pre-filled nsIControllerCommandTables as services, and the controller constructors to create singleton command tables with do_GetService.
r=brade, sr=alecf.


git-svn-id: svn://10.0.0.236/trunk@140988 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-10 18:44:03 +00:00

68 lines
2.5 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 nsIControllerCommandTable.
*/
[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 aCommandContext a cookie held by the nsIControllerCommandTable,
* allowing the command to get some context information.
* The contents of this cookie are implementation-defined.
*/
boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandContext);
void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
/**
* Execute the name command.
*
* @param aCommandName the name of the command to execute.
*
* @param aCommandContext a cookie held by the nsIControllerCommandTable,
* allowing the command to get some context information.
* The contents of this cookie are implementation-defined.
*/
void doCommand(in string aCommandName, in nsISupports aCommandContext);
void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
};