summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2022-05-10 13:06:06 +0300
committerMert Tumer <mert.tumer@collabora.com>2022-06-14 16:13:22 +0200
commit7686dceb70881e8a3c4ac7f18ced15e5202de8c7 (patch)
treeb73601bbbc496eef7796349e224eadcd702d012a /include
parentb5e01104fc7df9b715a70bc1cc86ad1af13b51fa (diff)
LanguageTool Grammar Checker implementation
Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I275cbea668afc5beb5147370119631df8b6a2d46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135464
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/pageids.hxx1
-rw-r--r--include/svtools/languagetoolcfg.hxx59
-rw-r--r--include/svtools/strings.hrc1
-rw-r--r--include/unotools/lingucfg.hxx2
4 files changed, 63 insertions, 0 deletions
diff --git a/include/sfx2/pageids.hxx b/include/sfx2/pageids.hxx
index 1dcba1219c31..9371848b784a 100644
--- a/include/sfx2/pageids.hxx
+++ b/include/sfx2/pageids.hxx
@@ -56,6 +56,7 @@
#define RID_SVXPAGE_PERSONALIZATION (RID_SVX_START + 247)
#define RID_SVXPAGE_COLORCONFIG (RID_SVX_START + 249)
#define RID_SVXPAGE_BASICIDE_OPTIONS (RID_SVX_START + 209)
+#define RID_SVXPAGE_LANGTOOL_OPTIONS (RID_SVX_START + 210)
// Resource-Id's ------------------------------------------------------------
diff --git a/include/svtools/languagetoolcfg.hxx b/include/svtools/languagetoolcfg.hxx
new file mode 100644
index 000000000000..7578ad6ba281
--- /dev/null
+++ b/include/svtools/languagetoolcfg.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+#include <unotools/configitem.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <svtools/svtdllapi.h>
+
+using namespace utl;
+using namespace com::sun::star::uno;
+
+struct LanguageToolOptions_Impl;
+
+class SVT_DLLPUBLIC SvxLanguageToolOptions final : public utl::ConfigItem
+{
+public:
+ SvxLanguageToolOptions();
+ virtual ~SvxLanguageToolOptions() override;
+
+ virtual void Notify(const css::uno::Sequence<OUString>& _rPropertyNames) override;
+ static SvxLanguageToolOptions& Get();
+
+ const OUString& getBaseURL() const;
+ void setBaseURL(const OUString& rVal);
+
+ const OUString& getUsername() const;
+ void setUsername(const OUString& rVal);
+
+ OUString getLocaleListURL() const;
+ OUString getCheckerURL() const;
+
+ const OUString& getApiKey() const;
+ void setApiKey(const OUString& rVal);
+
+ bool getEnabled() const;
+ void setEnabled(bool enabled);
+
+private:
+ std::unique_ptr<LanguageToolOptions_Impl> pImpl;
+ void Load(const css::uno::Sequence<OUString>& rPropertyNames);
+ virtual void ImplCommit() override;
+ static const Sequence<OUString>& GetPropertyNames();
+};
diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index 80d8d2e7fa5c..eb6af564eb4f 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -338,5 +338,6 @@
#define STR_DESCRIPTION_LIBHYPHEN NC_("STR_DESCRIPTION_LIBHYPHEN", "Libhyphen Hyphenator")
#define STR_DESCRIPTION_MYTHES NC_("STR_DESCRIPTION_MYTHES", "MyThes Thesaurus")
#define STR_DESCRIPTION_IGNOREALLLIST NC_("STR_DESCRIPTION_IGNOREALLLIST", "List of Ignored Words")
+#define STR_DESCRIPTION_LANGUAGETOOL NC_("STR_DESCRIPTION_LANGUAGETOOL", "LanguageTool Remote Grammar Checker")
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotools/lingucfg.hxx b/include/unotools/lingucfg.hxx
index 20c678b96b4f..d3e00588ead4 100644
--- a/include/unotools/lingucfg.hxx
+++ b/include/unotools/lingucfg.hxx
@@ -192,6 +192,8 @@ public:
bool GetDictionaryEntry( const OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
+ bool GetLocaleListFor( const OUString &rSetName, const OUString &rSetEntry, css::uno::Sequence< OUString > &rFormatList ) const;
+
css::uno::Sequence< OUString > GetDisabledDictionaries() const;
std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( std::u16string_view rFormatName ) const;