michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: michael@0: [scriptable, uuid(D5B61B82-1DA4-11d3-BF87-00105A1B0627)] michael@0: interface nsIController : nsISupports { michael@0: boolean isCommandEnabled(in string command); michael@0: boolean supportsCommand(in string command); michael@0: michael@0: void doCommand(in string command); michael@0: michael@0: void onEvent(in string eventName); michael@0: }; michael@0: michael@0: michael@0: /* michael@0: michael@0: Enhanced controller interface that allows for passing of parameters michael@0: to commands. michael@0: michael@0: */ michael@0: michael@0: interface nsICommandParams; michael@0: michael@0: [scriptable, uuid(EBE55080-C8A9-11D5-A73C-DD620D6E04BC)] michael@0: interface nsICommandController : nsISupports michael@0: { michael@0: michael@0: void getCommandStateWithParams( in string command, in nsICommandParams aCommandParams); michael@0: michael@0: void doCommandWithParams(in string command, in nsICommandParams aCommandParams); michael@0: michael@0: }; michael@0: michael@0: michael@0: /* michael@0: An API for registering commands in groups, to allow for michael@0: updating via nsIDOMWindow::UpdateCommands. michael@0: */ michael@0: interface nsISimpleEnumerator; michael@0: michael@0: [scriptable, uuid(9F82C404-1C7B-11D5-A73C-ECA43CA836FC)] michael@0: interface nsIControllerCommandGroup : nsISupports michael@0: { michael@0: michael@0: void addCommandToGroup(in string aCommand, in string aGroup); michael@0: void removeCommandFromGroup(in string aCommand, in string aGroup); michael@0: michael@0: boolean isCommandInGroup(in string aCommand, in string aGroup); michael@0: michael@0: /* michael@0: We should expose some methods that allow for enumeration. michael@0: */ michael@0: nsISimpleEnumerator getGroupsEnumerator(); michael@0: michael@0: nsISimpleEnumerator getEnumeratorForGroup(in string aGroup); michael@0: michael@0: }; michael@0: