mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 21:58:41 +02:00
--HG-- rename : embedding/components/commandhandler/src/nsBaseCommandController.cpp => embedding/components/commandhandler/nsBaseCommandController.cpp rename : embedding/components/commandhandler/src/nsBaseCommandController.h => embedding/components/commandhandler/nsBaseCommandController.h rename : embedding/components/commandhandler/src/nsCommandGroup.cpp => embedding/components/commandhandler/nsCommandGroup.cpp rename : embedding/components/commandhandler/src/nsCommandGroup.h => embedding/components/commandhandler/nsCommandGroup.h rename : embedding/components/commandhandler/src/nsCommandManager.cpp => embedding/components/commandhandler/nsCommandManager.cpp rename : embedding/components/commandhandler/src/nsCommandManager.h => embedding/components/commandhandler/nsCommandManager.h rename : embedding/components/commandhandler/src/nsCommandParams.cpp => embedding/components/commandhandler/nsCommandParams.cpp rename : embedding/components/commandhandler/src/nsCommandParams.h => embedding/components/commandhandler/nsCommandParams.h rename : embedding/components/commandhandler/src/nsControllerCommandTable.cpp => embedding/components/commandhandler/nsControllerCommandTable.cpp rename : embedding/components/commandhandler/src/nsControllerCommandTable.h => embedding/components/commandhandler/nsControllerCommandTable.h rename : embedding/components/commandhandler/public/nsICommandManager.idl => embedding/components/commandhandler/nsICommandManager.idl rename : embedding/components/commandhandler/public/nsICommandParams.idl => embedding/components/commandhandler/nsICommandParams.idl rename : embedding/components/commandhandler/public/nsIControllerCommand.idl => embedding/components/commandhandler/nsIControllerCommand.idl rename : embedding/components/commandhandler/public/nsIControllerCommandTable.idl => embedding/components/commandhandler/nsIControllerCommandTable.idl rename : embedding/components/commandhandler/public/nsIControllerContext.idl => embedding/components/commandhandler/nsIControllerContext.idl rename : embedding/components/commandhandler/public/nsPICommandUpdater.idl => embedding/components/commandhandler/nsPICommandUpdater.idl
97 lines
3.2 KiB
Text
97 lines
3.2 KiB
Text
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsISupports.idl"
|
|
#include "nsIControllerCommand.idl"
|
|
#include "nsICommandParams.idl"
|
|
|
|
/**
|
|
* nsIControllerCommandTable
|
|
*
|
|
* An interface via which a controller can maintain a series of commands,
|
|
* and efficiently dispatch commands to their respective handlers.
|
|
*
|
|
* Controllers that use an nsIControllerCommandTable should support
|
|
* nsIInterfaceRequestor, and be able to return an interface to their
|
|
* controller command table via getInterface().
|
|
*
|
|
*/
|
|
|
|
[scriptable, uuid(d1a47834-6ad4-11d7-bfad-000393636592)]
|
|
interface nsIControllerCommandTable : nsISupports
|
|
{
|
|
/**
|
|
* Make this command table immutable, so that commands cannot
|
|
* be registered or unregistered. Some command tables are made
|
|
* mutable after command registration so that they can be
|
|
* used as singletons.
|
|
*/
|
|
void makeImmutable();
|
|
|
|
/**
|
|
* Register and unregister commands with the command table.
|
|
*
|
|
* @param aCommandName the name of the command under which to register or
|
|
* unregister the given command handler.
|
|
*
|
|
* @param aCommand the handler for this command.
|
|
*/
|
|
void registerCommand(in string aCommandName, in nsIControllerCommand aCommand);
|
|
void unregisterCommand(in string aCommandName, in nsIControllerCommand aCommand);
|
|
|
|
/**
|
|
* Find the command handler which has been registered to handle the named command.
|
|
*
|
|
* @param aCommandName the name of the command to find the handler for.
|
|
*/
|
|
nsIControllerCommand findCommandHandler(in string aCommandName);
|
|
|
|
/**
|
|
* Get whether the named command is enabled.
|
|
*
|
|
* @param aCommandName the name of the command to test
|
|
* @param aCommandRefCon the command context data
|
|
*/
|
|
boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
/**
|
|
* Tell the command to update its state (if it is a state updating command)
|
|
*
|
|
* @param aCommandName the name of the command to update
|
|
* @param aCommandRefCon the command context data
|
|
*/
|
|
void updateCommandState(in string aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
/**
|
|
* Get whether the named command is supported.
|
|
*
|
|
* @param aCommandName the name of the command to test
|
|
* @param aCommandRefCon the command context data
|
|
*/
|
|
boolean supportsCommand(in string aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
/**
|
|
* Execute the named command.
|
|
*
|
|
* @param aCommandName the name of the command to execute
|
|
* @param aCommandRefCon the command context data
|
|
*/
|
|
void doCommand(in string aCommandName, in nsISupports aCommandRefCon);
|
|
|
|
void doCommandParams(in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon);
|
|
|
|
void getCommandState(in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon);
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
|
// {670ee5da-6ad5-11d7-9950-000393636592}
|
|
#define NS_CONTROLLERCOMMANDTABLE_CID \
|
|
{0x670ee5da, 0x6ad5, 0x11d7, \
|
|
{ 0x99, 0x50, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 }}
|
|
|
|
#define NS_CONTROLLERCOMMANDTABLE_CONTRACTID \
|
|
"@mozilla.org/embedcomp/controller-command-table;1"
|
|
%}
|