embedding/components/commandhandler/public/nsIControllerCommandTable.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #include "nsISupports.idl"
michael@0 6 #include "nsIControllerCommand.idl"
michael@0 7 #include "nsICommandParams.idl"
michael@0 8
michael@0 9 /**
michael@0 10 * nsIControllerCommandTable
michael@0 11 *
michael@0 12 * An interface via which a controller can maintain a series of commands,
michael@0 13 * and efficiently dispatch commands to their respective handlers.
michael@0 14 *
michael@0 15 * Controllers that use an nsIControllerCommandTable should support
michael@0 16 * nsIInterfaceRequestor, and be able to return an interface to their
michael@0 17 * controller command table via getInterface().
michael@0 18 *
michael@0 19 */
michael@0 20
michael@0 21 [scriptable, uuid(d1a47834-6ad4-11d7-bfad-000393636592)]
michael@0 22 interface nsIControllerCommandTable : nsISupports
michael@0 23 {
michael@0 24 /**
michael@0 25 * Make this command table immutable, so that commands cannot
michael@0 26 * be registered or unregistered. Some command tables are made
michael@0 27 * mutable after command registration so that they can be
michael@0 28 * used as singletons.
michael@0 29 */
michael@0 30 void makeImmutable();
michael@0 31
michael@0 32 /**
michael@0 33 * Register and unregister commands with the command table.
michael@0 34 *
michael@0 35 * @param aCommandName the name of the command under which to register or
michael@0 36 * unregister the given command handler.
michael@0 37 *
michael@0 38 * @param aCommand the handler for this command.
michael@0 39 */
michael@0 40 void registerCommand(in string aCommandName, in nsIControllerCommand aCommand);
michael@0 41 void unregisterCommand(in string aCommandName, in nsIControllerCommand aCommand);
michael@0 42
michael@0 43 /**
michael@0 44 * Find the command handler which has been registered to handle the named command.
michael@0 45 *
michael@0 46 * @param aCommandName the name of the command to find the handler for.
michael@0 47 */
michael@0 48 nsIControllerCommand findCommandHandler(in string aCommandName);
michael@0 49
michael@0 50 /**
michael@0 51 * Get whether the named command is enabled.
michael@0 52 *
michael@0 53 * @param aCommandName the name of the command to test
michael@0 54 * @param aCommandRefCon the command context data
michael@0 55 */
michael@0 56 boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandRefCon);
michael@0 57
michael@0 58 /**
michael@0 59 * Tell the command to update its state (if it is a state updating command)
michael@0 60 *
michael@0 61 * @param aCommandName the name of the command to update
michael@0 62 * @param aCommandRefCon the command context data
michael@0 63 */
michael@0 64 void updateCommandState(in string aCommandName, in nsISupports aCommandRefCon);
michael@0 65
michael@0 66 /**
michael@0 67 * Get whether the named command is supported.
michael@0 68 *
michael@0 69 * @param aCommandName the name of the command to test
michael@0 70 * @param aCommandRefCon the command context data
michael@0 71 */
michael@0 72 boolean supportsCommand(in string aCommandName, in nsISupports aCommandRefCon);
michael@0 73
michael@0 74 /**
michael@0 75 * Execute the named command.
michael@0 76 *
michael@0 77 * @param aCommandName the name of the command to execute
michael@0 78 * @param aCommandRefCon the command context data
michael@0 79 */
michael@0 80 void doCommand(in string aCommandName, in nsISupports aCommandRefCon);
michael@0 81
michael@0 82 void doCommandParams(in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon);
michael@0 83
michael@0 84 void getCommandState(in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon);
michael@0 85 };
michael@0 86
michael@0 87
michael@0 88
michael@0 89 %{C++
michael@0 90 // {670ee5da-6ad5-11d7-9950-000393636592}
michael@0 91 #define NS_CONTROLLERCOMMANDTABLE_CID \
michael@0 92 {0x670ee5da, 0x6ad5, 0x11d7, \
michael@0 93 { 0x99, 0x50, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 }}
michael@0 94
michael@0 95 #define NS_CONTROLLERCOMMANDTABLE_CONTRACTID \
michael@0 96 "@mozilla.org/embedcomp/controller-command-table;1"
michael@0 97 %}

mercurial