LibreOffice Module linguistic (master) 1
spelldta.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_LINGUISTIC_SPELLDTA_HXX
21#define INCLUDED_LINGUISTIC_SPELLDTA_HXX
22
23#include <vector>
24#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
25#include <com/sun/star/linguistic2/XSetSpellAlternatives.hpp>
28#include <i18nlangtag/lang.h>
29#include <config_options.h>
30
31namespace com::sun::star::linguistic2 { class XSearchableDictionaryList; }
32
33
34namespace linguistic
35{
36
37std::vector< OUString >
39 std::vector< OUString > &rAlt1,
40 std::vector< OUString > &rAlt2 );
41
43 std::vector< OUString > &rSeq,
44 css::uno::Reference< css::linguistic2::XSearchableDictionaryList > const &rxDicList,
45 LanguageType nLanguage );
46
47void SearchSimilarText( const OUString &rText, LanguageType nLanguage,
48 css::uno::Reference< css::linguistic2::XSearchableDictionaryList > const &xDicList,
49 std::vector< OUString > & rDicListProps );
50
51
53 : public cppu::WeakImplHelper
54 <
55 css::linguistic2::XSpellAlternatives,
56 css::linguistic2::XSetSpellAlternatives
57 >
58{
59 css::uno::Sequence< OUString > aAlt; // list of alternatives, may be empty.
60 OUString aWord;
61 sal_Int16 nType; // type of failure
63
64public:
67 const css::uno::Sequence< OUString > &rAlternatives );
68 virtual ~SpellAlternatives() override;
71
72 // XSpellAlternatives
73 virtual OUString SAL_CALL getWord( ) override;
74 virtual css::lang::Locale SAL_CALL getLocale( ) override;
75 virtual ::sal_Int16 SAL_CALL getFailureType( ) override;
76 virtual ::sal_Int16 SAL_CALL getAlternativesCount( ) override;
77 virtual css::uno::Sequence< OUString > SAL_CALL getAlternatives( ) override;
78
79 // XSetSpellAlternatives
80 virtual void SAL_CALL setAlternatives( const css::uno::Sequence< OUString >& aAlternatives ) override;
81 virtual void SAL_CALL setFailureType( ::sal_Int16 nFailureType ) override;
82
83 // non-interface specific functions
84 void UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetWordLanguage(const OUString &rWord, LanguageType nLang);
85 void UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetFailureType(sal_Int16 nTypeP);
86 void UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetAlternatives( const css::uno::Sequence< OUString > &rAlt );
87 static css::uno::Reference < css::linguistic2::XSpellAlternatives > UNLESS_MERGELIBS(LNG_DLLPUBLIC) CreateSpellAlternatives(
88 const OUString &rWord, LanguageType nLang, sal_Int16 nTypeP, const css::uno::Sequence< OUString > &rAlt );
89};
90
91} // namespace linguistic
92
93#endif
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getWord() override
Definition: spelldta.cxx:186
virtual void SAL_CALL setAlternatives(const css::uno::Sequence< OUString > &aAlternatives) override
Definition: spelldta.cxx:221
UNLESS_MERGELIBS(LNG_DLLPUBLIC) SpellAlternatives()
virtual css::lang::Locale SAL_CALL getLocale() override
Definition: spelldta.cxx:193
virtual ::sal_Int16 SAL_CALL getFailureType() override
Definition: spelldta.cxx:200
SpellAlternatives(const SpellAlternatives &)=delete
void LanguageType nLang
Definition: spelldta.hxx:84
void UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetFailureType(sal_Int16 nTypeP)
css::uno::Sequence< OUString > aAlt
Definition: spelldta.hxx:59
virtual css::uno::Sequence< OUString > SAL_CALL getAlternatives() override
Definition: spelldta.cxx:214
virtual void SAL_CALL setFailureType(::sal_Int16 nFailureType) override
Definition: spelldta.cxx:228
virtual ::sal_Int16 SAL_CALL getAlternativesCount() override
Definition: spelldta.cxx:207
void static UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetAlternatives(const css css::uno::Reference< css::linguistic2::XSpellAlternatives > LanguageType sal_Int16 const css::uno::Sequence< OUString > & rAlt
Definition: spelldta.hxx:88
void static UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetAlternatives(const css css::uno::Reference< css::linguistic2::XSpellAlternatives > LanguageType sal_Int16 nTypeP
Definition: spelldta.hxx:88
void static UNLESS_MERGELIBS(LNG_DLLPUBLIC) SetAlternatives(const css css::uno::Reference< css::linguistic2::XSpellAlternatives > UNLESS_MERGELIBS(LNG_DLLPUBLIC) CreateSpellAlternatives(const OUString &rWord
virtual ~SpellAlternatives() override
Definition: spelldta.cxx:181
SpellAlternatives(OUString aWord, LanguageType nLang, const css::uno::Sequence< OUString > &rAlternatives)
SpellAlternatives & operator=(const SpellAlternatives &)=delete
#define LNG_DLLPUBLIC
Definition: lngdllapi.h:29
void SearchSimilarText(const OUString &rText, LanguageType nLanguage, Reference< XSearchableDictionaryList > const &xDicList, std::vector< OUString > &rDicListProps)
Definition: spelldta.cxx:63
void SeqRemoveNegEntries(std::vector< OUString > &rSeq, Reference< XSearchableDictionaryList > const &rxDicList, LanguageType nLanguage)
Definition: spelldta.cxx:107
std::vector< OUString > MergeProposalSeqs(std::vector< OUString > &rAlt1, std::vector< OUString > &rAlt2)
Definition: spelldta.cxx:132