1*63ce064aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*63ce064aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*63ce064aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*63ce064aSAndrew Rist * distributed with this work for additional information 6*63ce064aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*63ce064aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*63ce064aSAndrew Rist * "License"); you may not use this file except in compliance 9*63ce064aSAndrew Rist * with the License. You may obtain a copy of the License at 10*63ce064aSAndrew Rist * 11*63ce064aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*63ce064aSAndrew Rist * 13*63ce064aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*63ce064aSAndrew Rist * software distributed under the License is distributed on an 15*63ce064aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*63ce064aSAndrew Rist * KIND, either express or implied. See the License for the 17*63ce064aSAndrew Rist * specific language governing permissions and limitations 18*63ce064aSAndrew Rist * under the License. 19*63ce064aSAndrew Rist * 20*63ce064aSAndrew Rist *************************************************************/ 21*63ce064aSAndrew Rist 22*63ce064aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _LINGUISTIC_HYPHDTA_HXX_ 25cdf0e10cSrcweir #define _LINGUISTIC_HYPHDTA_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> 29cdf0e10cSrcweir #include <com/sun/star/linguistic2/XPossibleHyphens.hpp> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <tools/solar.h> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type 34cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> // helper for implementations 35cdf0e10cSrcweir 36cdf0e10cSrcweir 37cdf0e10cSrcweir namespace linguistic 38cdf0e10cSrcweir { 39cdf0e10cSrcweir 40cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////// 41cdf0e10cSrcweir 42cdf0e10cSrcweir class HyphenatedWord : 43cdf0e10cSrcweir public cppu::WeakImplHelper1 44cdf0e10cSrcweir < 45cdf0e10cSrcweir ::com::sun::star::linguistic2::XHyphenatedWord 46cdf0e10cSrcweir > 47cdf0e10cSrcweir { 48cdf0e10cSrcweir ::rtl::OUString aWord; 49cdf0e10cSrcweir ::rtl::OUString aHyphenatedWord; 50cdf0e10cSrcweir sal_Int16 nHyphPos; 51cdf0e10cSrcweir sal_Int16 nHyphenationPos; 52cdf0e10cSrcweir sal_Int16 nLanguage; 53cdf0e10cSrcweir sal_Bool bIsAltSpelling; 54cdf0e10cSrcweir 55cdf0e10cSrcweir // disallow copy-constructor and assignment-operator for now 56cdf0e10cSrcweir HyphenatedWord(const HyphenatedWord &); 57cdf0e10cSrcweir HyphenatedWord & operator = (const HyphenatedWord &); 58cdf0e10cSrcweir 59cdf0e10cSrcweir public: 60cdf0e10cSrcweir HyphenatedWord(const ::rtl::OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos, 61cdf0e10cSrcweir const ::rtl::OUString &rHyphenatedWord, sal_Int16 nHyphenPos ); 62cdf0e10cSrcweir virtual ~HyphenatedWord(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir // XHyphenatedWord 65cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 66cdf0e10cSrcweir getWord() 67cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL 69cdf0e10cSrcweir getLocale() 70cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 71cdf0e10cSrcweir virtual sal_Int16 SAL_CALL 72cdf0e10cSrcweir getHyphenationPos() 73cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 75cdf0e10cSrcweir getHyphenatedWord() 76cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual sal_Int16 SAL_CALL 78cdf0e10cSrcweir getHyphenPos() 79cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual sal_Bool SAL_CALL 81cdf0e10cSrcweir isAlternativeSpelling() 82cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 83cdf0e10cSrcweir GetWord()84cdf0e10cSrcweir ::rtl::OUString GetWord() { return aWord; } GetHyphenatedWord()85cdf0e10cSrcweir ::rtl::OUString GetHyphenatedWord() { return aHyphenatedWord; } GetLanguage()86cdf0e10cSrcweir sal_Int16 GetLanguage() { return nLanguage; } SetWord(::rtl::OUString & rTxt)87cdf0e10cSrcweir void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } SetHyphenatedWord(::rtl::OUString & rTxt)88cdf0e10cSrcweir void SetHyphenatedWord( ::rtl::OUString &rTxt ) { aHyphenatedWord = rTxt; } SetLanguage(sal_Int16 nLang)89cdf0e10cSrcweir void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; } 90cdf0e10cSrcweir }; 91cdf0e10cSrcweir 92cdf0e10cSrcweir 93cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////// 94cdf0e10cSrcweir 95cdf0e10cSrcweir class PossibleHyphens : 96cdf0e10cSrcweir public cppu::WeakImplHelper1 97cdf0e10cSrcweir < 98cdf0e10cSrcweir ::com::sun::star::linguistic2::XPossibleHyphens 99cdf0e10cSrcweir > 100cdf0e10cSrcweir { 101cdf0e10cSrcweir ::rtl::OUString aWord; 102cdf0e10cSrcweir ::rtl::OUString aWordWithHyphens; 103cdf0e10cSrcweir ::com::sun::star::uno::Sequence< sal_Int16 > aOrigHyphenPos; 104cdf0e10cSrcweir sal_Int16 nLanguage; 105cdf0e10cSrcweir 106cdf0e10cSrcweir // disallow copy-constructor and assignment-operator for now 107cdf0e10cSrcweir PossibleHyphens(const PossibleHyphens &); 108cdf0e10cSrcweir PossibleHyphens & operator = (const PossibleHyphens &); 109cdf0e10cSrcweir 110cdf0e10cSrcweir public: 111cdf0e10cSrcweir PossibleHyphens(const ::rtl::OUString &rWord, sal_Int16 nLang, 112cdf0e10cSrcweir const ::rtl::OUString &rHyphWord, 113cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions); 114cdf0e10cSrcweir virtual ~PossibleHyphens(); 115cdf0e10cSrcweir 116cdf0e10cSrcweir // XPossibleHyphens 117cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 118cdf0e10cSrcweir getWord() 119cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 120cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL 121cdf0e10cSrcweir getLocale() 122cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 123cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 124cdf0e10cSrcweir getPossibleHyphens() 125cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 126cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL 127cdf0e10cSrcweir getHyphenationPositions() 128cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 129cdf0e10cSrcweir GetWord()130cdf0e10cSrcweir ::rtl::OUString GetWord() { return aWord; } GetLanguage()131cdf0e10cSrcweir sal_Int16 GetLanguage() { return nLanguage; } SetWord(::rtl::OUString & rTxt)132cdf0e10cSrcweir void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; } SetLanguage(sal_Int16 nLang)133cdf0e10cSrcweir void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; } 134cdf0e10cSrcweir }; 135cdf0e10cSrcweir 136cdf0e10cSrcweir 137cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////// 138cdf0e10cSrcweir 139cdf0e10cSrcweir } // namespace linguistic 140cdf0e10cSrcweir 141cdf0e10cSrcweir #endif 142cdf0e10cSrcweir 143