michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsICommandParams.idl" michael@0: michael@0: /** michael@0: * nsIControllerCommand michael@0: * michael@0: * A generic command interface. You can register an nsIControllerCommand michael@0: * with the nsIControllerCommandTable. michael@0: */ michael@0: michael@0: [scriptable, uuid(0eae9a46-1dd2-11b2-aca0-9176f05fe9db)] michael@0: interface nsIControllerCommand : nsISupports michael@0: { michael@0: michael@0: /** michael@0: * Returns true if the command is currently enabled. An nsIControllerCommand michael@0: * can implement more than one commands; say, a group of related commands michael@0: * (e.g. delete left/delete right). Because of this, the command name is michael@0: * passed to each method. michael@0: * michael@0: * @param aCommandName the name of the command for which we want the enabled michael@0: * state. michael@0: * @param aCommandContext a cookie held by the nsIControllerCommandTable, michael@0: * allowing the command to get some context information. michael@0: * The contents of this cookie are implementation-defined. michael@0: */ michael@0: boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandContext); michael@0: michael@0: void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext); michael@0: michael@0: /** michael@0: * Execute the name command. michael@0: * michael@0: * @param aCommandName the name of the command to execute. michael@0: * michael@0: * @param aCommandContext a cookie held by the nsIControllerCommandTable, michael@0: * allowing the command to get some context information. michael@0: * The contents of this cookie are implementation-defined. michael@0: */ michael@0: void doCommand(in string aCommandName, in nsISupports aCommandContext); michael@0: michael@0: void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext); michael@0: michael@0: }; michael@0: