1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/document/public/nsIController.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +[scriptable, uuid(D5B61B82-1DA4-11d3-BF87-00105A1B0627)] 1.12 +interface nsIController : nsISupports { 1.13 + boolean isCommandEnabled(in string command); 1.14 + boolean supportsCommand(in string command); 1.15 + 1.16 + void doCommand(in string command); 1.17 + 1.18 + void onEvent(in string eventName); 1.19 +}; 1.20 + 1.21 + 1.22 +/* 1.23 + 1.24 + Enhanced controller interface that allows for passing of parameters 1.25 + to commands. 1.26 + 1.27 +*/ 1.28 + 1.29 +interface nsICommandParams; 1.30 + 1.31 +[scriptable, uuid(EBE55080-C8A9-11D5-A73C-DD620D6E04BC)] 1.32 +interface nsICommandController : nsISupports 1.33 +{ 1.34 + 1.35 + void getCommandStateWithParams( in string command, in nsICommandParams aCommandParams); 1.36 + 1.37 + void doCommandWithParams(in string command, in nsICommandParams aCommandParams); 1.38 + 1.39 +}; 1.40 + 1.41 + 1.42 +/* 1.43 + An API for registering commands in groups, to allow for 1.44 + updating via nsIDOMWindow::UpdateCommands. 1.45 +*/ 1.46 +interface nsISimpleEnumerator; 1.47 + 1.48 +[scriptable, uuid(9F82C404-1C7B-11D5-A73C-ECA43CA836FC)] 1.49 +interface nsIControllerCommandGroup : nsISupports 1.50 +{ 1.51 + 1.52 + void addCommandToGroup(in string aCommand, in string aGroup); 1.53 + void removeCommandFromGroup(in string aCommand, in string aGroup); 1.54 + 1.55 + boolean isCommandInGroup(in string aCommand, in string aGroup); 1.56 + 1.57 + /* 1.58 + We should expose some methods that allow for enumeration. 1.59 + */ 1.60 + nsISimpleEnumerator getGroupsEnumerator(); 1.61 + 1.62 + nsISimpleEnumerator getEnumeratorForGroup(in string aGroup); 1.63 + 1.64 +}; 1.65 +