/embedding/components/build/nsEmbeddingModule.cpp

http://github.com/zpao/v8monkey · C++ · 139 lines · 93 code · 10 blank · 36 comment · 0 complexity · dac184b796b3673132eaa119f206c490 MD5 · raw file

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Netscape Communications Corporation.
  19. * Portions created by the Initial Developer are Copyright (C) 2001
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. *
  24. * Alternatively, the contents of this file may be used under the terms of
  25. * either the GNU General Public License Version 2 or later (the "GPL"), or
  26. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. * in which case the provisions of the GPL or the LGPL are applicable instead
  28. * of those above. If you wish to allow use of your version of this file only
  29. * under the terms of either the GPL or the LGPL, and not to allow others to
  30. * use your version of this file under the terms of the MPL, indicate your
  31. * decision by deleting the provisions above and replace them with the notice
  32. * and other provisions required by the GPL or the LGPL. If you do not delete
  33. * the provisions above, a recipient may use your version of this file under
  34. * the terms of any one of the MPL, the GPL or the LGPL.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. #include "mozilla/ModuleUtils.h"
  38. #include "nsDialogParamBlock.h"
  39. #include "nsWindowWatcher.h"
  40. #include "nsAppStartupNotifier.h"
  41. #include "nsFind.h"
  42. #include "nsWebBrowserFind.h"
  43. #include "nsWebBrowserPersist.h"
  44. #include "nsCommandManager.h"
  45. #include "nsControllerCommandTable.h"
  46. #include "nsCommandParams.h"
  47. #include "nsCommandGroup.h"
  48. #include "nsBaseCommandController.h"
  49. #include "nsNetCID.h"
  50. #include "nsEmbedCID.h"
  51. #ifdef NS_PRINTING
  52. #include "nsPrintingPromptService.h"
  53. #endif
  54. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowWatcher, Init)
  55. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppStartupNotifier)
  56. NS_GENERIC_FACTORY_CONSTRUCTOR(nsFind)
  57. NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserFind)
  58. NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserPersist)
  59. NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandTable)
  60. NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandManager)
  61. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCommandParams, Init)
  62. NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandGroup)
  63. NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController)
  64. #ifdef MOZ_XUL
  65. NS_GENERIC_FACTORY_CONSTRUCTOR(nsDialogParamBlock)
  66. #ifdef NS_PRINTING
  67. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintingPromptService, Init)
  68. #endif
  69. #endif
  70. #ifdef MOZ_XUL
  71. NS_DEFINE_NAMED_CID(NS_DIALOGPARAMBLOCK_CID);
  72. #ifdef NS_PRINTING
  73. NS_DEFINE_NAMED_CID(NS_PRINTINGPROMPTSERVICE_CID);
  74. #endif
  75. #endif
  76. NS_DEFINE_NAMED_CID(NS_WINDOWWATCHER_CID);
  77. NS_DEFINE_NAMED_CID(NS_FIND_CID);
  78. NS_DEFINE_NAMED_CID(NS_WEB_BROWSER_FIND_CID);
  79. NS_DEFINE_NAMED_CID(NS_APPSTARTUPNOTIFIER_CID);
  80. NS_DEFINE_NAMED_CID(NS_WEBBROWSERPERSIST_CID);
  81. NS_DEFINE_NAMED_CID(NS_CONTROLLERCOMMANDTABLE_CID);
  82. NS_DEFINE_NAMED_CID(NS_COMMAND_MANAGER_CID);
  83. NS_DEFINE_NAMED_CID(NS_COMMAND_PARAMS_CID);
  84. NS_DEFINE_NAMED_CID(NS_CONTROLLER_COMMAND_GROUP_CID);
  85. NS_DEFINE_NAMED_CID(NS_BASECOMMANDCONTROLLER_CID);
  86. static const mozilla::Module::CIDEntry kEmbeddingCIDs[] = {
  87. #ifdef MOZ_XUL
  88. { &kNS_DIALOGPARAMBLOCK_CID, false, NULL, nsDialogParamBlockConstructor },
  89. #ifdef NS_PRINTING
  90. { &kNS_PRINTINGPROMPTSERVICE_CID, false, NULL, nsPrintingPromptServiceConstructor },
  91. #endif
  92. #endif
  93. { &kNS_WINDOWWATCHER_CID, false, NULL, nsWindowWatcherConstructor },
  94. { &kNS_FIND_CID, false, NULL, nsFindConstructor },
  95. { &kNS_WEB_BROWSER_FIND_CID, false, NULL, nsWebBrowserFindConstructor },
  96. { &kNS_APPSTARTUPNOTIFIER_CID, false, NULL, nsAppStartupNotifierConstructor },
  97. { &kNS_WEBBROWSERPERSIST_CID, false, NULL, nsWebBrowserPersistConstructor },
  98. { &kNS_CONTROLLERCOMMANDTABLE_CID, false, NULL, nsControllerCommandTableConstructor },
  99. { &kNS_COMMAND_MANAGER_CID, false, NULL, nsCommandManagerConstructor },
  100. { &kNS_COMMAND_PARAMS_CID, false, NULL, nsCommandParamsConstructor },
  101. { &kNS_CONTROLLER_COMMAND_GROUP_CID, false, NULL, nsControllerCommandGroupConstructor },
  102. { &kNS_BASECOMMANDCONTROLLER_CID, false, NULL, nsBaseCommandControllerConstructor },
  103. { NULL }
  104. };
  105. static const mozilla::Module::ContractIDEntry kEmbeddingContracts[] = {
  106. #ifdef MOZ_XUL
  107. { NS_DIALOGPARAMBLOCK_CONTRACTID, &kNS_DIALOGPARAMBLOCK_CID },
  108. #ifdef NS_PRINTING
  109. { NS_PRINTINGPROMPTSERVICE_CONTRACTID, &kNS_PRINTINGPROMPTSERVICE_CID },
  110. #endif
  111. #endif
  112. { NS_WINDOWWATCHER_CONTRACTID, &kNS_WINDOWWATCHER_CID },
  113. { NS_FIND_CONTRACTID, &kNS_FIND_CID },
  114. { NS_WEB_BROWSER_FIND_CONTRACTID, &kNS_WEB_BROWSER_FIND_CID },
  115. { NS_APPSTARTUPNOTIFIER_CONTRACTID, &kNS_APPSTARTUPNOTIFIER_CID },
  116. { NS_WEBBROWSERPERSIST_CONTRACTID, &kNS_WEBBROWSERPERSIST_CID },
  117. { NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &kNS_CONTROLLERCOMMANDTABLE_CID },
  118. { NS_COMMAND_MANAGER_CONTRACTID, &kNS_COMMAND_MANAGER_CID },
  119. { NS_COMMAND_PARAMS_CONTRACTID, &kNS_COMMAND_PARAMS_CID },
  120. { NS_CONTROLLER_COMMAND_GROUP_CONTRACTID, &kNS_CONTROLLER_COMMAND_GROUP_CID },
  121. { NS_BASECOMMANDCONTROLLER_CONTRACTID, &kNS_BASECOMMANDCONTROLLER_CID },
  122. { NULL }
  123. };
  124. static const mozilla::Module kEmbeddingModule = {
  125. mozilla::Module::kVersion,
  126. kEmbeddingCIDs,
  127. kEmbeddingContracts
  128. };
  129. NSMODULE_DEFN(embedcomponents) = &kEmbeddingModule;