Back to index

lightning-sunbird  0.9+nobinonly
nsMsgLocalFactory.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  *   Pierre Phaneuf <pp@ludusdesign.com>
00024  *   Adam D. Moss <adam@gimp.org>
00025  *   Seth Spitzer <sspitzer@mozilla.org>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #include "msgCore.h" // for pre-compiled headers...
00042 #include "nsIModule.h"
00043 #include "nsIGenericFactory.h"
00044 #include "nsMsgLocalCID.h"
00045 
00046 // include files for components this factory creates...
00047 #include "nsMailboxUrl.h"
00048 #include "nsPop3URL.h"
00049 #include "nsMailboxService.h"
00050 #include "nsLocalMailFolder.h"
00051 #include "nsParseMailbox.h"
00052 #include "nsPop3Service.h"
00053 #ifdef HAVE_MOVEMAIL
00054 #include "nsMovemailService.h"
00055 #include "nsMovemailIncomingServer.h"
00056 #endif /* HAVE_MOVEMAIL */
00057 #include "nsNoneService.h"
00058 #include "nsPop3IncomingServer.h"
00059 #include "nsNoIncomingServer.h"
00060 #include "nsLocalStringBundle.h"
00061 #include "nsRssService.h"
00062 #include "nsRssIncomingServer.h"
00063 #include "nsCOMPtr.h"
00064 
00065 // private factory declarations for each component we know how to produce
00066 
00067 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailboxUrl)
00068 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPop3URL)
00069 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgMailboxParser)
00070 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailboxService)
00071 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPop3Service)
00072 #ifdef HAVE_MOVEMAIL
00073 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMovemailService)
00074 #endif /* HAVE_MOVEMAIL */
00075 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoneService)
00076 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgLocalMailFolder)
00077 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParseMailMessageState)
00078 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPop3IncomingServer)
00079 #ifdef HAVE_MOVEMAIL
00080 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMovemailIncomingServer)
00081 #endif /* HAVE_MOVEMAIL */
00082 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoIncomingServer)
00083 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLocalStringService)
00084 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRssService)
00085 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRssIncomingServer)
00086 
00087 // The list of components we register
00088 static const nsModuleComponentInfo gComponents[] = {
00089     { "Mailbox URL", NS_MAILBOXURL_CID,
00090       NS_MAILBOXURL_CONTRACTID, nsMailboxUrlConstructor },
00091 
00092     { "Mailbox Service", NS_MAILBOXSERVICE_CID,
00093       NS_MAILBOXSERVICE_CONTRACTID1, nsMailboxServiceConstructor },
00094 
00095     { "Mailbox Service", NS_MAILBOXSERVICE_CID,
00096       NS_MAILBOXSERVICE_CONTRACTID2, nsMailboxServiceConstructor },
00097 
00098     { "Mailbox Service", NS_MAILBOXSERVICE_CID,
00099       NS_MAILBOXSERVICE_CONTRACTID3, nsMailboxServiceConstructor },
00100 
00101     { "Mailbox Protocol Handler", NS_MAILBOXSERVICE_CID,
00102       NS_MAILBOXSERVICE_CONTRACTID4, nsMailboxServiceConstructor },
00103 
00104     { "Mailbox Parser", NS_MAILBOXPARSER_CID,
00105       NS_MAILBOXPARSER_CONTRACTID, nsMsgMailboxParserConstructor },
00106 
00107     { "Pop3 URL", NS_POP3URL_CID,
00108       NS_POP3URL_CONTRACTID, nsPop3URLConstructor },
00109 
00110     { "Pop3 Service", NS_POP3SERVICE_CID,
00111       NS_POP3SERVICE_CONTRACTID1, nsPop3ServiceConstructor },
00112 
00113     { "POP Protocol Handler", NS_POP3SERVICE_CID,
00114       NS_POP3SERVICE_CONTRACTID2, nsPop3ServiceConstructor },
00115 
00116     { "None Service", NS_NONESERVICE_CID,
00117       NS_NONESERVICE_CONTRACTID, nsNoneServiceConstructor },
00118 
00119 #ifdef HAVE_MOVEMAIL
00120     { "Movemail Service", NS_MOVEMAILSERVICE_CID,
00121       NS_MOVEMAILSERVICE_CONTRACTID, nsMovemailServiceConstructor },
00122 #endif /* HAVE_MOVEMAIL */
00123 
00124     { "pop3 Protocol Information", NS_POP3SERVICE_CID,
00125       NS_POP3PROTOCOLINFO_CONTRACTID, nsPop3ServiceConstructor },
00126 
00127     { "none Protocol Information", NS_NONESERVICE_CID,
00128       NS_NONEPROTOCOLINFO_CONTRACTID, nsNoneServiceConstructor },
00129 
00130 #ifdef HAVE_MOVEMAIL
00131     { "movemail Protocol Information", NS_MOVEMAILSERVICE_CID,
00132       NS_MOVEMAILPROTOCOLINFO_CONTRACTID, nsMovemailServiceConstructor },
00133 #endif /* HAVE_MOVEMAIL */
00134 
00135     { "Local Mail Folder Resource Factory", NS_LOCALMAILFOLDERRESOURCE_CID,
00136       NS_LOCALMAILFOLDERRESOURCE_CONTRACTID, nsMsgLocalMailFolderConstructor },
00137 
00138     { "Pop3 Incoming Server", NS_POP3INCOMINGSERVER_CID,
00139       NS_POP3INCOMINGSERVER_CONTRACTID, nsPop3IncomingServerConstructor },
00140 
00141 #ifdef HAVE_MOVEMAIL 
00142     { "Movemail Incoming Server", NS_MOVEMAILINCOMINGSERVER_CID,
00143       NS_MOVEMAILINCOMINGSERVER_CONTRACTID, nsMovemailIncomingServerConstructor },
00144 #endif /* HAVE_MOVEMAIL */
00145 
00146     { "No Incoming Server", NS_NOINCOMINGSERVER_CID,
00147       NS_NOINCOMINGSERVER_CONTRACTID, nsNoIncomingServerConstructor },
00148 
00149     { "Parse MailMessage State", NS_PARSEMAILMSGSTATE_CID,
00150       NS_PARSEMAILMSGSTATE_CONTRACTID, nsParseMailMessageStateConstructor },
00151 
00152     { "Mailbox String Bundle Service", NS_MSG_LOCALSTRINGSERVICE_CID,
00153       NS_MSG_MAILBOXSTRINGSERVICE_CONTRACTID, nsLocalStringServiceConstructor },
00154 
00155     { "Pop String Bundle Service", NS_MSG_LOCALSTRINGSERVICE_CID,
00156       NS_MSG_POPSTRINGSERVICE_CONTRACTID, nsLocalStringServiceConstructor },
00157       
00158     { "RSS Service", NS_RSSSERVICE_CID,
00159       NS_RSSSERVICE_CONTRACTID, nsRssServiceConstructor },
00160     
00161     { "RSS Protocol Information", NS_RSSSERVICE_CID,
00162       NS_RSSPROTOCOLINFO_CONTRACTID, nsRssServiceConstructor },
00163         
00164     { "RSS Incoming Server", NS_RSSINCOMINGSERVER_CID,
00165       NS_RSSINCOMINGSERVER_CONTRACTID, nsRssIncomingServerConstructor },
00166 };
00167 
00168 NS_IMPL_NSGETMODULE(local_mail_services, gComponents)
00169