LibreOffice Module lingucomponent (master) 1
languagetoolimp.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#pragma once
20#include <com/sun/star/lang/XInitialization.hpp>
21#include <com/sun/star/lang/XServiceDisplayName.hpp>
22#include <com/sun/star/lang/XServiceInfo.hpp>
23#include <com/sun/star/lang/XServiceName.hpp>
24#include <com/sun/star/linguistic2/XProofreader.hpp>
25#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/beans/PropertyValues.hpp>
28#include <linguistic/misc.hxx>
29#include <string_view>
30#include <o3tl/lru_map.hxx>
31#include <tools/long.hxx>
32
34 : public cppu::WeakImplHelper<css::linguistic2::XProofreader, css::lang::XInitialization,
35 css::lang::XServiceInfo, css::lang::XServiceDisplayName>
36{
37 css::uno::Sequence<css::lang::Locale> m_aSuppLocales;
42
43public:
45 virtual ~LanguageToolGrammarChecker() override;
46
47 // XSupportedLocales
48 virtual css::uno::Sequence<css::lang::Locale> SAL_CALL getLocales() override;
49 virtual sal_Bool SAL_CALL hasLocale(const css::lang::Locale& rLocale) override;
50
51 // XProofReader
52 virtual sal_Bool SAL_CALL isSpellChecker() override;
53 virtual css::linguistic2::ProofreadingResult SAL_CALL
54 doProofreading(const OUString& aDocumentIdentifier, const OUString& aText,
55 const css::lang::Locale& aLocale, sal_Int32 nStartOfSentencePosition,
56 sal_Int32 nSuggestedBehindEndOfSentencePosition,
57 const css::uno::Sequence<css::beans::PropertyValue>& aProperties) override;
58
59 virtual void SAL_CALL ignoreRule(const OUString& aRuleIdentifier,
60 const css::lang::Locale& aLocale) override;
61 virtual void SAL_CALL resetIgnoreRules() override;
62
63 // XServiceDisplayName
64 virtual OUString SAL_CALL getServiceDisplayName(const css::lang::Locale& rLocale) override;
65
66 // XInitialization
67 virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
68
69 // XServiceInfo
70 virtual OUString SAL_CALL getImplementationName() override;
71 virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
72 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
73};
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual sal_Bool SAL_CALL hasLocale(const css::lang::Locale &rLocale) override
o3tl::lru_map< OString, css::uno::Sequence< css::linguistic2::SingleProofreadingError > > mCachedResults
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL isSpellChecker() override
virtual css::linguistic2::ProofreadingResult SAL_CALL doProofreading(const OUString &aDocumentIdentifier, const OUString &aText, const css::lang::Locale &aLocale, sal_Int32 nStartOfSentencePosition, sal_Int32 nSuggestedBehindEndOfSentencePosition, const css::uno::Sequence< css::beans::PropertyValue > &aProperties) override
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getLocales() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
virtual OUString SAL_CALL getServiceDisplayName(const css::lang::Locale &rLocale) override
virtual void SAL_CALL resetIgnoreRules() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~LanguageToolGrammarChecker() override
LanguageToolGrammarChecker & operator=(const LanguageToolGrammarChecker &)=delete
virtual void SAL_CALL ignoreRule(const OUString &aRuleIdentifier, const css::lang::Locale &aLocale) override
css::uno::Sequence< css::lang::Locale > m_aSuppLocales
LanguageToolGrammarChecker(const LanguageToolGrammarChecker &)=delete
unsigned char sal_Bool