1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hyphdta.hxx,v $
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
47 ///////////////////////////////////////////////////////////////////////////
49 class HyphenatedWord
:
50 public cppu::WeakImplHelper1
52 ::com::sun::star::linguistic2::XHyphenatedWord
55 ::rtl::OUString aWord
;
56 ::rtl::OUString aHyphenatedWord
;
58 INT16 nHyphenationPos
;
62 // disallow copy-constructor and assignment-operator for now
63 HyphenatedWord(const HyphenatedWord
&);
64 HyphenatedWord
& operator = (const HyphenatedWord
&);
67 HyphenatedWord(const ::rtl::OUString
&rWord
, INT16 nLang
, INT16 nHyphenationPos
,
68 const ::rtl::OUString
&rHyphenatedWord
, INT16 nHyphenPos
);
69 virtual ~HyphenatedWord();
72 virtual ::rtl::OUString SAL_CALL
74 throw(::com::sun::star::uno::RuntimeException
);
75 virtual ::com::sun::star::lang::Locale SAL_CALL
77 throw(::com::sun::star::uno::RuntimeException
);
78 virtual sal_Int16 SAL_CALL
80 throw(::com::sun::star::uno::RuntimeException
);
81 virtual ::rtl::OUString SAL_CALL
83 throw(::com::sun::star::uno::RuntimeException
);
84 virtual sal_Int16 SAL_CALL
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
;
113 // disallow copy-constructor and assignment-operator for now
114 PossibleHyphens(const PossibleHyphens
&);
115 PossibleHyphens
& operator = (const PossibleHyphens
&);
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();
124 virtual ::rtl::OUString SAL_CALL
126 throw(::com::sun::star::uno::RuntimeException
);
127 virtual ::com::sun::star::lang::Locale SAL_CALL
129 throw(::com::sun::star::uno::RuntimeException
);
130 virtual ::rtl::OUString SAL_CALL
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