PageRenderTime 27ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/commandhandler/nsIControllerCommandTable.h

#
C Header | 265 lines | 130 code | 45 blank | 90 comment | 0 complexity | 93041705679325f59b06004cde80d9cf MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/embedding/components/commandhandler/public/nsIControllerCommandTable.idl
  3. */
  4. #ifndef __gen_nsIControllerCommandTable_h__
  5. #define __gen_nsIControllerCommandTable_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. #ifndef __gen_nsIControllerCommand_h__
  10. #include "nsIControllerCommand.h"
  11. #endif
  12. #ifndef __gen_nsICommandParams_h__
  13. #include "nsICommandParams.h"
  14. #endif
  15. /* For IDL files that don't want to include root IDL files. */
  16. #ifndef NS_NO_VTABLE
  17. #define NS_NO_VTABLE
  18. #endif
  19. /* starting interface: nsIControllerCommandTable */
  20. #define NS_ICONTROLLERCOMMANDTABLE_IID_STR "d1a47834-6ad4-11d7-bfad-000393636592"
  21. #define NS_ICONTROLLERCOMMANDTABLE_IID \
  22. {0xd1a47834, 0x6ad4, 0x11d7, \
  23. { 0xbf, 0xad, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 }}
  24. /**
  25. * nsIControllerCommandTable
  26. *
  27. * An interface via which a controller can maintain a series of commands,
  28. * and efficiently dispatch commands to their respective handlers.
  29. *
  30. * Controllers that use an nsIControllerCommandTable should support
  31. * nsIInterfaceRequestor, and be able to return an interface to their
  32. * controller command table via getInterface().
  33. *
  34. */
  35. class NS_NO_VTABLE nsIControllerCommandTable : public nsISupports {
  36. public:
  37. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTROLLERCOMMANDTABLE_IID)
  38. /**
  39. * Make this command table immutable, so that commands cannot
  40. * be registered or unregistered. Some command tables are made
  41. * mutable after command registration so that they can be
  42. * used as singletons.
  43. */
  44. /* void makeImmutable (); */
  45. NS_IMETHOD MakeImmutable(void) = 0;
  46. /**
  47. * Register and unregister commands with the command table.
  48. *
  49. * @param aCommandName the name of the command under which to register or
  50. * unregister the given command handler.
  51. *
  52. * @param aCommand the handler for this command.
  53. */
  54. /* void registerCommand (in string aCommandName, in nsIControllerCommand aCommand); */
  55. NS_IMETHOD RegisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) = 0;
  56. /* void unregisterCommand (in string aCommandName, in nsIControllerCommand aCommand); */
  57. NS_IMETHOD UnregisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) = 0;
  58. /**
  59. * Find the command handler which has been registered to handle the named command.
  60. *
  61. * @param aCommandName the name of the command to find the handler for.
  62. */
  63. /* nsIControllerCommand findCommandHandler (in string aCommandName); */
  64. NS_IMETHOD FindCommandHandler(const char *aCommandName, nsIControllerCommand **_retval) = 0;
  65. /**
  66. * Get whether the named command is enabled.
  67. *
  68. * @param aCommandName the name of the command to test
  69. * @param aCommandRefCon the command context data
  70. */
  71. /* boolean isCommandEnabled (in string aCommandName, in nsISupports aCommandRefCon); */
  72. NS_IMETHOD IsCommandEnabled(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) = 0;
  73. /**
  74. * Tell the command to udpate its state (if it is a state updating command)
  75. *
  76. * @param aCommandName the name of the command to update
  77. * @param aCommandRefCon the command context data
  78. */
  79. /* void updateCommandState (in string aCommandName, in nsISupports aCommandRefCon); */
  80. NS_IMETHOD UpdateCommandState(const char *aCommandName, nsISupports *aCommandRefCon) = 0;
  81. /**
  82. * Get whether the named command is supported.
  83. *
  84. * @param aCommandName the name of the command to test
  85. * @param aCommandRefCon the command context data
  86. */
  87. /* boolean supportsCommand (in string aCommandName, in nsISupports aCommandRefCon); */
  88. NS_IMETHOD SupportsCommand(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) = 0;
  89. /**
  90. * Execute the named command.
  91. *
  92. * @param aCommandName the name of the command to execute
  93. * @param aCommandRefCon the command context data
  94. */
  95. /* void doCommand (in string aCommandName, in nsISupports aCommandRefCon); */
  96. NS_IMETHOD DoCommand(const char *aCommandName, nsISupports *aCommandRefCon) = 0;
  97. /* void doCommandParams (in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon); */
  98. NS_IMETHOD DoCommandParams(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) = 0;
  99. /* void getCommandState (in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon); */
  100. NS_IMETHOD GetCommandState(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) = 0;
  101. };
  102. /* Use this macro when declaring classes that implement this interface. */
  103. #define NS_DECL_NSICONTROLLERCOMMANDTABLE \
  104. NS_IMETHOD MakeImmutable(void); \
  105. NS_IMETHOD RegisterCommand(const char *aCommandName, nsIControllerCommand *aCommand); \
  106. NS_IMETHOD UnregisterCommand(const char *aCommandName, nsIControllerCommand *aCommand); \
  107. NS_IMETHOD FindCommandHandler(const char *aCommandName, nsIControllerCommand **_retval); \
  108. NS_IMETHOD IsCommandEnabled(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval); \
  109. NS_IMETHOD UpdateCommandState(const char *aCommandName, nsISupports *aCommandRefCon); \
  110. NS_IMETHOD SupportsCommand(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval); \
  111. NS_IMETHOD DoCommand(const char *aCommandName, nsISupports *aCommandRefCon); \
  112. NS_IMETHOD DoCommandParams(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon); \
  113. NS_IMETHOD GetCommandState(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon);
  114. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  115. #define NS_FORWARD_NSICONTROLLERCOMMANDTABLE(_to) \
  116. NS_IMETHOD MakeImmutable(void) { return _to MakeImmutable(); } \
  117. NS_IMETHOD RegisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) { return _to RegisterCommand(aCommandName, aCommand); } \
  118. NS_IMETHOD UnregisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) { return _to UnregisterCommand(aCommandName, aCommand); } \
  119. NS_IMETHOD FindCommandHandler(const char *aCommandName, nsIControllerCommand **_retval) { return _to FindCommandHandler(aCommandName, _retval); } \
  120. NS_IMETHOD IsCommandEnabled(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) { return _to IsCommandEnabled(aCommandName, aCommandRefCon, _retval); } \
  121. NS_IMETHOD UpdateCommandState(const char *aCommandName, nsISupports *aCommandRefCon) { return _to UpdateCommandState(aCommandName, aCommandRefCon); } \
  122. NS_IMETHOD SupportsCommand(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) { return _to SupportsCommand(aCommandName, aCommandRefCon, _retval); } \
  123. NS_IMETHOD DoCommand(const char *aCommandName, nsISupports *aCommandRefCon) { return _to DoCommand(aCommandName, aCommandRefCon); } \
  124. NS_IMETHOD DoCommandParams(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) { return _to DoCommandParams(aCommandName, aParam, aCommandRefCon); } \
  125. NS_IMETHOD GetCommandState(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) { return _to GetCommandState(aCommandName, aParam, aCommandRefCon); }
  126. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  127. #define NS_FORWARD_SAFE_NSICONTROLLERCOMMANDTABLE(_to) \
  128. NS_IMETHOD MakeImmutable(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->MakeImmutable(); } \
  129. NS_IMETHOD RegisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterCommand(aCommandName, aCommand); } \
  130. NS_IMETHOD UnregisterCommand(const char *aCommandName, nsIControllerCommand *aCommand) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterCommand(aCommandName, aCommand); } \
  131. NS_IMETHOD FindCommandHandler(const char *aCommandName, nsIControllerCommand **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCommandHandler(aCommandName, _retval); } \
  132. NS_IMETHOD IsCommandEnabled(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCommandEnabled(aCommandName, aCommandRefCon, _retval); } \
  133. NS_IMETHOD UpdateCommandState(const char *aCommandName, nsISupports *aCommandRefCon) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateCommandState(aCommandName, aCommandRefCon); } \
  134. NS_IMETHOD SupportsCommand(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SupportsCommand(aCommandName, aCommandRefCon, _retval); } \
  135. NS_IMETHOD DoCommand(const char *aCommandName, nsISupports *aCommandRefCon) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoCommand(aCommandName, aCommandRefCon); } \
  136. NS_IMETHOD DoCommandParams(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoCommandParams(aCommandName, aParam, aCommandRefCon); } \
  137. NS_IMETHOD GetCommandState(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommandState(aCommandName, aParam, aCommandRefCon); }
  138. #if 0
  139. /* Use the code below as a template for the implementation class for this interface. */
  140. /* Header file */
  141. class nsControllerCommandTable : public nsIControllerCommandTable
  142. {
  143. public:
  144. NS_DECL_ISUPPORTS
  145. NS_DECL_NSICONTROLLERCOMMANDTABLE
  146. nsControllerCommandTable();
  147. private:
  148. ~nsControllerCommandTable();
  149. protected:
  150. /* additional members */
  151. };
  152. /* Implementation file */
  153. NS_IMPL_ISUPPORTS1(nsControllerCommandTable, nsIControllerCommandTable)
  154. nsControllerCommandTable::nsControllerCommandTable()
  155. {
  156. /* member initializers and constructor code */
  157. }
  158. nsControllerCommandTable::~nsControllerCommandTable()
  159. {
  160. /* destructor code */
  161. }
  162. /* void makeImmutable (); */
  163. NS_IMETHODIMP nsControllerCommandTable::MakeImmutable()
  164. {
  165. return NS_ERROR_NOT_IMPLEMENTED;
  166. }
  167. /* void registerCommand (in string aCommandName, in nsIControllerCommand aCommand); */
  168. NS_IMETHODIMP nsControllerCommandTable::RegisterCommand(const char *aCommandName, nsIControllerCommand *aCommand)
  169. {
  170. return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172. /* void unregisterCommand (in string aCommandName, in nsIControllerCommand aCommand); */
  173. NS_IMETHODIMP nsControllerCommandTable::UnregisterCommand(const char *aCommandName, nsIControllerCommand *aCommand)
  174. {
  175. return NS_ERROR_NOT_IMPLEMENTED;
  176. }
  177. /* nsIControllerCommand findCommandHandler (in string aCommandName); */
  178. NS_IMETHODIMP nsControllerCommandTable::FindCommandHandler(const char *aCommandName, nsIControllerCommand **_retval)
  179. {
  180. return NS_ERROR_NOT_IMPLEMENTED;
  181. }
  182. /* boolean isCommandEnabled (in string aCommandName, in nsISupports aCommandRefCon); */
  183. NS_IMETHODIMP nsControllerCommandTable::IsCommandEnabled(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval)
  184. {
  185. return NS_ERROR_NOT_IMPLEMENTED;
  186. }
  187. /* void updateCommandState (in string aCommandName, in nsISupports aCommandRefCon); */
  188. NS_IMETHODIMP nsControllerCommandTable::UpdateCommandState(const char *aCommandName, nsISupports *aCommandRefCon)
  189. {
  190. return NS_ERROR_NOT_IMPLEMENTED;
  191. }
  192. /* boolean supportsCommand (in string aCommandName, in nsISupports aCommandRefCon); */
  193. NS_IMETHODIMP nsControllerCommandTable::SupportsCommand(const char *aCommandName, nsISupports *aCommandRefCon, PRBool *_retval)
  194. {
  195. return NS_ERROR_NOT_IMPLEMENTED;
  196. }
  197. /* void doCommand (in string aCommandName, in nsISupports aCommandRefCon); */
  198. NS_IMETHODIMP nsControllerCommandTable::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
  199. {
  200. return NS_ERROR_NOT_IMPLEMENTED;
  201. }
  202. /* void doCommandParams (in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon); */
  203. NS_IMETHODIMP nsControllerCommandTable::DoCommandParams(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon)
  204. {
  205. return NS_ERROR_NOT_IMPLEMENTED;
  206. }
  207. /* void getCommandState (in string aCommandName, in nsICommandParams aParam, in nsISupports aCommandRefCon); */
  208. NS_IMETHODIMP nsControllerCommandTable::GetCommandState(const char *aCommandName, nsICommandParams *aParam, nsISupports *aCommandRefCon)
  209. {
  210. return NS_ERROR_NOT_IMPLEMENTED;
  211. }
  212. /* End of implementation class template. */
  213. #endif
  214. // {670ee5da-6ad5-11d7-9950-000393636592}
  215. #define NS_CONTROLLERCOMMANDTABLE_CID \
  216. {0x670ee5da, 0x6ad5, 0x11d7, \
  217. { 0x99, 0x50, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 }}
  218. #define NS_CONTROLLERCOMMANDTABLE_CONTRACTID \
  219. "@mozilla.org/embedcomp/controller-command-table;1"
  220. #endif /* __gen_nsIControllerCommandTable_h__ */