xref: /trunk/main/i18npool/inc/breakiterator_cjk.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _I18N_BREAKITERATOR_CJK_HXX_
24 #define _I18N_BREAKITERATOR_CJK_HXX_
25 
26 #include <breakiterator_unicode.hxx>
27 #include <xdictionary.hxx>
28 
29 namespace com { namespace sun { namespace star { namespace i18n {
30 //  ----------------------------------------------------
31 //  class BreakIterator_CJK
32 //  ----------------------------------------------------
33 class BreakIterator_CJK : public BreakIterator_Unicode
34 {
35 public:
36     BreakIterator_CJK();
37 
38     Boundary SAL_CALL nextWord( const rtl::OUString& Text, sal_Int32 nStartPos,
39             const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType);
40     Boundary SAL_CALL previousWord( const rtl::OUString& Text, sal_Int32 nStartPos,
41             const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType);
42     Boundary SAL_CALL getWordBoundary( const rtl::OUString& Text, sal_Int32 nPos,
43             const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType, sal_Bool bDirection );
44     LineBreakResults SAL_CALL getLineBreak( const rtl::OUString& Text, sal_Int32 nStartPos,
45         const com::sun::star::lang::Locale& nLocale, sal_Int32 nMinBreakPos,
46         const LineBreakHyphenationOptions& hOptions, const LineBreakUserOptions& bOptions );
47 
48 protected:
49     xdictionary *dict;
50     rtl::OUString hangingCharacters;
51 };
52 
53 #define BREAKITERATOR_CJK( lang ) \
54 class BreakIterator_##lang : public BreakIterator_CJK {\
55 public:\
56     BreakIterator_##lang (); \
57     ~BreakIterator_##lang (); \
58 };
59 
60 #ifdef BREAKITERATOR_ALL
61 BREAKITERATOR_CJK( zh )
62 BREAKITERATOR_CJK( zh_TW )
63 BREAKITERATOR_CJK( ja )
64 BREAKITERATOR_CJK( ko )
65 #endif
66 #undef BREAKITERATOR__CJK
67 
68 } } } }
69 
70 #endif // _I18N_BREAKITERATOR_CJK_HXX_
71