1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _I18N_BREAKITERATOR_CJK_HXX_ 28 #define _I18N_BREAKITERATOR_CJK_HXX_ 29 30 #include <breakiterator_unicode.hxx> 31 #include <xdictionary.hxx> 32 33 namespace com { namespace sun { namespace star { namespace i18n { 34 // ---------------------------------------------------- 35 // class BreakIterator_CJK 36 // ---------------------------------------------------- 37 class BreakIterator_CJK : public BreakIterator_Unicode 38 { 39 public: 40 BreakIterator_CJK(); 41 42 Boundary SAL_CALL nextWord( const rtl::OUString& Text, sal_Int32 nStartPos, 43 const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType) 44 throw(com::sun::star::uno::RuntimeException); 45 Boundary SAL_CALL previousWord( const rtl::OUString& Text, sal_Int32 nStartPos, 46 const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType) 47 throw(com::sun::star::uno::RuntimeException); 48 Boundary SAL_CALL getWordBoundary( const rtl::OUString& Text, sal_Int32 nPos, 49 const com::sun::star::lang::Locale& nLocale, sal_Int16 WordType, sal_Bool bDirection ) 50 throw(com::sun::star::uno::RuntimeException); 51 LineBreakResults SAL_CALL getLineBreak( const rtl::OUString& Text, sal_Int32 nStartPos, 52 const com::sun::star::lang::Locale& nLocale, sal_Int32 nMinBreakPos, 53 const LineBreakHyphenationOptions& hOptions, const LineBreakUserOptions& bOptions ) 54 throw(com::sun::star::uno::RuntimeException); 55 56 protected: 57 xdictionary *dict; 58 rtl::OUString hangingCharacters; 59 }; 60 61 #define BREAKITERATOR_CJK( lang ) \ 62 class BreakIterator_##lang : public BreakIterator_CJK {\ 63 public:\ 64 BreakIterator_##lang (); \ 65 ~BreakIterator_##lang (); \ 66 }; 67 68 #ifdef BREAKITERATOR_ALL 69 BREAKITERATOR_CJK( zh ) 70 BREAKITERATOR_CJK( zh_TW ) 71 BREAKITERATOR_CJK( ja ) 72 BREAKITERATOR_CJK( ko ) 73 #endif 74 #undef BREAKITERATOR__CJK 75 76 } } } } 77 78 #endif // _I18N_BREAKITERATOR_CJK_HXX_ 79