LibreOffice Module linguistic (master) 1
defs.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#pragma once
21
22#include <com/sun/star/linguistic2/XSpellChecker.hpp>
23#include <com/sun/star/linguistic2/XHyphenator.hpp>
24#include <com/sun/star/linguistic2/XThesaurus.hpp>
25
26#include <memory>
27
28class SvStream;
29
30typedef std::shared_ptr< SvStream > SvStreamPtr;
31
33{
34 css::uno::Sequence< OUString > aSvcImplNames;
35
37
38 explicit LangSvcEntries( const css::uno::Sequence< OUString > &rSvcImplNames ) :
39 aSvcImplNames(rSvcImplNames),
41 {
42 }
43
44 explicit LangSvcEntries( const OUString &rSvcImplName ) :
46 {
47 aSvcImplNames = { rSvcImplName };
48 }
49
50 void Clear()
51 {
52 aSvcImplNames.realloc(0);
54 }
55};
56
58{
59 css::uno::Sequence< css::uno::Reference< css::linguistic2::XSpellChecker > > aSvcRefs;
60
61 explicit LangSvcEntries_Spell( const css::uno::Sequence< OUString > &rSvcImplNames ) : LangSvcEntries( rSvcImplNames ) {}
62};
63
65{
66 css::uno::Sequence< css::uno::Reference< css::linguistic2::XHyphenator > > aSvcRefs;
67
68 explicit LangSvcEntries_Hyph( const OUString &rSvcImplName ) : LangSvcEntries( rSvcImplName ) {}
69};
70
72{
73 css::uno::Sequence< css::uno::Reference< css::linguistic2::XThesaurus > > aSvcRefs;
74
75 explicit LangSvcEntries_Thes( const css::uno::Sequence< OUString > &rSvcImplNames ) : LangSvcEntries( rSvcImplNames ) {}
76};
77
78
79// virtual base class for the different dispatchers
81{
82public:
83 virtual void SetServiceList( const css::lang::Locale &rLocale, const css::uno::Sequence< OUString > &rSvcImplNames ) = 0;
84 virtual css::uno::Sequence< OUString > GetServiceList( const css::lang::Locale &rLocale ) const = 0;
85
86protected:
88};
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SetServiceList(const css::lang::Locale &rLocale, const css::uno::Sequence< OUString > &rSvcImplNames)=0
virtual css::uno::Sequence< OUString > GetServiceList(const css::lang::Locale &rLocale) const =0
~LinguDispatcher()
Definition: defs.hxx:87
std::shared_ptr< SvStream > SvStreamPtr
Definition: defs.hxx:28
LangSvcEntries_Hyph(const OUString &rSvcImplName)
Definition: defs.hxx:68
css::uno::Sequence< css::uno::Reference< css::linguistic2::XHyphenator > > aSvcRefs
Definition: defs.hxx:66
LangSvcEntries_Spell(const css::uno::Sequence< OUString > &rSvcImplNames)
Definition: defs.hxx:61
css::uno::Sequence< css::uno::Reference< css::linguistic2::XSpellChecker > > aSvcRefs
Definition: defs.hxx:59
LangSvcEntries_Thes(const css::uno::Sequence< OUString > &rSvcImplNames)
Definition: defs.hxx:75
css::uno::Sequence< css::uno::Reference< css::linguistic2::XThesaurus > > aSvcRefs
Definition: defs.hxx:73
LangSvcEntries(const css::uno::Sequence< OUString > &rSvcImplNames)
Definition: defs.hxx:38
css::uno::Sequence< OUString > aSvcImplNames
Definition: defs.hxx:34
void Clear()
Definition: defs.hxx:50
sal_Int16 nLastTriedSvcIndex
Definition: defs.hxx:36
LangSvcEntries(const OUString &rSvcImplName)
Definition: defs.hxx:44