nsIControllerCommand.idl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. #include "nsICommandParams.idl"
  8. /**
  9. * nsIControllerCommand
  10. *
  11. * A generic command interface. You can register an nsIControllerCommand
  12. * with the nsIControllerCommandTable.
  13. */
  14. [scriptable, uuid(0eae9a46-1dd2-11b2-aca0-9176f05fe9db)]
  15. interface nsIControllerCommand : nsISupports
  16. {
  17. /**
  18. * Returns true if the command is currently enabled. An nsIControllerCommand
  19. * can implement more than one commands; say, a group of related commands
  20. * (e.g. delete left/delete right). Because of this, the command name is
  21. * passed to each method.
  22. *
  23. * @param aCommandName the name of the command for which we want the enabled
  24. * state.
  25. * @param aCommandContext a cookie held by the nsIControllerCommandTable,
  26. * allowing the command to get some context information.
  27. * The contents of this cookie are implementation-defined.
  28. */
  29. boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandContext);
  30. void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
  31. /**
  32. * Execute the name command.
  33. *
  34. * @param aCommandName the name of the command to execute.
  35. *
  36. * @param aCommandContext a cookie held by the nsIControllerCommandTable,
  37. * allowing the command to get some context information.
  38. * The contents of this cookie are implementation-defined.
  39. */
  40. void doCommand(in string aCommandName, in nsISupports aCommandContext);
  41. void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
  42. };