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 .
20 #include <unoscripttypedetector.hxx>
21 #include <cppuhelper/supportsservice.hxx>
22 #include <i18nutil/scripttypedetector.hxx>
24 namespace com::sun::star::uno
{ class XComponentContext
; }
26 // class UnoScriptTypeDetector
28 UnoScriptTypeDetector::getScriptDirection( const OUString
& Text
, sal_Int32 nPos
, sal_Int16 defaultScriptDirection
)
30 return ScriptTypeDetector::getScriptDirection(Text
, nPos
, defaultScriptDirection
);
33 // return value '-1' means either the direction on nPos is not same as scriptDirection or nPos is out of range.
35 UnoScriptTypeDetector::beginOfScriptDirection( const OUString
& Text
, sal_Int32 nPos
, sal_Int16 direction
)
37 return ScriptTypeDetector::beginOfScriptDirection(Text
, nPos
, direction
);
41 UnoScriptTypeDetector::endOfScriptDirection( const OUString
& Text
, sal_Int32 nPos
, sal_Int16 direction
)
43 return ScriptTypeDetector::endOfScriptDirection(Text
, nPos
, direction
);
47 UnoScriptTypeDetector::getCTLScriptType( const OUString
& Text
, sal_Int32 nPos
)
49 return ScriptTypeDetector::getCTLScriptType(Text
, nPos
);
52 // Begin of Script Type is inclusive.
54 UnoScriptTypeDetector::beginOfCTLScriptType( const OUString
& Text
, sal_Int32 nPos
)
56 return ScriptTypeDetector::beginOfCTLScriptType(Text
, nPos
);
59 // End of the Script Type is exclusive, the return value pointing to the begin of next script type
61 UnoScriptTypeDetector::endOfCTLScriptType( const OUString
& Text
, sal_Int32 nPos
)
63 return ScriptTypeDetector::endOfCTLScriptType(Text
, nPos
);
67 UnoScriptTypeDetector::getImplementationName()
69 return "com.sun.star.i18n.ScriptTypeDetector";
73 UnoScriptTypeDetector::supportsService(const OUString
& ServiceName
)
75 return cppu::supportsService(this, ServiceName
);
78 css::uno::Sequence
< OUString
> SAL_CALL
79 UnoScriptTypeDetector::getSupportedServiceNames()
81 return { "com.sun.star.i18n.ScriptTypeDetector" };
84 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
85 com_sun_star_i18n_ScriptTypeDetector_get_implementation(
86 css::uno::XComponentContext
*,
87 css::uno::Sequence
<css::uno::Any
> const &)
89 return cppu::acquire(new UnoScriptTypeDetector
);
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */