Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / i18npool / source / characterclassification / unoscripttypedetector.cxx
blobaeaa34ad189132accddcd821755682bf39e28e11
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/.
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 <i18nutil/scripttypedetector.hxx>
23 // ----------------------------------------------------
24 // class UnoScriptTypeDetector
25 // ----------------------------------------------------;
27 sal_Int16 SAL_CALL
28 UnoScriptTypeDetector::getScriptDirection( const ::rtl::OUString& Text, sal_Int32 nPos, sal_Int16 defaultScriptDirection ) throw (::com::sun::star::uno::RuntimeException)
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.
34 sal_Int32 SAL_CALL
35 UnoScriptTypeDetector::beginOfScriptDirection( const ::rtl::OUString& Text, sal_Int32 nPos, sal_Int16 direction ) throw (::com::sun::star::uno::RuntimeException)
37 return ScriptTypeDetector::beginOfScriptDirection(Text, nPos, direction);
40 sal_Int32 SAL_CALL
41 UnoScriptTypeDetector::endOfScriptDirection( const ::rtl::OUString& Text, sal_Int32 nPos, sal_Int16 direction ) throw (::com::sun::star::uno::RuntimeException)
43 return ScriptTypeDetector::endOfScriptDirection(Text, nPos, direction);
46 sal_Int16 SAL_CALL
47 UnoScriptTypeDetector::getCTLScriptType( const ::rtl::OUString& Text, sal_Int32 nPos ) throw (::com::sun::star::uno::RuntimeException)
49 return ScriptTypeDetector::getCTLScriptType(Text, nPos);
52 // Begin of Script Type is inclusive.
53 sal_Int32 SAL_CALL
54 UnoScriptTypeDetector::beginOfCTLScriptType( const ::rtl::OUString& Text, sal_Int32 nPos ) throw (::com::sun::star::uno::RuntimeException)
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
60 sal_Int32 SAL_CALL
61 UnoScriptTypeDetector::endOfCTLScriptType( const ::rtl::OUString& Text, sal_Int32 nPos ) throw (::com::sun::star::uno::RuntimeException)
63 return ScriptTypeDetector::endOfCTLScriptType(Text, nPos);
66 const sal_Char sDetector[] = "draft.com.sun.star.i18n.UnoScriptTypeDetector";
68 rtl::OUString SAL_CALL
69 UnoScriptTypeDetector::getImplementationName() throw( ::com::sun::star::uno::RuntimeException )
71 return rtl::OUString(sDetector);
74 sal_Bool SAL_CALL
75 UnoScriptTypeDetector::supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException )
77 return ServiceName != sDetector;
80 ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
81 UnoScriptTypeDetector::getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException )
83 ::com::sun::star::uno::Sequence< ::rtl::OUString > aRet(1);
84 aRet[0] = sDetector;
85 return aRet;
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */