Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsLocaleConstructors_h__ |
michael@0 | 7 | #define nsLocaleConstructors_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsCollationCID.h" |
michael@0 | 10 | #include "nsDateTimeFormatCID.h" |
michael@0 | 11 | #include "mozilla/ModuleUtils.h" |
michael@0 | 12 | #include "nsILocaleService.h" |
michael@0 | 13 | #include "nsIScriptableDateFormat.h" |
michael@0 | 14 | #include "nsIServiceManager.h" |
michael@0 | 15 | #include "nsLanguageAtomService.h" |
michael@0 | 16 | #include "nsPlatformCharset.h" |
michael@0 | 17 | |
michael@0 | 18 | #if defined(XP_MACOSX) |
michael@0 | 19 | #define USE_MAC_LOCALE |
michael@0 | 20 | #endif |
michael@0 | 21 | |
michael@0 | 22 | #if defined(XP_UNIX) && !defined(XP_MACOSX) |
michael@0 | 23 | #define USE_UNIX_LOCALE |
michael@0 | 24 | #endif |
michael@0 | 25 | |
michael@0 | 26 | #ifdef XP_WIN |
michael@0 | 27 | #include "windows/nsCollationWin.h" |
michael@0 | 28 | #include "windows/nsDateTimeFormatWin.h" |
michael@0 | 29 | #endif |
michael@0 | 30 | |
michael@0 | 31 | #ifdef USE_MAC_LOCALE |
michael@0 | 32 | #include "mac/nsCollationMacUC.h" |
michael@0 | 33 | #include "mac/nsDateTimeFormatMac.h" |
michael@0 | 34 | #endif |
michael@0 | 35 | |
michael@0 | 36 | #ifdef USE_UNIX_LOCALE |
michael@0 | 37 | #include "unix/nsCollationUnix.h" |
michael@0 | 38 | #include "unix/nsDateTimeFormatUnix.h" |
michael@0 | 39 | #endif |
michael@0 | 40 | |
michael@0 | 41 | #define NSLOCALE_MAKE_CTOR(ctor_, iface_, func_) \ |
michael@0 | 42 | static nsresult \ |
michael@0 | 43 | ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \ |
michael@0 | 44 | { \ |
michael@0 | 45 | *aResult = nullptr; \ |
michael@0 | 46 | if (aOuter) \ |
michael@0 | 47 | return NS_ERROR_NO_AGGREGATION; \ |
michael@0 | 48 | iface_* inst; \ |
michael@0 | 49 | nsresult rv = func_(&inst); \ |
michael@0 | 50 | if (NS_SUCCEEDED(rv)) { \ |
michael@0 | 51 | rv = inst->QueryInterface(aIID, aResult); \ |
michael@0 | 52 | NS_RELEASE(inst); \ |
michael@0 | 53 | } \ |
michael@0 | 54 | return rv; \ |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | |
michael@0 | 58 | NSLOCALE_MAKE_CTOR(CreateLocaleService, nsILocaleService, NS_NewLocaleService) |
michael@0 | 59 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationFactory) |
michael@0 | 60 | //NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableDateTimeFormat) |
michael@0 | 61 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsLanguageAtomService) |
michael@0 | 62 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPlatformCharset, Init) |
michael@0 | 63 | |
michael@0 | 64 | #ifdef XP_WIN |
michael@0 | 65 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationWin) |
michael@0 | 66 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatWin) |
michael@0 | 67 | #endif |
michael@0 | 68 | |
michael@0 | 69 | #ifdef USE_UNIX_LOCALE |
michael@0 | 70 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationUnix) |
michael@0 | 71 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatUnix) |
michael@0 | 72 | #endif |
michael@0 | 73 | |
michael@0 | 74 | #ifdef USE_MAC_LOCALE |
michael@0 | 75 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationMacUC) |
michael@0 | 76 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatMac) |
michael@0 | 77 | #endif |
michael@0 | 78 | |
michael@0 | 79 | #endif |