Back to index

lightning-sunbird  0.9+nobinonly
nsMsgCompFactory.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "msgCore.h"
00039 
00040 #include "nsISupports.h"
00041 #include "nsCOMPtr.h"
00042 
00043 #include "nsIFactory.h"
00044 #include "nsIGenericFactory.h"
00045 #include "nsIServiceManager.h"
00046 #include "nsIModule.h"
00047 
00048 #include "pratom.h"
00049 #include "nsMsgCompCID.h"
00050 
00051 /* Include all of the interfaces our factory can generate components for */
00052 #include "nsMsgSendLater.h"
00053 #include "nsSmtpUrl.h"
00054 #include "nsISmtpService.h"
00055 #include "nsSmtpService.h"
00056 #include "nsMsgComposeService.h"
00057 #include "nsMsgComposeContentHandler.h"
00058 #include "nsMsgCompose.h"
00059 #include "nsMsgComposeParams.h"
00060 #include "nsMsgComposeProgressParams.h"
00061 #include "nsMsgAttachment.h"
00062 #include "nsMsgSend.h"
00063 #include "nsMsgQuote.h"
00064 #include "nsURLFetcher.h"
00065 #include "nsSmtpServer.h"
00066 #include "nsSmtpDataSource.h"
00067 #include "nsSmtpDelegateFactory.h"
00068 #include "nsMsgRecipientArray.h"
00069 #include "nsMsgComposeStringBundle.h"
00070 #include "nsMsgCompUtils.h"
00071 
00072 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpService)
00073 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpServer)
00074 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgCompose)
00075 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgComposeParams)
00076 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgComposeSendListener)
00077 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgComposeProgressParams)
00078 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgCompFields)
00079 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgAttachment)
00080 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgComposeAndSend)
00081 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgSendLater)
00082 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgComposeService, Init)
00083 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgComposeContentHandler)
00084 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgQuote)
00085 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgQuoteListener)
00086 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpUrl)
00087 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailtoUrl)
00088 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgRecipientArray)
00089 NS_GENERIC_FACTORY_CONSTRUCTOR(nsComposeStringService)
00090 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpDataSource)
00091 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpDelegateFactory)
00092 NS_GENERIC_FACTORY_CONSTRUCTOR(nsURLFetcher)
00093 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgCompUtils)
00094 
00096 //
00098 
00099 static const nsModuleComponentInfo components[] =
00100 {
00101   { "Msg Compose",
00102     NS_MSGCOMPOSE_CID,
00103     NS_MSGCOMPOSE_CONTRACTID,
00104     nsMsgComposeConstructor },
00105   { "Msg Compose Service",
00106     NS_MSGCOMPOSESERVICE_CID,
00107     NS_MSGCOMPOSESERVICE_CONTRACTID,
00108     nsMsgComposeServiceConstructor },
00109   { "Msg Compose Startup Handler",
00110     NS_MSGCOMPOSESERVICE_CID,
00111     NS_MSGCOMPOSESTARTUPHANDLER_CONTRACTID,
00112     nsMsgComposeServiceConstructor,
00113     nsMsgComposeService::RegisterProc,
00114     nsMsgComposeService::UnregisterProc },
00115   { "mailto content handler",
00116      NS_MSGCOMPOSECONTENTHANDLER_CID,
00117      NS_MSGCOMPOSECONTENTHANDLER_CONTRACTID,
00118      nsMsgComposeContentHandlerConstructor },
00119   { "Msg Compose Parameters",
00120     NS_MSGCOMPOSEPARAMS_CID,
00121     NS_MSGCOMPOSEPARAMS_CONTRACTID,
00122     nsMsgComposeParamsConstructor },
00123   { "Msg Compose Send Listener",
00124     NS_MSGCOMPOSESENDLISTENER_CID,
00125     NS_MSGCOMPOSESENDLISTENER_CONTRACTID,
00126     nsMsgComposeSendListenerConstructor },
00127   { "Msg Compose Progress Parameters",
00128     NS_MSGCOMPOSEPROGRESSPARAMS_CID,
00129     NS_MSGCOMPOSEPROGRESSPARAMS_CONTRACTID,
00130     nsMsgComposeProgressParamsConstructor },
00131   { "Msg Compose Fields",
00132     NS_MSGCOMPFIELDS_CID,
00133     NS_MSGCOMPFIELDS_CONTRACTID,
00134     nsMsgCompFieldsConstructor },
00135   { "Msg Compose Attachment",
00136     NS_MSGATTACHMENT_CID,
00137     NS_MSGATTACHMENT_CONTRACTID,
00138     nsMsgAttachmentConstructor },
00139   { "Msg Send",
00140     NS_MSGSEND_CID,
00141     NS_MSGSEND_CONTRACTID,
00142     nsMsgComposeAndSendConstructor },
00143   { "Msg Send Later",
00144     NS_MSGSENDLATER_CID,
00145     NS_MSGSENDLATER_CONTRACTID,
00146     nsMsgSendLaterConstructor },
00147   { "SMTP Service",
00148     NS_SMTPSERVICE_CID,
00149     NS_SMTPSERVICE_CONTRACTID,
00150     nsSmtpServiceConstructor },
00151   { "SMTP Service",
00152     NS_SMTPSERVICE_CID,
00153     NS_MAILTOHANDLER_CONTRACTID,
00154     nsSmtpServiceConstructor },
00155   { "SMTP Server",
00156     NS_SMTPSERVER_CID,
00157     NS_SMTPSERVER_CONTRACTID,
00158     nsSmtpServerConstructor },
00159   { "SMTP URL",
00160     NS_SMTPURL_CID,
00161     NS_SMTPURL_CONTRACTID,
00162     nsSmtpUrlConstructor },
00163   { "MAILTO URL",
00164     NS_MAILTOURL_CID,
00165     NS_MAILTOURL_CONTRACTID,
00166     nsMailtoUrlConstructor },
00167   { "Msg Quote",
00168     NS_MSGQUOTE_CID,
00169     NS_MSGQUOTE_CONTRACTID,
00170     nsMsgQuoteConstructor },
00171   { "Msg Quote Listener",
00172     NS_MSGQUOTELISTENER_CID,
00173     NS_MSGQUOTELISTENER_CONTRACTID,
00174     nsMsgQuoteListenerConstructor },
00175   { "Msg Recipient Array",
00176     NS_MSGRECIPIENTARRAY_CID,
00177     NS_MSGRECIPIENTARRAY_CONTRACTID,
00178     nsMsgRecipientArrayConstructor },
00179   { "Compose string bundle",
00180     NS_MSG_COMPOSESTRINGSERVICE_CID,
00181     NS_MSG_COMPOSESTRINGSERVICE_CONTRACTID,
00182     nsComposeStringServiceConstructor },
00183   { "SMTP string bundle",
00184     NS_MSG_COMPOSESTRINGSERVICE_CID,
00185     NS_MSG_SMTPSTRINGSERVICE_CONTRACTID,
00186     nsComposeStringServiceConstructor },
00187   { "SMTP Datasource",
00188     NS_SMTPDATASOURCE_CID,
00189     NS_SMTPDATASOURCE_CONTRACTID,
00190     nsSmtpDataSourceConstructor },
00191   { "SMTP Delegate Factory",
00192     NS_SMTPDELEGATEFACTORY_CID,
00193     NS_SMTPDELEGATEFACTORY_CONTRACTID,
00194     nsSmtpDelegateFactoryConstructor },
00195   { "URL Fetcher",
00196     NS_URLFETCHER_CID,
00197     NS_URLFETCHER_CONTRACTID,
00198     nsURLFetcherConstructor },
00199   { "Msg Compose Utils",
00200     NS_MSGCOMPUTILS_CID,
00201     NS_MSGCOMPUTILS_CONTRACTID,
00202     nsMsgCompUtilsConstructor },
00203 };
00204 
00205   
00206 NS_IMPL_NSGETMODULE(nsMsgComposeModule, components)