PageRenderTime 878ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/appcomps/nsICmdLineHandler.h

http://kmbrasil.codeplex.com
C++ Header | 296 lines | 226 code | 37 blank | 33 comment | 9 complexity | 25f0173136b1061bf29e8fb24a6227ee MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/xpfe/components/startup/public/nsICmdLineHandler.idl
  3. */
  4. #ifndef __gen_nsICmdLineHandler_h__
  5. #define __gen_nsICmdLineHandler_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. #define COMMAND_LINE_ARGUMENT_HANDLERS "command-line-argument-handlers"
  14. #define PREF_STARTUP_PREFIX "general.startup."
  15. #include "nsCOMPtr.h"
  16. #include "nsIComponentManager.h"
  17. #include "nsICategoryManager.h"
  18. #include "nsIFile.h"
  19. #include "nsIServiceManager.h"
  20. struct nsModuleComponentInfo; // forward declaration
  21. #define CMDLINEHANDLER_REGISTERPROC_DECLS \
  22. static NS_METHOD RegisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info); \
  23. static NS_METHOD UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const nsModuleComponentInfo *info);
  24. #define CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
  25. NS_IMETHODIMP macro_class::GetDefaultArgs(PRUnichar **aDefaultArgs) \
  26. { \
  27. if (!aDefaultArgs) return NS_ERROR_FAILURE; \
  28. *aDefaultArgs = ToNewUnicode(nsDependentCString(macro_default_args)); \
  29. return NS_OK; \
  30. }
  31. #define CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)\
  32. NS_IMETHODIMP macro_class::GetChromeUrlForTask(char **aChromeUrlForTask) \
  33. { \
  34. if (!aChromeUrlForTask) return NS_ERROR_FAILURE; \
  35. *aChromeUrlForTask = PL_strdup(macro_chrome_url); \
  36. return NS_OK; \
  37. }
  38. #define CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_handles_args, macro_open_window_with_args)\
  39. NS_IMETHODIMP macro_class::GetCommandLineArgument(char **aCommandLineArgument) \
  40. { \
  41. if (!aCommandLineArgument) return NS_ERROR_FAILURE; \
  42. *aCommandLineArgument = PL_strdup(macro_cmd_line_arg); \
  43. return NS_OK; \
  44. } \
  45. NS_IMETHODIMP macro_class::GetPrefNameForStartup(char **aPrefNameForStartup) \
  46. { \
  47. if (!aPrefNameForStartup) return NS_ERROR_FAILURE; \
  48. *aPrefNameForStartup = PL_strdup(macro_pref_name); \
  49. return NS_OK; \
  50. } \
  51. NS_IMETHODIMP macro_class::GetHelpText(char **aHelpText) \
  52. { \
  53. if (!aHelpText) return NS_ERROR_FAILURE; \
  54. *aHelpText = PL_strdup(macro_help_text); \
  55. return NS_OK; \
  56. } \
  57. NS_IMETHODIMP macro_class::GetHandlesArgs(PRBool *aHandlesArgs) \
  58. { \
  59. if (!aHandlesArgs) return NS_ERROR_FAILURE; \
  60. *aHandlesArgs = macro_handles_args; \
  61. return NS_OK; \
  62. } \
  63. NS_IMETHODIMP macro_class::GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs) \
  64. { \
  65. if (!aOpenWindowWithArgs) return NS_ERROR_FAILURE; \
  66. *aOpenWindowWithArgs = macro_open_window_with_args; \
  67. return NS_OK; \
  68. }
  69. #define CMDLINEHANDLER_REGISTERPROC_IMPL(macro_class, \
  70. macro_pretty_name, \
  71. macro_contractid) \
  72. NS_METHOD macro_class::RegisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info) \
  73. { \
  74. nsresult rv; \
  75. nsCOMPtr<nsICategoryManager> catman = do_GetService("@mozilla.org/categorymanager;1", &rv); \
  76. if (NS_FAILED(rv)) return rv; \
  77. nsXPIDLCString prevEntry; \
  78. rv = catman->AddCategoryEntry(COMMAND_LINE_ARGUMENT_HANDLERS, macro_pretty_name, macro_contractid, PR_TRUE, PR_TRUE, getter_Copies(prevEntry)); \
  79. return NS_OK; \
  80. } \
  81. NS_METHOD macro_class::UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const nsModuleComponentInfo *info) \
  82. { \
  83. nsresult rv; \
  84. nsCOMPtr<nsICategoryManager> catman = do_GetService("@mozilla.org/categorymanager;1", &rv); \
  85. if (NS_FAILED(rv)) return rv; \
  86. rv = catman->DeleteCategoryEntry(COMMAND_LINE_ARGUMENT_HANDLERS, macro_contractid, PR_TRUE); \
  87. return NS_OK; \
  88. }
  89. // basic definition
  90. #define CMDLINEHANDLER1_IMPL(macro_class, \
  91. macro_cmd_line_arg, \
  92. macro_pref_name, \
  93. macro_help_text, \
  94. macro_handles_args, \
  95. macro_default_args, \
  96. macro_open_window_with_args)\
  97. CMDLINEHANDLER_OTHERS_IMPL(macro_class, macro_cmd_line_arg,macro_pref_name,\
  98. macro_help_text, macro_handles_args, \
  99. macro_open_window_with_args)
  100. // provides everything above, plus GetChromeUrl and regproc stuff
  101. #define CMDLINEHANDLER2_IMPL(macro_class, \
  102. macro_cmd_line_arg, \
  103. macro_pref_name, \
  104. macro_chrome_url, \
  105. macro_help_text, \
  106. macro_contractid, \
  107. macro_pretty_name, \
  108. macro_handles_args, \
  109. macro_open_window_with_args) \
  110. CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,\
  111. macro_help_text, macro_handles_args, \
  112. macro_open_window_with_args) \
  113. CMDLINEHANDLER_REGISTERPROC_IMPL(macro_class, macro_pretty_name, \
  114. macro_contractid) \
  115. CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)
  116. // deprecated: includes everything above, plus getdefaultargs
  117. #define CMDLINEHANDLER_IMPL(macro_class, \
  118. macro_cmd_line_arg,\
  119. macro_pref_name, \
  120. macro_chrome_url,\
  121. macro_help_text, \
  122. macro_contractid, \
  123. macro_pretty_name, \
  124. macro_handles_args, \
  125. macro_default_args, \
  126. macro_open_window_with_args) \
  127. CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args) \
  128. CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name, \
  129. macro_chrome_url,macro_help_text, macro_contractid, \
  130. macro_pretty_name, macro_handles_args, \
  131. macro_open_window_with_args)
  132. //Creates a version without the GetChromeUrlForTaskFunction
  133. #define CMDLINEHANDLER3_IMPL(macro_class, \
  134. macro_cmd_line_arg, \
  135. macro_pref_name, \
  136. macro_help_text, \
  137. macro_contractid, \
  138. macro_pretty_name, \
  139. macro_handles_args, \
  140. macro_default_args, \
  141. macro_open_window_with_args)\
  142. CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
  143. CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,\
  144. macro_help_text, macro_handles_args, \
  145. macro_open_window_with_args) \
  146. CMDLINEHANDLER_REGISTERPROC_IMPL(macro_class, macro_pretty_name, \
  147. macro_contractid)
  148. /* starting interface: nsICmdLineHandler */
  149. #define NS_ICMDLINEHANDLER_IID_STR "ae12670a-1dd1-11b2-80cd-82ec93559deb"
  150. #define NS_ICMDLINEHANDLER_IID \
  151. {0xae12670a, 0x1dd1, 0x11b2, \
  152. { 0x80, 0xcd, 0x82, 0xec, 0x93, 0x55, 0x9d, 0xeb }}
  153. class NS_NO_VTABLE nsICmdLineHandler : public nsISupports {
  154. public:
  155. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICMDLINEHANDLER_IID)
  156. /* readonly attribute string commandLineArgument; */
  157. NS_IMETHOD GetCommandLineArgument(char * *aCommandLineArgument) = 0;
  158. /* readonly attribute string prefNameForStartup; */
  159. NS_IMETHOD GetPrefNameForStartup(char * *aPrefNameForStartup) = 0;
  160. /* readonly attribute string chromeUrlForTask; */
  161. NS_IMETHOD GetChromeUrlForTask(char * *aChromeUrlForTask) = 0;
  162. /* readonly attribute string helpText; */
  163. NS_IMETHOD GetHelpText(char * *aHelpText) = 0;
  164. /* readonly attribute boolean handlesArgs; */
  165. NS_IMETHOD GetHandlesArgs(PRBool *aHandlesArgs) = 0;
  166. /* readonly attribute wstring defaultArgs; */
  167. NS_IMETHOD GetDefaultArgs(PRUnichar * *aDefaultArgs) = 0;
  168. /* readonly attribute boolean openWindowWithArgs; */
  169. NS_IMETHOD GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs) = 0;
  170. };
  171. /* Use this macro when declaring classes that implement this interface. */
  172. #define NS_DECL_NSICMDLINEHANDLER \
  173. NS_IMETHOD GetCommandLineArgument(char * *aCommandLineArgument); \
  174. NS_IMETHOD GetPrefNameForStartup(char * *aPrefNameForStartup); \
  175. NS_IMETHOD GetChromeUrlForTask(char * *aChromeUrlForTask); \
  176. NS_IMETHOD GetHelpText(char * *aHelpText); \
  177. NS_IMETHOD GetHandlesArgs(PRBool *aHandlesArgs); \
  178. NS_IMETHOD GetDefaultArgs(PRUnichar * *aDefaultArgs); \
  179. NS_IMETHOD GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs);
  180. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  181. #define NS_FORWARD_NSICMDLINEHANDLER(_to) \
  182. NS_IMETHOD GetCommandLineArgument(char * *aCommandLineArgument) { return _to GetCommandLineArgument(aCommandLineArgument); } \
  183. NS_IMETHOD GetPrefNameForStartup(char * *aPrefNameForStartup) { return _to GetPrefNameForStartup(aPrefNameForStartup); } \
  184. NS_IMETHOD GetChromeUrlForTask(char * *aChromeUrlForTask) { return _to GetChromeUrlForTask(aChromeUrlForTask); } \
  185. NS_IMETHOD GetHelpText(char * *aHelpText) { return _to GetHelpText(aHelpText); } \
  186. NS_IMETHOD GetHandlesArgs(PRBool *aHandlesArgs) { return _to GetHandlesArgs(aHandlesArgs); } \
  187. NS_IMETHOD GetDefaultArgs(PRUnichar * *aDefaultArgs) { return _to GetDefaultArgs(aDefaultArgs); } \
  188. NS_IMETHOD GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs) { return _to GetOpenWindowWithArgs(aOpenWindowWithArgs); }
  189. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  190. #define NS_FORWARD_SAFE_NSICMDLINEHANDLER(_to) \
  191. NS_IMETHOD GetCommandLineArgument(char * *aCommandLineArgument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommandLineArgument(aCommandLineArgument); } \
  192. NS_IMETHOD GetPrefNameForStartup(char * *aPrefNameForStartup) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrefNameForStartup(aPrefNameForStartup); } \
  193. NS_IMETHOD GetChromeUrlForTask(char * *aChromeUrlForTask) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChromeUrlForTask(aChromeUrlForTask); } \
  194. NS_IMETHOD GetHelpText(char * *aHelpText) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHelpText(aHelpText); } \
  195. NS_IMETHOD GetHandlesArgs(PRBool *aHandlesArgs) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHandlesArgs(aHandlesArgs); } \
  196. NS_IMETHOD GetDefaultArgs(PRUnichar * *aDefaultArgs) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultArgs(aDefaultArgs); } \
  197. NS_IMETHOD GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOpenWindowWithArgs(aOpenWindowWithArgs); }
  198. #if 0
  199. /* Use the code below as a template for the implementation class for this interface. */
  200. /* Header file */
  201. class nsCmdLineHandler : public nsICmdLineHandler
  202. {
  203. public:
  204. NS_DECL_ISUPPORTS
  205. NS_DECL_NSICMDLINEHANDLER
  206. nsCmdLineHandler();
  207. private:
  208. ~nsCmdLineHandler();
  209. protected:
  210. /* additional members */
  211. };
  212. /* Implementation file */
  213. NS_IMPL_ISUPPORTS1(nsCmdLineHandler, nsICmdLineHandler)
  214. nsCmdLineHandler::nsCmdLineHandler()
  215. {
  216. /* member initializers and constructor code */
  217. }
  218. nsCmdLineHandler::~nsCmdLineHandler()
  219. {
  220. /* destructor code */
  221. }
  222. /* readonly attribute string commandLineArgument; */
  223. NS_IMETHODIMP nsCmdLineHandler::GetCommandLineArgument(char * *aCommandLineArgument)
  224. {
  225. return NS_ERROR_NOT_IMPLEMENTED;
  226. }
  227. /* readonly attribute string prefNameForStartup; */
  228. NS_IMETHODIMP nsCmdLineHandler::GetPrefNameForStartup(char * *aPrefNameForStartup)
  229. {
  230. return NS_ERROR_NOT_IMPLEMENTED;
  231. }
  232. /* readonly attribute string chromeUrlForTask; */
  233. NS_IMETHODIMP nsCmdLineHandler::GetChromeUrlForTask(char * *aChromeUrlForTask)
  234. {
  235. return NS_ERROR_NOT_IMPLEMENTED;
  236. }
  237. /* readonly attribute string helpText; */
  238. NS_IMETHODIMP nsCmdLineHandler::GetHelpText(char * *aHelpText)
  239. {
  240. return NS_ERROR_NOT_IMPLEMENTED;
  241. }
  242. /* readonly attribute boolean handlesArgs; */
  243. NS_IMETHODIMP nsCmdLineHandler::GetHandlesArgs(PRBool *aHandlesArgs)
  244. {
  245. return NS_ERROR_NOT_IMPLEMENTED;
  246. }
  247. /* readonly attribute wstring defaultArgs; */
  248. NS_IMETHODIMP nsCmdLineHandler::GetDefaultArgs(PRUnichar * *aDefaultArgs)
  249. {
  250. return NS_ERROR_NOT_IMPLEMENTED;
  251. }
  252. /* readonly attribute boolean openWindowWithArgs; */
  253. NS_IMETHODIMP nsCmdLineHandler::GetOpenWindowWithArgs(PRBool *aOpenWindowWithArgs)
  254. {
  255. return NS_ERROR_NOT_IMPLEMENTED;
  256. }
  257. /* End of implementation class template. */
  258. #endif
  259. #endif /* __gen_nsICmdLineHandler_h__ */