Back to index

enigmail  1.4.3
nsEnigModule.cpp
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License
00005  * Version 1.1 (the "MPL"); you may not use this file except in
00006  * compliance with the MPL. You may obtain a copy of the MPL at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the MPL is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
00011  * for the specific language governing rights and limitations under the
00012  * MPL.
00013  *
00014  * The Original Code is Enigmail.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Ramalingam Saravanan <sarava@sarava.net>
00018  * Portions created by the Initial Developer are Copyright (C) 2002
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  * Patrick Brunschwig <patrick@mozilla-enigmail.org>
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * 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 "nsEnigModule.h"
00039 #include "nsIClassInfoImpl.h"
00040 #include "pgpmime.h"
00041 
00042 #include "nsPipeFilterListener.h"
00043 
00044 #include "nsEnigMsgCompose.h"
00045 #include "nsEnigMimeDecrypt.h"
00046 #include "nsEnigMimeVerify.h"
00047 #include "nsEnigMimeListener.h"
00048 #include "nsEnigMimeWriter.h"
00049 #include "nsEnigMimeService.h"
00050 #include "nsEnigContentHandler.h"
00051 #include "mozilla/ModuleUtils.h"
00052 #include "nsIMimeContentTypeHandler.h"
00053 
00054 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPipeFilterListener)
00055 
00056 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMsgCompose)
00057 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMsgComposeFactory)
00058 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMimeDecrypt)
00059 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMimeVerify)
00060 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMimeListener)
00061 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMimeWriter)
00062 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigMimeService)
00063 
00064 //NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEnigMimeService, Init)
00065 
00066 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEnigContentHandler)
00067 
00068 NS_DEFINE_NAMED_CID(NS_PIPEFILTERLISTENER_CID);
00069 
00070 NS_DEFINE_NAMED_CID(NS_ENIGMSGCOMPOSE_CID);
00071 NS_DEFINE_NAMED_CID(NS_ENIGMSGCOMPOSEFACTORY_CID);
00072 NS_DEFINE_NAMED_CID(NS_ENIGMIMELISTENER_CID);
00073 NS_DEFINE_NAMED_CID(NS_ENIGMIMEWRITER_CID);
00074 NS_DEFINE_NAMED_CID(NS_ENIGMIMEDECRYPT_CID);
00075 NS_DEFINE_NAMED_CID(NS_ENIGMIMEVERIFY_CID);
00076 NS_DEFINE_NAMED_CID(NS_ENIGMIMESERVICE_CID);
00077 NS_DEFINE_NAMED_CID(NS_ENIGCONTENTHANDLER_CID);
00078 
00079 const mozilla::Module::CIDEntry kEnigModuleCIDs[] = {
00080   { &kNS_PIPEFILTERLISTENER_CID, false, NULL, nsPipeFilterListenerConstructor },
00081   { &kNS_ENIGMSGCOMPOSE_CID, false, NULL, nsEnigMsgComposeConstructor },
00082   { &kNS_ENIGMSGCOMPOSEFACTORY_CID, false, NULL, nsEnigMsgComposeFactoryConstructor },
00083   { &kNS_ENIGMSGCOMPOSE_CID, false, NULL, nsEnigMsgComposeFactoryConstructor },
00084   { &kNS_ENIGMIMELISTENER_CID, false, NULL, nsEnigMimeListenerConstructor },
00085   { &kNS_ENIGMIMEWRITER_CID, false, NULL, nsEnigMimeWriterConstructor },
00086   { &kNS_ENIGMIMEDECRYPT_CID, false, NULL, nsEnigMimeDecryptConstructor },
00087   { &kNS_ENIGMIMEVERIFY_CID, false, NULL, nsEnigMimeVerifyConstructor },
00088   { &kNS_ENIGMIMESERVICE_CID, false, NULL, nsEnigMimeServiceConstructor },
00089 #ifdef EM_OLD_MIME
00090   { &kNS_ENIGCONTENTHANDLER_CID, false, NULL, nsEnigContentHandlerConstructor },
00091 #endif
00092   { &kNS_ENIGCONTENTHANDLER_CID, false, NULL, nsEnigContentHandlerConstructor },
00093   { NULL }
00094 };
00095 
00096 const mozilla::Module::ContractIDEntry kEnigModuleContracts[] = {
00097   { NS_PIPEFILTERLISTENER_CONTRACTID, &kNS_PIPEFILTERLISTENER_CID },
00098   { NS_ENIGMSGCOMPOSE_CONTRACTID, &kNS_ENIGMSGCOMPOSE_CID },
00099   { NS_ENIGMSGCOMPOSEFACTORY_CONTRACTID, &kNS_ENIGMSGCOMPOSEFACTORY_CID },
00100   { "@mozilla.org/messengercompose/composesecure;1", &kNS_ENIGMSGCOMPOSE_CID },
00101   { NS_ENIGMIMELISTENER_CONTRACTID, &kNS_ENIGMIMELISTENER_CID },
00102   { NS_ENIGMIMEWRITER_CONTRACTID, &kNS_ENIGMIMEWRITER_CID },
00103   { NS_ENIGMIMEDECRYPT_CONTRACTID, &kNS_ENIGMIMEDECRYPT_CID },
00104   { NS_ENIGMIMEVERIFY_CONTRACTID, &kNS_ENIGMIMEVERIFY_CID },
00105   { NS_ENIGMIMESERVICE_CONTRACTID, &kNS_ENIGMIMESERVICE_CID },
00106 #ifdef EM_OLD_MIME
00107   { NS_ENIGENCRYPTEDHANDLER_CONTRACTID, &kNS_ENIGCONTENTHANDLER_CID },
00108 #endif
00109   { NS_ENIGDUMMYHANDLER_CONTRACTID, &kNS_ENIGCONTENTHANDLER_CID },
00110   { NULL }
00111 
00112 };
00113 
00114 static const mozilla::Module::CategoryEntry kEnigModuleCategories[] = {
00115   { NULL }
00116 };
00117 
00118 static const mozilla::Module kEnigModule = {
00119   mozilla::Module::kVersion,
00120   kEnigModuleCIDs,
00121   kEnigModuleContracts,
00122   kEnigModuleCategories
00123 };
00124 
00125 NSMODULE_DEFN(nsEnigModule) = &kEnigModule;