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 <i18nutil/scripttypedetector.hxx>
23 // ----------------------------------------------------
24 // class UnoScriptTypeDetector
25 // ----------------------------------------------------;
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.
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
);
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
);
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.
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
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
);
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);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */