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 		    throw(com::sun::star::uno::RuntimeException);
41 	Boundary SAL_CALL previousWord( const rtl::OUString& Text, sal_Int32 nStartPos,
42 		    const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType)
43 		    throw(com::sun::star::uno::RuntimeException);
44 	Boundary SAL_CALL getWordBoundary( const rtl::OUString& Text, sal_Int32 nPos,
45 		    const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType, sal_Bool bDirection )
46 		    throw(com::sun::star::uno::RuntimeException);
47 	LineBreakResults SAL_CALL getLineBreak( const rtl::OUString& Text, sal_Int32 nStartPos,
48 		const com::sun::star::lang::Locale& nLocale, sal_Int32 nMinBreakPos,
49 		const LineBreakHyphenationOptions& hOptions, const LineBreakUserOptions& bOptions )
50 		throw(com::sun::star::uno::RuntimeException);
51 
52 protected:
53 	xdictionary *dict;
54     rtl::OUString hangingCharacters;
55 };
56 
57 #define BREAKITERATOR_CJK( lang ) \
58 class BreakIterator_##lang : public BreakIterator_CJK {\
59 public:\
60 	BreakIterator_##lang (); \
61 	~BreakIterator_##lang (); \
62 };
63 
64 #ifdef BREAKITERATOR_ALL
65 BREAKITERATOR_CJK( zh )
66 BREAKITERATOR_CJK( zh_TW )
67 BREAKITERATOR_CJK( ja )
68 BREAKITERATOR_CJK( ko )
69 #endif
70 #undef BREAKITERATOR__CJK
71 
72 } } } }
73 
74 #endif // _I18N_BREAKITERATOR_CJK_HXX_
75