1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _LINGUISTIC_HYPHDTA_HXX_
21 #define _LINGUISTIC_HYPHDTA_HXX_
23 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
24 #include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
25 #include <tools/solar.h>
26 #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
27 #include <cppuhelper/implbase1.hxx> // helper for implementations
28 #include <linguistic/lngdllapi.h>
33 class HyphenatedWord
:
34 public cppu::WeakImplHelper1
36 ::com::sun::star::linguistic2::XHyphenatedWord
40 OUString aHyphenatedWord
;
42 sal_Int16 nHyphenationPos
;
44 sal_Bool bIsAltSpelling
;
46 // disallow copy-constructor and assignment-operator for now
47 HyphenatedWord(const HyphenatedWord
&);
48 HyphenatedWord
& operator = (const HyphenatedWord
&);
51 HyphenatedWord(const OUString
&rWord
, sal_Int16 nLang
, sal_Int16 nHyphenationPos
,
52 const OUString
&rHyphenatedWord
, sal_Int16 nHyphenPos
);
53 virtual ~HyphenatedWord();
56 virtual OUString SAL_CALL
58 throw(::com::sun::star::uno::RuntimeException
);
59 virtual ::com::sun::star::lang::Locale SAL_CALL
61 throw(::com::sun::star::uno::RuntimeException
);
62 virtual sal_Int16 SAL_CALL
64 throw(::com::sun::star::uno::RuntimeException
);
65 virtual OUString SAL_CALL
67 throw(::com::sun::star::uno::RuntimeException
);
68 virtual sal_Int16 SAL_CALL
70 throw(::com::sun::star::uno::RuntimeException
);
71 virtual sal_Bool SAL_CALL
72 isAlternativeSpelling()
73 throw(::com::sun::star::uno::RuntimeException
);
75 OUString
GetWord() { return aWord
; }
76 OUString
GetHyphenatedWord() { return aHyphenatedWord
; }
77 sal_Int16
GetLanguage() { return nLanguage
; }
78 void SetWord( OUString
&rTxt
) { aWord
= rTxt
; }
79 void SetHyphenatedWord( OUString
&rTxt
) { aHyphenatedWord
= rTxt
; }
80 void SetLanguage( sal_Int16 nLang
) { nLanguage
= nLang
; }
81 static com::sun::star::uno::Reference
<com::sun::star::linguistic2::XHyphenatedWord
> LNG_DLLPUBLIC
CreateHyphenatedWord(
82 const OUString
&rWord
, sal_Int16 nLang
, sal_Int16 nHyphenationPos
,
83 const OUString
&rHyphenatedWord
, sal_Int16 nHyphenPos
);
87 class PossibleHyphens
:
88 public cppu::WeakImplHelper1
90 ::com::sun::star::linguistic2::XPossibleHyphens
94 OUString aWordWithHyphens
;
95 ::com::sun::star::uno::Sequence
< sal_Int16
> aOrigHyphenPos
;
98 // disallow copy-constructor and assignment-operator for now
99 PossibleHyphens(const PossibleHyphens
&);
100 PossibleHyphens
& operator = (const PossibleHyphens
&);
103 PossibleHyphens(const OUString
&rWord
, sal_Int16 nLang
,
104 const OUString
&rHyphWord
,
105 const ::com::sun::star::uno::Sequence
< sal_Int16
> &rPositions
);
106 virtual ~PossibleHyphens();
109 virtual OUString SAL_CALL
111 throw(::com::sun::star::uno::RuntimeException
);
112 virtual ::com::sun::star::lang::Locale SAL_CALL
114 throw(::com::sun::star::uno::RuntimeException
);
115 virtual OUString SAL_CALL
117 throw(::com::sun::star::uno::RuntimeException
);
118 virtual ::com::sun::star::uno::Sequence
< sal_Int16
> SAL_CALL
119 getHyphenationPositions()
120 throw(::com::sun::star::uno::RuntimeException
);
122 OUString
GetWord() { return aWord
; }
123 sal_Int16
GetLanguage() { return nLanguage
; }
124 void SetWord( OUString
&rTxt
) { aWord
= rTxt
; }
125 void SetLanguage( sal_Int16 nLang
) { nLanguage
= nLang
; }
127 static com::sun::star::uno::Reference
< com::sun::star::linguistic2::XPossibleHyphens
> LNG_DLLPUBLIC CreatePossibleHyphens
128 (const OUString
&rWord
, sal_Int16 nLang
,
129 const OUString
&rHyphWord
,
130 const ::com::sun::star::uno::Sequence
< sal_Int16
> &rPositions
);
132 } // namespace linguistic
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */