Bump version to 6.4-15
[LibreOffice.git] / include / linguistic / hyphdta.hxx
blob23f1c87d0e30b47dd6d233bb45a4f8ed33881537
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/implbase.hxx>
26 #include <linguistic/lngdllapi.h>
27 #include <i18nlangtag/lang.h>
29 namespace linguistic
32 class HyphenatedWord final :
33 public cppu::WeakImplHelper< css::linguistic2::XHyphenatedWord >
35 OUString aWord;
36 OUString aHyphenatedWord;
37 sal_Int16 nHyphPos;
38 sal_Int16 nHyphenationPos;
39 LanguageType nLanguage;
40 bool bIsAltSpelling;
42 HyphenatedWord(const HyphenatedWord &) = delete;
43 HyphenatedWord & operator = (const HyphenatedWord &) = delete;
45 public:
46 HyphenatedWord(const OUString &rWord, LanguageType nLang, sal_Int16 nHyphenationPos,
47 const OUString &rHyphenatedWord, sal_Int16 nHyphenPos );
48 virtual ~HyphenatedWord() override;
50 // XHyphenatedWord
51 virtual OUString SAL_CALL
52 getWord() override;
53 virtual css::lang::Locale SAL_CALL
54 getLocale() override;
55 virtual sal_Int16 SAL_CALL
56 getHyphenationPos() override;
57 virtual OUString SAL_CALL
58 getHyphenatedWord() override;
59 virtual sal_Int16 SAL_CALL
60 getHyphenPos() override;
61 virtual sal_Bool SAL_CALL
62 isAlternativeSpelling() override;
64 static css::uno::Reference <css::linguistic2::XHyphenatedWord> LNG_DLLPUBLIC CreateHyphenatedWord(
65 const OUString &rWord, LanguageType nLang, sal_Int16 nHyphenationPos,
66 const OUString &rHyphenatedWord, sal_Int16 nHyphenPos );
70 class PossibleHyphens final :
71 public cppu::WeakImplHelper
73 css::linguistic2::XPossibleHyphens
76 OUString aWord;
77 OUString aWordWithHyphens;
78 css::uno::Sequence< sal_Int16 > aOrigHyphenPos;
79 LanguageType nLanguage;
81 PossibleHyphens(const PossibleHyphens &) = delete;
82 PossibleHyphens & operator = (const PossibleHyphens &) = delete;
84 public:
85 PossibleHyphens(const OUString &rWord, LanguageType nLang,
86 const OUString &rHyphWord,
87 const css::uno::Sequence< sal_Int16 > &rPositions);
88 virtual ~PossibleHyphens() override;
90 // XPossibleHyphens
91 virtual OUString SAL_CALL
92 getWord() override;
93 virtual css::lang::Locale SAL_CALL
94 getLocale() override;
95 virtual OUString SAL_CALL
96 getPossibleHyphens() override;
97 virtual css::uno::Sequence< sal_Int16 > SAL_CALL
98 getHyphenationPositions() override;
100 static css::uno::Reference < css::linguistic2::XPossibleHyphens > LNG_DLLPUBLIC CreatePossibleHyphens
101 (const OUString &rWord, LanguageType nLang,
102 const OUString &rHyphWord,
103 const css::uno::Sequence< sal_Int16 > &rPositions);
105 } // namespace linguistic
107 #endif
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */