Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1

This commit is contained in:
Matt A. Tobin 2019-11-03 00:17:46 -04:00 • committed by Roy Tam
commit e400f4130a
1564 changed files with 510348 additions and 0 deletions

24
db/mork/build/moz.build Normal file
View file

@ -0,0 +1,24 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXPORTS += [
'nsIMdbFactoryFactory.h',
'nsMorkCID.h',
]
SOURCES += [
'nsMorkFactory.cpp',
]
if CONFIG['MOZ_INCOMPLETE_EXTERNAL_LINKAGE']:
XPCOMBinaryComponent('mork')
USE_LIBS += [
'nspr',
'xpcomglue_s',
'xul',
]
else:
Library('mork')
FINAL_LIBRARY = 'xul'

View file

@ -0,0 +1,30 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsIMdbFactoryFactory_h__
#define nsIMdbFactoryFactory_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
class nsIMdbFactory;
// 2794D0B7-E740-47a4-91C0-3E4FCB95B806
#define NS_IMDBFACTORYFACTORY_IID \
{ 0x2794d0b7, 0xe740, 0x47a4, { 0x91, 0xc0, 0x3e, 0x4f, 0xcb, 0x95, 0xb8, 0x6 } }
// because Mork doesn't support XPCOM, we have to wrap the mdb factory interface
// with an interface that gives you an mdb factory.
class nsIMdbFactoryService : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMDBFACTORYFACTORY_IID)
NS_IMETHOD GetMdbFactory(nsIMdbFactory **aFactory) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIMdbFactoryService, NS_IMDBFACTORYFACTORY_IID)
#endif

21
db/mork/build/nsMorkCID.h Normal file
View file

@ -0,0 +1,21 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsMorkCID_h__
#define nsMorkCID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#define NS_MORK_CONTRACTID \
"@mozilla.org/db/mork;1"
// 36d90300-27f5-11d3-8d74-00805f8a6617
#define NS_MORK_CID \
{ 0x36d90300, 0x27f5, 0x11d3, \
{ 0x8d, 0x74, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0x17 } }
#endif

View file

@ -0,0 +1,56 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ModuleUtils.h"
#include "nsCOMPtr.h"
#include "nsMorkCID.h"
#include "nsIMdbFactoryFactory.h"
#include "mdb.h"
class nsMorkFactoryService final : public nsIMdbFactoryService
{
public:
nsMorkFactoryService() {};
// nsISupports methods
NS_DECL_ISUPPORTS
NS_IMETHOD GetMdbFactory(nsIMdbFactory **aFactory) override;
protected:
~nsMorkFactoryService() {}
nsCOMPtr<nsIMdbFactory> mMdbFactory;
};
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMorkFactoryService)
NS_DEFINE_NAMED_CID(NS_MORK_CID);
const mozilla::Module::CIDEntry kMorkCIDs[] = {
{ &kNS_MORK_CID, false, NULL, nsMorkFactoryServiceConstructor },
{ NULL }
};
const mozilla::Module::ContractIDEntry kMorkContracts[] = {
{ NS_MORK_CONTRACTID, &kNS_MORK_CID },
{ NULL }
};
static const mozilla::Module kMorkModule = {
mozilla::Module::kVersion,
kMorkCIDs,
kMorkContracts
};
NSMODULE_DEFN(nsMorkModule) = &kMorkModule;
NS_IMPL_ISUPPORTS(nsMorkFactoryService, nsIMdbFactoryService)
NS_IMETHODIMP nsMorkFactoryService::GetMdbFactory(nsIMdbFactory **aFactory)
{
if (!mMdbFactory)
mMdbFactory = MakeMdbFactory();
NS_IF_ADDREF(*aFactory = mMdbFactory);
return *aFactory ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}