1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <cppuhelper/supportsservice.hxx>
22 #include <textconversion.hxx>
24 using namespace com::sun::star::uno
;
26 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
28 #ifndef DISABLE_DYNLOADING
30 extern "C" { static void SAL_CALL
thisModule() {} }
34 TextConversion::TextConversion(const char *pImplName
)
35 : implementationName(pImplName
)
37 #ifndef DISABLE_DYNLOADING
39 OUString
lib(SAL_DLLPREFIX
"textconv_dict" SAL_DLLEXTENSION
);
41 OUString
lib("textconv_dict" SAL_DLLEXTENSION
);
43 hModule
= osl_loadModuleRelative(
44 &thisModule
, lib
.pData
, SAL_LOADMODULE_DEFAULT
);
48 TextConversion::~TextConversion()
50 #ifndef DISABLE_DYNLOADING
51 if (hModule
) osl_unloadModule(hModule
);
55 #ifndef DISABLE_DYNLOADING
57 static void* nullFunc()
62 oslGenericFunction SAL_CALL
63 TextConversion::getFunctionBySymbol(const sal_Char
* func
)
66 return osl_getFunctionSymbol(hModule
, OUString::createFromAscii(func
).pData
);
68 return reinterpret_cast< oslGenericFunction
>(nullFunc
);
74 TextConversion::getImplementationName() throw( RuntimeException
, std::exception
)
76 return OUString::createFromAscii(implementationName
);
80 TextConversion::supportsService(const OUString
& rServiceName
) throw( RuntimeException
, std::exception
)
82 return cppu::supportsService(this, rServiceName
);
85 Sequence
< OUString
> SAL_CALL
86 TextConversion::getSupportedServiceNames() throw( RuntimeException
, std::exception
)
88 Sequence
< OUString
> aRet(1);
89 aRet
[0] = OUString::createFromAscii(implementationName
);
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */