1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
14 * The Original Code is mozilla.org code.
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.
22 * Joe Hewitt <hewitt@netscape.com> (Original Author)
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.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsIGenericFactory.h"
39 #include "nsAppStartup.h"
40 #include "nsUserInfo.h"
41 #include "nsXPFEComponentsCID.h"
42 #include "nsToolkitCompsCID.h"
44 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
45 #include "nsParentalControlsServiceWin.h"
49 #include "nsAlertsService.h"
52 #ifndef SUITE_USING_XPFE_DM
54 #include "nsDownloadManager.h"
55 #include "nsDownloadProxy.h"
59 #include "nsTypeAheadFind.h"
61 #ifdef MOZ_URL_CLASSIFIER
62 #include "nsUrlClassifierDBService.h"
63 #include "nsUrlClassifierStreamUpdater.h"
64 #include "nsUrlClassifierUtils.h"
65 #include "nsUrlClassifierHashCompleter.h"
66 #include "nsDocShellCID.h"
70 #include "nsScriptableUnescapeHTML.h"
73 /////////////////////////////////////////////////////////////////////////////
75 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup
, Init
)
76 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo
)
78 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
79 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsServiceWin
)
83 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService
)
86 #ifndef SUITE_USING_XPFE_DM
88 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDownloadManager
,
89 nsDownloadManager::GetSingleton
)
90 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy
)
94 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind
)
96 #ifdef MOZ_URL_CLASSIFIER
97 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater
)
98 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils
, Init
)
99 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierHashCompleter
, Init
)
102 nsUrlClassifierDBServiceConstructor(nsISupports
*aOuter
, REFNSIID aIID
,
106 NS_ENSURE_ARG_POINTER(aResult
);
107 NS_ENSURE_NO_AGGREGATION(aOuter
);
109 nsUrlClassifierDBService
*inst
= nsUrlClassifierDBService::GetInstance(&rv
);
113 /* NS_ADDREF(inst); */
114 rv
= inst
->QueryInterface(aIID
, aResult
);
122 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableUnescapeHTML
)
125 /////////////////////////////////////////////////////////////////////////////
127 static const nsModuleComponentInfo components
[] =
129 { "App Startup Service",
130 NS_TOOLKIT_APPSTARTUP_CID
,
131 NS_APPSTARTUP_CONTRACTID
,
132 nsAppStartupConstructor
},
134 { "User Info Service",
136 NS_USERINFO_CONTRACTID
,
137 nsUserInfoConstructor
},
138 #ifdef ALERTS_SERVICE
140 NS_ALERTSSERVICE_CID
,
141 NS_ALERTSERVICE_CONTRACTID
,
142 nsAlertsServiceConstructor
},
144 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
145 { "Parental Controls Service",
146 NS_PARENTALCONTROLSSERVICE_CID
,
147 NS_PARENTALCONTROLSSERVICE_CONTRACTID
,
148 nsParentalControlsServiceWinConstructor
},
150 #ifndef SUITE_USING_XPFE_DM
152 { "Download Manager",
153 NS_DOWNLOADMANAGER_CID
,
154 NS_DOWNLOADMANAGER_CONTRACTID
,
155 nsDownloadManagerConstructor
},
158 NS_TRANSFER_CONTRACTID
,
159 nsDownloadProxyConstructor
},
162 { "TypeAheadFind Component",
163 NS_TYPEAHEADFIND_CID
,
164 NS_TYPEAHEADFIND_CONTRACTID
,
165 nsTypeAheadFindConstructor
167 #ifdef MOZ_URL_CLASSIFIER
168 { "Url Classifier DB Service",
169 NS_URLCLASSIFIERDBSERVICE_CID
,
170 NS_URLCLASSIFIERDBSERVICE_CONTRACTID
,
171 nsUrlClassifierDBServiceConstructor
},
172 { "Url Classifier DB Service",
173 NS_URLCLASSIFIERDBSERVICE_CID
,
174 NS_URICLASSIFIERSERVICE_CONTRACTID
,
175 nsUrlClassifierDBServiceConstructor
},
176 { "Url Classifier Stream Updater",
177 NS_URLCLASSIFIERSTREAMUPDATER_CID
,
178 NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID
,
179 nsUrlClassifierStreamUpdaterConstructor
},
180 { "Url Classifier Utils",
181 NS_URLCLASSIFIERUTILS_CID
,
182 NS_URLCLASSIFIERUTILS_CONTRACTID
,
183 nsUrlClassifierUtilsConstructor
},
184 { "Url Classifier Hash Completer",
185 NS_URLCLASSIFIERHASHCOMPLETER_CID
,
186 NS_URLCLASSIFIERHASHCOMPLETER_CONTRACTID
,
187 nsUrlClassifierHashCompleterConstructor
},
191 NS_SCRIPTABLEUNESCAPEHTML_CID
,
192 NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID
,
193 nsScriptableUnescapeHTMLConstructor
},
197 NS_IMPL_NSGETMODULE(nsToolkitCompsModule
, components
)