LibreOffice Module unotools (master) 1
lingucfg.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_UNOTOOLS_LINGUCFG_HXX
21#define INCLUDED_UNOTOOLS_LINGUCFG_HXX
22
24#include <com/sun/star/uno/Sequence.hxx>
25#include <com/sun/star/uno/Any.h>
26#include <rtl/ustring.hxx>
27#include <unotools/options.hxx>
28#include <i18nlangtag/lang.h>
29#include <vector>
30
31namespace com::sun::star::beans { struct PropertyValue; }
32namespace com::sun::star::util { class XChangesBatch; }
33
35
37{
38 css::uno::Sequence< OUString > aActiveDics;
39 css::uno::Sequence< OUString > aActiveConvDics;
40
43
44 // Hyphenator service specific options
45 sal_Int16 nHyphMinLeading,
48
52
53 // misc options (non-service specific)
57
61
62 // spelling options (non-service specific)
66
70
71 // hyphenation options (non-service specific)
74
77
78 // common to SpellChecker, Hyphenator and Thesaurus service
81
84
85 // SpellChecker service specific options
91
97
98 // text conversion specific options
107
116
117 // check value need to determine if the configuration needs to be updated
118 // or not (used for a quick check if data files have been changed/added
119 // or deleted
122
125
128
130};
131
133{
134 // the URL's pointing to the location of the files the dictionary consists of
135 css::uno::Sequence< OUString > aLocations;
136 // the name of the dictionary format implement
137 OUString aFormatName;
138 // the list of languages (ISO names) the dictionary can be used for
139 css::uno::Sequence< OUString > aLocaleNames;
140};
141
143{
144 // returns static object
145 UNOTOOLS_DLLPRIVATE static SvtLinguConfigItem & GetConfigItem();
146
147 // configuration update access for the 'Linguistic' main node
148 mutable css::uno::Reference< css::util::XChangesBatch > m_xMainUpdateAccess;
149
150 css::uno::Reference< css::util::XChangesBatch > const & GetMainUpdateAccess() const;
151
152 OUString GetVendorImageUrl_Impl( const OUString &rServiceImplName, const OUString &rImageName ) const;
153
154 SvtLinguConfig( const SvtLinguConfig & ) = delete;
155 SvtLinguConfig & operator = ( const SvtLinguConfig & ) = delete;
156
157public:
159 virtual ~SvtLinguConfig() override;
160
161 // borrowed from utl::ConfigItem
162
163 css::uno::Sequence< OUString >
164 GetNodeNames( const OUString &rNode ) const;
165
166 css::uno::Sequence< css::uno::Any >
167 GetProperties(
168 const css::uno::Sequence< OUString > &rNames ) const;
169
170 bool
171 ReplaceSetProperties(
172 const OUString &rNode,
173 const css::uno::Sequence< css::beans::PropertyValue >& rValues );
174
175 css::uno::Any
176 GetProperty( std::u16string_view rPropertyName ) const;
177 css::uno::Any
178 GetProperty( sal_Int32 nPropertyHandle ) const;
179
180 bool SetProperty( std::u16string_view rPropertyName,
181 const css::uno::Any &rValue );
182 bool SetProperty( sal_Int32 nPropertyHandle,
183 const css::uno::Any &rValue );
184
185 void GetOptions( SvtLinguOptions &rOptions ) const;
186
187 bool IsReadOnly( std::u16string_view rPropertyName ) const;
188
193 bool GetElementNamesFor( const OUString &rNodeName, css::uno::Sequence< OUString > &rElementNames ) const;
194
195 bool GetSupportedDictionaryFormatsFor( const OUString &rSetName, const OUString &rSetEntry, css::uno::Sequence< OUString > &rFormatList ) const;
196
197 bool GetDictionaryEntry( const OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
198
199 css::uno::Sequence< OUString > GetDisabledDictionaries() const;
200
201 std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( std::u16string_view rFormatName ) const;
202
203 // functions returning file URLs to the respective images (if found) and empty string otherwise
204 OUString GetSpellAndGrammarContextSuggestionImage( const OUString &rServiceImplName ) const;
205 OUString GetSpellAndGrammarContextDictionaryImage( const OUString &rServiceImplName ) const;
206 OUString GetSynonymsContextImage( const OUString &rServiceImplName ) const;
207
208 bool HasGrammarChecker() const;
209};
210
211#endif
212
213/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool SetProperty(sal_Int32 nPropertyHandle, const css::uno::Any &rValue)
SvtLinguConfig(const SvtLinguConfig &)=delete
css::uno::Reference< css::util::XChangesBatch > m_xMainUpdateAccess
Definition: lingucfg.hxx:148
bool SetProperty(std::u16string_view rPropertyName, const css::uno::Any &rValue)
bool IsReadOnly(EOption eOption)
UNOTOOLS_DLLPUBLIC css::uno::Any GetProperty(OUString const &url, OUString const &property)
Definition: ucbhelper.cxx:145
css::uno::Sequence< OUString > aLocaleNames
Definition: lingucfg.hxx:139
css::uno::Sequence< OUString > aLocations
Definition: lingucfg.hxx:135
bool bROIsGrammarAuto
Definition: lingucfg.hxx:126
LanguageType nDefaultLanguage
Definition: lingucfg.hxx:54
bool bROIsAutoCloseDialog
Definition: lingucfg.hxx:109
LanguageType nDefaultLanguage_CTL
Definition: lingucfg.hxx:56
bool bIsUseCharacterVariants
Definition: lingucfg.hxx:104
LanguageType nDefaultLanguage_CJK
Definition: lingucfg.hxx:55
bool bROIsDirectionToSimplified
Definition: lingucfg.hxx:112
bool bROIsHyphAuto
Definition: lingucfg.hxx:76
bool bROIsHyphSpecial
Definition: lingucfg.hxx:75
bool bROActiveDics
Definition: lingucfg.hxx:41
bool bROIsUseCharacterVariants
Definition: lingucfg.hxx:113
bool bROIsTranslateCommonTerms
Definition: lingucfg.hxx:114
bool bIsSpellCapitalization
Definition: lingucfg.hxx:88
bool bRODefaultLanguage
Definition: lingucfg.hxx:58
bool bROHyphMinTrailing
Definition: lingucfg.hxx:50
sal_Int16 nHyphMinTrailing
Definition: lingucfg.hxx:46
bool bROHyphMinLeading
Definition: lingucfg.hxx:49
bool bROHyphMinWordLength
Definition: lingucfg.hxx:51
bool bROIsIgnoreControlCharacters
Definition: lingucfg.hxx:83
bool bROIsSpellReverse
Definition: lingucfg.hxx:69
bool bIsSpellReverse
Definition: lingucfg.hxx:65
bool bROIsSpellClosedCompound
Definition: lingucfg.hxx:95
bool bIsReverseMapping
Definition: lingucfg.hxx:106
bool bROIsAutoReplaceUniqueEntries
Definition: lingucfg.hxx:111
css::uno::Sequence< OUString > aActiveDics
Definition: lingucfg.hxx:38
bool bIsHyphSpecial
Definition: lingucfg.hxx:72
bool bROIsSpellHyphenatedCompound
Definition: lingucfg.hxx:96
bool bIsTranslateCommonTerms
Definition: lingucfg.hxx:105
sal_Int16 nHyphMinLeading
Definition: lingucfg.hxx:45
bool bIsSpellClosedCompound
Definition: lingucfg.hxx:89
bool bROIsUseDictionaryList
Definition: lingucfg.hxx:82
bool bIsSpellSpecial
Definition: lingucfg.hxx:63
bool bROIsSpellSpecial
Definition: lingucfg.hxx:67
bool bROIsSpellUpperCase
Definition: lingucfg.hxx:93
bool bIsSpellUpperCase
Definition: lingucfg.hxx:87
bool bIsAutoReplaceUniqueEntries
Definition: lingucfg.hxx:102
bool bROIsSpellAuto
Definition: lingucfg.hxx:68
bool bROActiveConvDics
Definition: lingucfg.hxx:42
sal_Int32 nDataFilesChangedCheckValue
Definition: lingucfg.hxx:120
bool bIsGrammarInteractive
Definition: lingucfg.hxx:124
bool bIsShowEntriesRecentlyUsedFirst
Definition: lingucfg.hxx:101
bool bIsDirectionToSimplified
Definition: lingucfg.hxx:103
bool bRODataFilesChangedCheckValue
Definition: lingucfg.hxx:121
bool bIsIgnoreControlCharacters
Definition: lingucfg.hxx:80
bool bRODefaultLanguage_CJK
Definition: lingucfg.hxx:59
bool bIsSpellWithDigits
Definition: lingucfg.hxx:86
bool bIsSpellHyphenatedCompound
Definition: lingucfg.hxx:90
bool bROIsIgnorePostPositionalWord
Definition: lingucfg.hxx:108
bool bROIsSpellWithDigits
Definition: lingucfg.hxx:92
bool bIsIgnorePostPositionalWord
Definition: lingucfg.hxx:99
bool bRODefaultLanguage_CTL
Definition: lingucfg.hxx:60
bool bROIsSpellCapitalization
Definition: lingucfg.hxx:94
sal_Int16 nHyphMinWordLength
Definition: lingucfg.hxx:47
bool bIsAutoCloseDialog
Definition: lingucfg.hxx:100
bool bROIsGrammarInteractive
Definition: lingucfg.hxx:127
css::uno::Sequence< OUString > aActiveConvDics
Definition: lingucfg.hxx:39
bool bROIsReverseMapping
Definition: lingucfg.hxx:115
bool bIsUseDictionaryList
Definition: lingucfg.hxx:79
bool bROIsShowEntriesRecentlyUsedFirst
Definition: lingucfg.hxx:110
#define UNOTOOLS_DLLPRIVATE
#define UNOTOOLS_DLLPUBLIC