/* -*- 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 string aCommandName, in nsISupports aCommandRefCon); void getCommandStateParams(in string aCommandName, 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 string aCommandName, in nsISupports aCommandRefCon); void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandRefCon); };