Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : : #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
20 : : #define _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
21 : :
22 : : #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
23 : : #include <com/sun/star/i18n/TransliterationType.hpp>
24 : : #include <cppuhelper/implbase1.hxx>
25 : : #include <rtl/ustrbuf.h>
26 : : #include <rtl/ustring.hxx>
27 : :
28 : : namespace com { namespace sun { namespace star { namespace i18n {
29 : :
30 [ - + ]: 34901 : class transliteration_commonclass : public cppu::WeakImplHelper1< com::sun::star::i18n::XExtendedTransliteration >
31 : : {
32 : : public:
33 : : transliteration_commonclass();
34 : :
35 : : // Methods which are shared.
36 : : void SAL_CALL
37 : : loadModule( TransliterationModules modName, const com::sun::star::lang::Locale& rLocale )
38 : : throw(com::sun::star::uno::RuntimeException);
39 : :
40 : : void SAL_CALL
41 : : loadModuleNew( const com::sun::star::uno::Sequence< TransliterationModulesNew >& modName, const com::sun::star::lang::Locale& rLocale )
42 : : throw(com::sun::star::uno::RuntimeException);
43 : :
44 : : void SAL_CALL
45 : : loadModuleByImplName( const rtl::OUString& implName, const com::sun::star::lang::Locale& rLocale )
46 : : throw(com::sun::star::uno::RuntimeException);
47 : :
48 : : void SAL_CALL
49 : : loadModulesByImplNames(const com::sun::star::uno::Sequence< rtl::OUString >& modNamelist, const com::sun::star::lang::Locale& rLocale)
50 : : throw(com::sun::star::uno::RuntimeException);
51 : :
52 : : com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
53 : : getAvailableModules( const com::sun::star::lang::Locale& rLocale, sal_Int16 sType )
54 : : throw(com::sun::star::uno::RuntimeException);
55 : :
56 : : // Methods which should be implemented in each transliteration module.
57 : : virtual rtl::OUString SAL_CALL getName() throw(com::sun::star::uno::RuntimeException);
58 : :
59 : : virtual sal_Int16 SAL_CALL getType( ) throw(com::sun::star::uno::RuntimeException) = 0;
60 : :
61 : : virtual rtl::OUString SAL_CALL
62 : : transliterate( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset )
63 : : throw(com::sun::star::uno::RuntimeException) = 0;
64 : :
65 : : virtual rtl::OUString SAL_CALL
66 : : folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset)
67 : : throw(com::sun::star::uno::RuntimeException) = 0;
68 : :
69 : : // Methods in XExtendedTransliteration
70 : : virtual rtl::OUString SAL_CALL
71 : : transliterateString2String( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount )
72 : : throw(com::sun::star::uno::RuntimeException);
73 : : virtual rtl::OUString SAL_CALL
74 : : transliterateChar2String( sal_Unicode inChar)
75 : : throw(com::sun::star::uno::RuntimeException);
76 : : virtual sal_Unicode SAL_CALL
77 : : transliterateChar2Char( sal_Unicode inChar )
78 : : throw(com::sun::star::i18n::MultipleCharsOutputException,
79 : : com::sun::star::uno::RuntimeException) = 0;
80 : :
81 : : virtual sal_Bool SAL_CALL
82 : : equals( const rtl::OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1, const rtl::OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 )
83 : : throw(com::sun::star::uno::RuntimeException) = 0;
84 : :
85 : : virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
86 : : transliterateRange( const rtl::OUString& str1, const rtl::OUString& str2 )
87 : : throw(com::sun::star::uno::RuntimeException) = 0;
88 : :
89 : : virtual sal_Int32 SAL_CALL
90 : : compareSubstring( const rtl::OUString& s1, sal_Int32 off1, sal_Int32 len1, const rtl::OUString& s2, sal_Int32 off2, sal_Int32 len2)
91 : : throw(com::sun::star::uno::RuntimeException);
92 : :
93 : : virtual sal_Int32 SAL_CALL
94 : : compareString( const rtl::OUString& s1, const rtl::OUString& s2)
95 : : throw(com::sun::star::uno::RuntimeException);
96 : :
97 : : //XServiceInfo
98 : : virtual rtl::OUString SAL_CALL getImplementationName()
99 : : throw( com::sun::star::uno::RuntimeException );
100 : : virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
101 : : throw( com::sun::star::uno::RuntimeException );
102 : : virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
103 : : throw( com::sun::star::uno::RuntimeException );
104 : : protected:
105 : : com::sun::star::lang::Locale aLocale;
106 : : const sal_Char* transliterationName;
107 : : const sal_Char* implementationName;
108 : : sal_Bool useOffset;
109 : : };
110 : :
111 : : } } } }
112 : :
113 : : #endif // _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|