update dev300-m58
[ooovba.git] / linguistic / inc / hyphdta.hxx
blob1d387206b9283bb1c1b00d7b38705c668d036bda
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hyphdta.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _LINGUISTIC_HYPHDTA_HXX_
32 #define _LINGUISTIC_HYPHDTA_HXX_
35 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
36 #include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
38 #include <tools/solar.h>
40 #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
41 #include <cppuhelper/implbase1.hxx> // helper for implementations
44 namespace linguistic
47 ///////////////////////////////////////////////////////////////////////////
49 class HyphenatedWord :
50 public cppu::WeakImplHelper1
52 ::com::sun::star::linguistic2::XHyphenatedWord
55 ::rtl::OUString aWord;
56 ::rtl::OUString aHyphenatedWord;
57 INT16 nHyphPos;
58 INT16 nHyphenationPos;
59 INT16 nLanguage;
60 BOOL bIsAltSpelling;
62 // disallow copy-constructor and assignment-operator for now
63 HyphenatedWord(const HyphenatedWord &);
64 HyphenatedWord & operator = (const HyphenatedWord &);
66 public:
67 HyphenatedWord(const ::rtl::OUString &rWord, INT16 nLang, INT16 nHyphenationPos,
68 const ::rtl::OUString &rHyphenatedWord, INT16 nHyphenPos );
69 virtual ~HyphenatedWord();
71 // XHyphenatedWord
72 virtual ::rtl::OUString SAL_CALL
73 getWord()
74 throw(::com::sun::star::uno::RuntimeException);
75 virtual ::com::sun::star::lang::Locale SAL_CALL
76 getLocale()
77 throw(::com::sun::star::uno::RuntimeException);
78 virtual sal_Int16 SAL_CALL
79 getHyphenationPos()
80 throw(::com::sun::star::uno::RuntimeException);
81 virtual ::rtl::OUString SAL_CALL
82 getHyphenatedWord()
83 throw(::com::sun::star::uno::RuntimeException);
84 virtual sal_Int16 SAL_CALL
85 getHyphenPos()
86 throw(::com::sun::star::uno::RuntimeException);
87 virtual sal_Bool SAL_CALL
88 isAlternativeSpelling()
89 throw(::com::sun::star::uno::RuntimeException);
91 ::rtl::OUString GetWord() { return aWord; }
92 ::rtl::OUString GetHyphenatedWord() { return aHyphenatedWord; }
93 INT16 GetLanguage() { return nLanguage; }
94 void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; }
95 void SetHyphenatedWord( ::rtl::OUString &rTxt ) { aHyphenatedWord = rTxt; }
96 void SetLanguage( INT16 nLang ) { nLanguage = nLang; }
100 ///////////////////////////////////////////////////////////////////////////
102 class PossibleHyphens :
103 public cppu::WeakImplHelper1
105 ::com::sun::star::linguistic2::XPossibleHyphens
108 ::rtl::OUString aWord;
109 ::rtl::OUString aWordWithHyphens;
110 ::com::sun::star::uno::Sequence< INT16 > aOrigHyphenPos;
111 INT16 nLanguage;
113 // disallow copy-constructor and assignment-operator for now
114 PossibleHyphens(const PossibleHyphens &);
115 PossibleHyphens & operator = (const PossibleHyphens &);
117 public:
118 PossibleHyphens(const ::rtl::OUString &rWord, INT16 nLang,
119 const ::rtl::OUString &rHyphWord,
120 const ::com::sun::star::uno::Sequence< INT16 > &rPositions);
121 virtual ~PossibleHyphens();
123 // XPossibleHyphens
124 virtual ::rtl::OUString SAL_CALL
125 getWord()
126 throw(::com::sun::star::uno::RuntimeException);
127 virtual ::com::sun::star::lang::Locale SAL_CALL
128 getLocale()
129 throw(::com::sun::star::uno::RuntimeException);
130 virtual ::rtl::OUString SAL_CALL
131 getPossibleHyphens()
132 throw(::com::sun::star::uno::RuntimeException);
133 virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL
134 getHyphenationPositions()
135 throw(::com::sun::star::uno::RuntimeException);
137 ::rtl::OUString GetWord() { return aWord; }
138 INT16 GetLanguage() { return nLanguage; }
139 void SetWord( ::rtl::OUString &rTxt ) { aWord = rTxt; }
140 void SetLanguage( INT16 nLang ) { nLanguage = nLang; }
144 ///////////////////////////////////////////////////////////////////////////
146 } // namespace linguistic
148 #endif