1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/components/commandhandler/public/nsIControllerCommand.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 +#include "nsICommandParams.idl" 1.12 + 1.13 +/** 1.14 + * nsIControllerCommand 1.15 + * 1.16 + * A generic command interface. You can register an nsIControllerCommand 1.17 + * with the nsIControllerCommandTable. 1.18 + */ 1.19 + 1.20 +[scriptable, uuid(0eae9a46-1dd2-11b2-aca0-9176f05fe9db)] 1.21 +interface nsIControllerCommand : nsISupports 1.22 +{ 1.23 + 1.24 + /** 1.25 + * Returns true if the command is currently enabled. An nsIControllerCommand 1.26 + * can implement more than one commands; say, a group of related commands 1.27 + * (e.g. delete left/delete right). Because of this, the command name is 1.28 + * passed to each method. 1.29 + * 1.30 + * @param aCommandName the name of the command for which we want the enabled 1.31 + * state. 1.32 + * @param aCommandContext a cookie held by the nsIControllerCommandTable, 1.33 + * allowing the command to get some context information. 1.34 + * The contents of this cookie are implementation-defined. 1.35 + */ 1.36 + boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandContext); 1.37 + 1.38 + void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext); 1.39 + 1.40 + /** 1.41 + * Execute the name command. 1.42 + * 1.43 + * @param aCommandName the name of the command to execute. 1.44 + * 1.45 + * @param aCommandContext a cookie held by the nsIControllerCommandTable, 1.46 + * allowing the command to get some context information. 1.47 + * The contents of this cookie are implementation-defined. 1.48 + */ 1.49 + void doCommand(in string aCommandName, in nsISupports aCommandContext); 1.50 + 1.51 + void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext); 1.52 + 1.53 +}; 1.54 +