LCOV - code coverage report
Current view: directory - intl/build - nsI18nModule.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 11 7 63.6 %
Date: 2012-06-02 Functions: 10 7 70.0 %

       1                 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 : /* ***** BEGIN LICENSE BLOCK *****
       3                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       4                 :  *
       5                 :  * The contents of this file are subject to the Mozilla Public License Version
       6                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       7                 :  * the License. You may obtain a copy of the License at
       8                 :  * http://www.mozilla.org/MPL/
       9                 :  *
      10                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      11                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      12                 :  * for the specific language governing rights and limitations under the
      13                 :  * License.
      14                 :  *
      15                 :  * The Original Code is mozilla.org code.
      16                 :  *
      17                 :  * The Initial Developer of the Original Code is
      18                 :  * Netscape Communications Corporation.
      19                 :  * Portions created by the Initial Developer are Copyright (C) 1998
      20                 :  * the Initial Developer. All Rights Reserved.
      21                 :  *
      22                 :  * Contributor(s):
      23                 :  *
      24                 :  * Alternatively, the contents of this file may be used under the terms of
      25                 :  * either of the GNU General Public License Version 2 or later (the "GPL"),
      26                 :  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      27                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      28                 :  * of those above. If you wish to allow use of your version of this file only
      29                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      30                 :  * use your version of this file under the terms of the MPL, indicate your
      31                 :  * decision by deleting the provisions above and replace them with the notice
      32                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      33                 :  * the provisions above, a recipient may use your version of this file under
      34                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      35                 :  *
      36                 :  * ***** END LICENSE BLOCK ***** */
      37                 : 
      38                 : #include "mozilla/ModuleUtils.h"
      39                 : 
      40                 : // lwbrk
      41                 : #include "nsLWBrkCIID.h"
      42                 : #include "nsJISx4501LineBreaker.h"
      43                 : #include "nsSampleWordBreaker.h"
      44                 : #include "nsLWBRKDll.h"
      45                 : 
      46                 : #include "nsSemanticUnitScanner.h"
      47                 : 
      48                 : // unicharutil
      49                 : #include "nsCategoryImp.h"
      50                 : #include "nsUnicharUtilCIID.h"
      51                 : #include "nsCaseConversionImp2.h"
      52                 : #include "nsEntityConverter.h"
      53                 : #include "nsSaveAsCharset.h"
      54                 : #include "nsUnicodeNormalizer.h"
      55                 : 
      56                 : // string bundles (intl)
      57                 : #include "nsStringBundleService.h"
      58                 : #include "nsStringBundleTextOverride.h"
      59                 : 
      60                 : // locale
      61                 : #include "nsLocaleConstructors.h"
      62                 : 
      63            2808 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsJISx4051LineBreaker)
      64            2808 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsSampleWordBreaker)
      65                 : 
      66               0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsSemanticUnitScanner)
      67                 : 
      68            2808 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleService, Init)
      69            2808 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleTextOverride, Init)
      70                 : 
      71               0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsCaseConversionImp2)
      72               0 : NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCategoryImp,
      73               0 :                                          nsCategoryImp::GetInstance)
      74               4 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsEntityConverter)
      75               4 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsSaveAsCharset)
      76            2838 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeNormalizer)
      77                 : 
      78                 : NS_DEFINE_NAMED_CID(NS_LBRK_CID);
      79                 : NS_DEFINE_NAMED_CID(NS_WBRK_CID);
      80                 : NS_DEFINE_NAMED_CID(NS_SEMANTICUNITSCANNER_CID);
      81                 : NS_DEFINE_NAMED_CID(NS_UNICHARUTIL_CID);
      82                 : NS_DEFINE_NAMED_CID(NS_UNICHARCATEGORY_CID);
      83                 : NS_DEFINE_NAMED_CID(NS_ENTITYCONVERTER_CID);
      84                 : NS_DEFINE_NAMED_CID(NS_SAVEASCHARSET_CID);
      85                 : NS_DEFINE_NAMED_CID(NS_UNICODE_NORMALIZER_CID);
      86                 : NS_DEFINE_NAMED_CID(NS_STRINGBUNDLESERVICE_CID);
      87                 : NS_DEFINE_NAMED_CID(NS_STRINGBUNDLETEXTOVERRIDE_CID);
      88                 : NS_DEFINE_NAMED_CID(NS_LOCALESERVICE_CID);
      89                 : NS_DEFINE_NAMED_CID(NS_COLLATIONFACTORY_CID);
      90                 : NS_DEFINE_NAMED_CID(NS_SCRIPTABLEDATEFORMAT_CID);
      91                 : NS_DEFINE_NAMED_CID(NS_LANGUAGEATOMSERVICE_CID);
      92                 : NS_DEFINE_NAMED_CID(NS_PLATFORMCHARSET_CID);
      93                 : #ifdef XP_WIN
      94                 : NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
      95                 : NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
      96                 : #endif
      97                 : #ifdef USE_UNIX_LOCALE
      98                 : NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
      99                 : NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
     100                 : #endif
     101                 : #ifdef USE_MAC_LOCALE
     102                 : NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
     103                 : NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
     104                 : #endif
     105                 : #ifdef XP_OS2
     106                 : NS_DEFINE_NAMED_CID(NS_OS2LOCALE_CID);
     107                 : NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
     108                 : NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
     109                 : #endif
     110                 : 
     111                 : static const mozilla::Module::CIDEntry kIntlCIDs[] = {
     112                 :     { &kNS_LBRK_CID, false, NULL, nsJISx4051LineBreakerConstructor },
     113                 :     { &kNS_WBRK_CID, false, NULL, nsSampleWordBreakerConstructor },
     114                 :     { &kNS_SEMANTICUNITSCANNER_CID, false, NULL, nsSemanticUnitScannerConstructor },
     115                 :     { &kNS_UNICHARUTIL_CID, false, NULL, nsCaseConversionImp2Constructor },
     116                 :     { &kNS_UNICHARCATEGORY_CID, false, NULL, nsCategoryImpConstructor },
     117                 :     { &kNS_ENTITYCONVERTER_CID, false, NULL, nsEntityConverterConstructor },
     118                 :     { &kNS_SAVEASCHARSET_CID, false, NULL, nsSaveAsCharsetConstructor },
     119                 :     { &kNS_UNICODE_NORMALIZER_CID, false, NULL, nsUnicodeNormalizerConstructor },
     120                 :     { &kNS_STRINGBUNDLESERVICE_CID, false, NULL, nsStringBundleServiceConstructor },
     121                 :     { &kNS_STRINGBUNDLETEXTOVERRIDE_CID, false, NULL, nsStringBundleTextOverrideConstructor },
     122                 :     { &kNS_LOCALESERVICE_CID, false, NULL, CreateLocaleService },
     123                 :     { &kNS_COLLATIONFACTORY_CID, false, NULL, nsCollationFactoryConstructor },
     124                 :     { &kNS_SCRIPTABLEDATEFORMAT_CID, false, NULL, NS_NewScriptableDateFormat },
     125                 :     { &kNS_LANGUAGEATOMSERVICE_CID, false, NULL, nsLanguageAtomServiceConstructor },
     126                 :     { &kNS_PLATFORMCHARSET_CID, false, NULL, nsPlatformCharsetConstructor },
     127                 : #ifdef XP_WIN
     128                 :     { &kNS_COLLATION_CID, false, NULL, nsCollationWinConstructor },
     129                 :     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatWinConstructor },
     130                 : #endif
     131                 : #ifdef USE_UNIX_LOCALE
     132                 :     { &kNS_COLLATION_CID, false, NULL, nsCollationUnixConstructor },
     133                 :     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatUnixConstructor },
     134                 : #endif
     135                 : #ifdef USE_MAC_LOCALE
     136                 :     { &kNS_COLLATION_CID, false, NULL, nsCollationMacUCConstructor },
     137                 :     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatMacConstructor },
     138                 : #endif
     139                 : #ifdef XP_OS2
     140                 :     { &kNS_OS2LOCALE_CID, false, NULL, nsOS2LocaleConstructor },
     141                 :     { &kNS_COLLATION_CID, false, NULL, nsCollationOS2Constructor },
     142                 :     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatOS2Constructor },
     143                 : #endif
     144                 :     { NULL }
     145                 : };
     146                 : 
     147                 : static const mozilla::Module::ContractIDEntry kIntlContracts[] = {
     148                 :     { NS_LBRK_CONTRACTID, &kNS_LBRK_CID },
     149                 :     { NS_WBRK_CONTRACTID, &kNS_WBRK_CID },
     150                 :     { NS_SEMANTICUNITSCANNER_CONTRACTID, &kNS_SEMANTICUNITSCANNER_CID },
     151                 :     { NS_UNICHARUTIL_CONTRACTID, &kNS_UNICHARUTIL_CID },
     152                 :     { NS_UNICHARCATEGORY_CONTRACTID, &kNS_UNICHARCATEGORY_CID },
     153                 :     { NS_ENTITYCONVERTER_CONTRACTID, &kNS_ENTITYCONVERTER_CID },
     154                 :     { NS_SAVEASCHARSET_CONTRACTID, &kNS_SAVEASCHARSET_CID },
     155                 :     { NS_UNICODE_NORMALIZER_CONTRACTID, &kNS_UNICODE_NORMALIZER_CID },
     156                 :     { NS_STRINGBUNDLE_CONTRACTID, &kNS_STRINGBUNDLESERVICE_CID },
     157                 :     { NS_STRINGBUNDLETEXTOVERRIDE_CONTRACTID, &kNS_STRINGBUNDLETEXTOVERRIDE_CID },
     158                 :     { NS_LOCALESERVICE_CONTRACTID, &kNS_LOCALESERVICE_CID },
     159                 :     { NS_COLLATIONFACTORY_CONTRACTID, &kNS_COLLATIONFACTORY_CID },
     160                 :     { NS_SCRIPTABLEDATEFORMAT_CONTRACTID, &kNS_SCRIPTABLEDATEFORMAT_CID },
     161                 :     { NS_LANGUAGEATOMSERVICE_CONTRACTID, &kNS_LANGUAGEATOMSERVICE_CID },
     162                 :     { NS_PLATFORMCHARSET_CONTRACTID, &kNS_PLATFORMCHARSET_CID },
     163                 : #ifdef XP_WIN
     164                 :     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     165                 :     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
     166                 : #endif
     167                 : #ifdef USE_UNIX_LOCALE
     168                 :     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     169                 :     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
     170                 : #endif
     171                 : #ifdef USE_MAC_LOCALE
     172                 :     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     173                 :     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
     174                 : #endif
     175                 : #ifdef XP_OS2
     176                 :     { NS_OS2LOCALE_CONTRACTID, &kNS_OS2LOCALE_CID },
     177                 :     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     178                 :     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
     179                 : #endif
     180                 :     { NULL }
     181                 : };
     182                 : 
     183                 : static const mozilla::Module kIntlModule = {
     184                 :     mozilla::Module::kVersion,
     185                 :     kIntlCIDs,
     186                 :     kIntlContracts,
     187                 : };
     188                 : 
     189                 : NSMODULE_DEFN(nsI18nModule) = &kIntlModule;

Generated by: LCOV version 1.7