summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2022-11-21 21:27:24 -0400
committerAndras Timar <andras.timar@collabora.com>2023-01-28 10:58:10 +0100
commit3a8e5423499d93bb5921524a587e2d0b870a54ea (patch)
treee3cb29371e7d95f7989dd87451909831a2929aa9
parent53d0c957d3bc178248c6bead508622098fb03050 (diff)
svtools: add new entry "RestProtocol"
Custom Rest API protocol Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: If2f72330f2ed9768f230dc88296df7f757be263a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143105 Reviewed-by: Ashod Nakashian <ash@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145605 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--include/svtools/languagetoolcfg.hxx3
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs6
-rw-r--r--svtools/source/config/languagetoolcfg.cxx21
3 files changed, 29 insertions, 1 deletions
diff --git a/include/svtools/languagetoolcfg.hxx b/include/svtools/languagetoolcfg.hxx
index 3f30c4bd94a8..24c4de6408aa 100644
--- a/include/svtools/languagetoolcfg.hxx
+++ b/include/svtools/languagetoolcfg.hxx
@@ -39,6 +39,9 @@ public:
const OUString& getBaseURL() const;
void setBaseURL(const OUString& rVal);
+ const OUString& getRestProtocol() const;
+ void setRestProtocol(const OUString& rVal);
+
const OUString& getUsername() const;
void setUsername(const OUString& rVal);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
index 559200946080..8c3fa98e6d4b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs
@@ -412,6 +412,12 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="RestProtocol" oor:type="xs:string">
+ <info>
+ <desc>LanguageTool Grammar Checker REST API protocol</desc>
+ <label>REST API protocol</label>
+ </info>
+ </prop>
</group>
</group>
<group oor:name="Translation">
diff --git a/svtools/source/config/languagetoolcfg.cxx b/svtools/source/config/languagetoolcfg.cxx
index 3f48010141db..311cefb320f4 100644
--- a/svtools/source/config/languagetoolcfg.cxx
+++ b/svtools/source/config/languagetoolcfg.cxx
@@ -31,6 +31,7 @@ struct LanguageToolOptions_Impl
OUString sBaseURL;
OUString sUsername;
OUString sApiKey;
+ OUString sRestProtocol;
bool bEnabled;
bool bSSLCertVerificatrionEnabled;
};
@@ -43,6 +44,7 @@ const Sequence<OUString>& SvxLanguageToolOptions::GetPropertyNames()
"LanguageTool/ApiKey",
"LanguageTool/IsEnabled",
"LanguageTool/SSLCertVerify",
+ "LanguageTool/RestProtocol"
};
return aNames;
}
@@ -69,12 +71,23 @@ OUString SvxLanguageToolOptions::getCheckerURL() const { return pImpl->sBaseURL
const OUString& SvxLanguageToolOptions::getApiKey() const { return pImpl->sApiKey; }
+const OUString& SvxLanguageToolOptions::getRestProtocol() const { return pImpl->sRestProtocol; }
+
void SvxLanguageToolOptions::setApiKey(const OUString& rVal)
{
pImpl->sApiKey = rVal;
SetModified();
}
+void SvxLanguageToolOptions::setRestProtocol(const OUString& rVal)
+{
+ if (pImpl->sRestProtocol != rVal)
+ {
+ pImpl->sRestProtocol = rVal;
+ SetModified();
+ }
+}
+
bool SvxLanguageToolOptions::getEnabled() const { return pImpl->bEnabled; }
bool SvxLanguageToolOptions::getSSLVerification() const { return pImpl->bSSLCertVerificatrionEnabled; }
@@ -142,6 +155,9 @@ void SvxLanguageToolOptions::Load(const css::uno::Sequence<OUString>& aNames)
case 4:
pValues[nProp] >>= pImpl->bSSLCertVerificatrionEnabled;
break;
+ case 5:
+ pValues[nProp] >>= pImpl->sRestProtocol;
+ break;
default:
break;
}
@@ -172,9 +188,12 @@ void SvxLanguageToolOptions::ImplCommit()
case 4:
pValues[nProp] <<= pImpl->bSSLCertVerificatrionEnabled;
break;
+ case 5:
+ pValues[nProp] <<= pImpl->sRestProtocol;
+ break;
default:
break;
}
}
PutProperties(aNames, aValues);
-} \ No newline at end of file
+}