1 : /* ***** BEGIN LICENSE BLOCK *****
2 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 : *
4 : * The contents of this file are subject to the Mozilla Public License Version
5 : * 1.1 (the "License"); you may not use this file except in compliance with
6 : * the License. You may obtain a copy of the License at
7 : * http://www.mozilla.org/MPL/
8 : *
9 : * Software distributed under the License is distributed on an "AS IS" basis,
10 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 : * for the specific language governing rights and limitations under the
12 : * License.
13 : *
14 : * The Original Code is mozilla.org code.
15 : *
16 : * The Initial Developer of the Original Code is
17 : * Netscape Communications Corporation.
18 : * Portions created by the Initial Developer are Copyright (C) 2001
19 : * the Initial Developer. All Rights Reserved.
20 : *
21 : * Contributor(s):
22 : * Joe Hewitt <hewitt@netscape.com> (Original Author)
23 : * The Mozilla Foundation <http://www.mozilla.org>
24 : *
25 : * Alternatively, the contents of this file may be used under the terms of
26 : * either the GNU General Public License Version 2 or later (the "GPL"), or
27 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 : * in which case the provisions of the GPL or the LGPL are applicable instead
29 : * of those above. If you wish to allow use of your version of this file only
30 : * under the terms of either the GPL or the LGPL, and not to allow others to
31 : * use your version of this file under the terms of the MPL, indicate your
32 : * decision by deleting the provisions above and replace them with the notice
33 : * and other provisions required by the GPL or the LGPL. If you do not delete
34 : * the provisions above, a recipient may use your version of this file under
35 : * the terms of any one of the MPL, the GPL or the LGPL.
36 : *
37 : * ***** END LICENSE BLOCK ***** */
38 :
39 : #include "mozilla/ModuleUtils.h"
40 : #include "nsAppStartup.h"
41 : #include "nsUserInfo.h"
42 : #include "nsToolkitCompsCID.h"
43 : #include "nsFindService.h"
44 :
45 : #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
46 : #include "nsParentalControlsServiceWin.h"
47 : #endif
48 :
49 : #ifdef ALERTS_SERVICE
50 : #include "nsAlertsService.h"
51 : #endif
52 :
53 : #include "nsDownloadManager.h"
54 : #include "nsDownloadProxy.h"
55 : #include "nsCharsetMenu.h"
56 : #include "rdf.h"
57 :
58 : #include "nsTypeAheadFind.h"
59 :
60 : #ifdef MOZ_URL_CLASSIFIER
61 : #include "nsUrlClassifierDBService.h"
62 : #include "nsUrlClassifierStreamUpdater.h"
63 : #include "nsUrlClassifierUtils.h"
64 : #include "nsUrlClassifierPrefixSet.h"
65 : #endif
66 :
67 : #include "nsBrowserStatusFilter.h"
68 :
69 : /////////////////////////////////////////////////////////////////////////////
70 :
71 32 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup, Init)
72 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo)
73 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsFindService)
74 :
75 : #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
76 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsServiceWin)
77 : #endif
78 :
79 : #ifdef ALERTS_SERVICE
80 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
81 : #endif
82 :
83 35 : NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDownloadManager,
84 35 : nsDownloadManager::GetSingleton)
85 12 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
86 :
87 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
88 :
89 : #ifdef MOZ_URL_CLASSIFIER
90 12 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierPrefixSet)
91 16 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater)
92 10 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils, Init)
93 :
94 : static nsresult
95 8 : nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
96 : void **aResult)
97 : {
98 : nsresult rv;
99 8 : NS_ENSURE_ARG_POINTER(aResult);
100 8 : NS_ENSURE_NO_AGGREGATION(aOuter);
101 :
102 8 : nsUrlClassifierDBService *inst = nsUrlClassifierDBService::GetInstance(&rv);
103 8 : if (NULL == inst) {
104 0 : return rv;
105 : }
106 : /* NS_ADDREF(inst); */
107 8 : rv = inst->QueryInterface(aIID, aResult);
108 8 : NS_RELEASE(inst);
109 :
110 8 : return rv;
111 : }
112 : #endif
113 :
114 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
115 :
116 : NS_DEFINE_NAMED_CID(NS_TOOLKIT_APPSTARTUP_CID);
117 : NS_DEFINE_NAMED_CID(NS_USERINFO_CID);
118 : #ifdef ALERTS_SERVICE
119 : NS_DEFINE_NAMED_CID(NS_ALERTSSERVICE_CID);
120 : #endif
121 : #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
122 : NS_DEFINE_NAMED_CID(NS_PARENTALCONTROLSSERVICE_CID);
123 : #endif
124 : NS_DEFINE_NAMED_CID(NS_DOWNLOADMANAGER_CID);
125 : NS_DEFINE_NAMED_CID(NS_DOWNLOAD_CID);
126 : NS_DEFINE_NAMED_CID(NS_FIND_SERVICE_CID);
127 : NS_DEFINE_NAMED_CID(NS_TYPEAHEADFIND_CID);
128 : #ifdef MOZ_URL_CLASSIFIER
129 : NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERPREFIXSET_CID);
130 : NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERDBSERVICE_CID);
131 : NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
132 : NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID);
133 : #endif
134 : NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
135 : NS_DEFINE_NAMED_CID(NS_CHARSETMENU_CID);
136 :
137 : static const mozilla::Module::CIDEntry kToolkitCIDs[] = {
138 : { &kNS_TOOLKIT_APPSTARTUP_CID, false, NULL, nsAppStartupConstructor },
139 : { &kNS_USERINFO_CID, false, NULL, nsUserInfoConstructor },
140 : #ifdef ALERTS_SERVICE
141 : { &kNS_ALERTSSERVICE_CID, false, NULL, nsAlertsServiceConstructor },
142 : #endif
143 : #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
144 : { &kNS_PARENTALCONTROLSSERVICE_CID, false, NULL, nsParentalControlsServiceWinConstructor },
145 : #endif
146 : { &kNS_DOWNLOADMANAGER_CID, false, NULL, nsDownloadManagerConstructor },
147 : { &kNS_DOWNLOAD_CID, false, NULL, nsDownloadProxyConstructor },
148 : { &kNS_FIND_SERVICE_CID, false, NULL, nsFindServiceConstructor },
149 : { &kNS_TYPEAHEADFIND_CID, false, NULL, nsTypeAheadFindConstructor },
150 : #ifdef MOZ_URL_CLASSIFIER
151 : { &kNS_URLCLASSIFIERPREFIXSET_CID, false, NULL, nsUrlClassifierPrefixSetConstructor },
152 : { &kNS_URLCLASSIFIERDBSERVICE_CID, false, NULL, nsUrlClassifierDBServiceConstructor },
153 : { &kNS_URLCLASSIFIERSTREAMUPDATER_CID, false, NULL, nsUrlClassifierStreamUpdaterConstructor },
154 : { &kNS_URLCLASSIFIERUTILS_CID, false, NULL, nsUrlClassifierUtilsConstructor },
155 : #endif
156 : { &kNS_BROWSERSTATUSFILTER_CID, false, NULL, nsBrowserStatusFilterConstructor },
157 : { &kNS_CHARSETMENU_CID, false, NULL, NS_NewCharsetMenu },
158 : { NULL }
159 : };
160 :
161 : static const mozilla::Module::ContractIDEntry kToolkitContracts[] = {
162 : { NS_APPSTARTUP_CONTRACTID, &kNS_TOOLKIT_APPSTARTUP_CID },
163 : { NS_USERINFO_CONTRACTID, &kNS_USERINFO_CID },
164 : #ifdef ALERTS_SERVICE
165 : { NS_ALERTSERVICE_CONTRACTID, &kNS_ALERTSSERVICE_CID },
166 : #endif
167 : #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
168 : { NS_PARENTALCONTROLSSERVICE_CONTRACTID, &kNS_PARENTALCONTROLSSERVICE_CID },
169 : #endif
170 : { NS_DOWNLOADMANAGER_CONTRACTID, &kNS_DOWNLOADMANAGER_CID },
171 : { NS_TRANSFER_CONTRACTID, &kNS_DOWNLOAD_CID },
172 : { NS_FIND_SERVICE_CONTRACTID, &kNS_FIND_SERVICE_CID },
173 : { NS_TYPEAHEADFIND_CONTRACTID, &kNS_TYPEAHEADFIND_CID },
174 : #ifdef MOZ_URL_CLASSIFIER
175 : { NS_URLCLASSIFIERPREFIXSET_CONTRACTID, &kNS_URLCLASSIFIERPREFIXSET_CID },
176 : { NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
177 : { NS_URICLASSIFIERSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
178 : { NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID, &kNS_URLCLASSIFIERSTREAMUPDATER_CID },
179 : { NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID },
180 : #endif
181 : { NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID },
182 : { NS_RDF_DATASOURCE_CONTRACTID_PREFIX NS_CHARSETMENU_PID, &kNS_CHARSETMENU_CID },
183 : { NULL }
184 : };
185 :
186 : static const mozilla::Module kToolkitModule = {
187 : mozilla::Module::kVersion,
188 : kToolkitCIDs,
189 : kToolkitContracts
190 : };
191 :
192 : NSMODULE_DEFN(nsToolkitCompsModule) = &kToolkitModule;
|