bump product version to 6.3.0.0.beta1
[LibreOffice.git] / svtools / langsupport / langsupport.cxx
blob1aae3df70277857bf0ed73ceae9abd98430d83a7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <com/sun/star/lang/XComponent.hpp>
11 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
12 #include <com/sun/star/uno/XComponentContext.hpp>
13 #include <comphelper/processfactory.hxx>
14 #include <cppuhelper/bootstrap.hxx>
15 #include <i18nlangtag/languagetag.hxx>
16 #include <sal/main.h>
17 #include <svtools/langtab.hxx>
18 #include <tools/extendapplicationenvironment.hxx>
19 #include <vcl/svapp.hxx>
20 #include <iostream>
21 #include <sal/log.hxx>
23 using namespace com::sun::star;
25 SAL_IMPLEMENT_MAIN()
27 try
29 tools::extendApplicationEnvironment();
31 uno::Reference<uno::XComponentContext> xContext =
32 cppu::defaultBootstrap_InitialComponentContext();
34 uno::Reference<lang::XMultiComponentFactory> xFactory =
35 xContext->getServiceManager();
37 uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory,
38 uno::UNO_QUERY_THROW);
40 comphelper::setProcessServiceFactory(xSFactory);
42 InitVCL();
45 sal_uInt32 nCount = SvtLanguageTable::GetLanguageEntryCount();
46 for (sal_uInt32 i = 0; i < nCount; ++i)
48 LanguageType eLang = SvtLanguageTable::GetLanguageTypeAtIndex(i);
50 if (eLang == LANGUAGE_DONTKNOW ||
51 eLang == LANGUAGE_NONE ||
52 eLang == LANGUAGE_HID_HUMAN_INTERFACE_DEVICE ||
53 eLang == LANGUAGE_SYSTEM)
55 continue;
58 OUString sTag( LanguageTag::convertToBcp47( eLang));
60 std::cout << sTag << std::endl;
64 DeInitVCL();
66 uno::Reference< lang::XComponent >(xContext, uno::UNO_QUERY_THROW)->dispose();
68 catch (const uno::Exception& e)
70 SAL_WARN("vcl.app", "Fatal: " << e);
71 return 1;
73 catch (const std::exception &e)
75 SAL_WARN("vcl.app", "Fatal: " << e.what());
76 return 1;
79 return 0;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */