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 INCLUDED_LINGUISTIC_HYPHDTA_HXX
21 #define INCLUDED_LINGUISTIC_HYPHDTA_HXX
23 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
24 #include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
25 #include <cppuhelper/implbase1.hxx>
26 #include <linguistic/lngdllapi.h>
31 class HyphenatedWord
:
32 public cppu::WeakImplHelper1
34 ::com::sun::star::linguistic2::XHyphenatedWord
38 OUString aHyphenatedWord
;
40 sal_Int16 nHyphenationPos
;
44 HyphenatedWord(const HyphenatedWord
&) SAL_DELETED_FUNCTION
;
45 HyphenatedWord
& operator = (const HyphenatedWord
&) SAL_DELETED_FUNCTION
;
48 HyphenatedWord(const OUString
&rWord
, sal_Int16 nLang
, sal_Int16 nHyphenationPos
,
49 const OUString
&rHyphenatedWord
, sal_Int16 nHyphenPos
);
50 virtual ~HyphenatedWord();
53 virtual OUString SAL_CALL
55 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
56 virtual ::com::sun::star::lang::Locale SAL_CALL
58 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
59 virtual sal_Int16 SAL_CALL
61 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
62 virtual OUString SAL_CALL
64 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
65 virtual sal_Int16 SAL_CALL
67 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
68 virtual sal_Bool SAL_CALL
69 isAlternativeSpelling()
70 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 OUString
GetWord() { return aWord
; }
73 OUString
GetHyphenatedWord() { return aHyphenatedWord
; }
74 sal_Int16
GetLanguage() { return nLanguage
; }
75 void SetWord( OUString
&rTxt
) { aWord
= rTxt
; }
76 void SetHyphenatedWord( OUString
&rTxt
) { aHyphenatedWord
= rTxt
; }
77 void SetLanguage( sal_Int16 nLang
) { nLanguage
= nLang
; }
78 static com::sun::star::uno::Reference
<com::sun::star::linguistic2::XHyphenatedWord
> LNG_DLLPUBLIC
CreateHyphenatedWord(
79 const OUString
&rWord
, sal_Int16 nLang
, sal_Int16 nHyphenationPos
,
80 const OUString
&rHyphenatedWord
, sal_Int16 nHyphenPos
);
84 class PossibleHyphens
:
85 public cppu::WeakImplHelper1
87 ::com::sun::star::linguistic2::XPossibleHyphens
91 OUString aWordWithHyphens
;
92 ::com::sun::star::uno::Sequence
< sal_Int16
> aOrigHyphenPos
;
95 PossibleHyphens(const PossibleHyphens
&) SAL_DELETED_FUNCTION
;
96 PossibleHyphens
& operator = (const PossibleHyphens
&) SAL_DELETED_FUNCTION
;
99 PossibleHyphens(const OUString
&rWord
, sal_Int16 nLang
,
100 const OUString
&rHyphWord
,
101 const ::com::sun::star::uno::Sequence
< sal_Int16
> &rPositions
);
102 virtual ~PossibleHyphens();
105 virtual OUString SAL_CALL
107 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual ::com::sun::star::lang::Locale SAL_CALL
110 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 virtual OUString SAL_CALL
113 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 virtual ::com::sun::star::uno::Sequence
< sal_Int16
> SAL_CALL
115 getHyphenationPositions()
116 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 OUString
GetWord() { return aWord
; }
119 sal_Int16
GetLanguage() { return nLanguage
; }
120 void SetWord( OUString
&rTxt
) { aWord
= rTxt
; }
121 void SetLanguage( sal_Int16 nLang
) { nLanguage
= nLang
; }
123 static com::sun::star::uno::Reference
< com::sun::star::linguistic2::XPossibleHyphens
> LNG_DLLPUBLIC CreatePossibleHyphens
124 (const OUString
&rWord
, sal_Int16 nLang
,
125 const OUString
&rHyphWord
,
126 const ::com::sun::star::uno::Sequence
< sal_Int16
> &rPositions
);
128 } // namespace linguistic
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */