LibreOffice Module linguistic (master) 1
thesdsp.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_LINGUISTIC_SOURCE_THESDSP_HXX
21#define INCLUDED_LINGUISTIC_SOURCE_THESDSP_HXX
22
23#include <com/sun/star/uno/Reference.h>
24#include <com/sun/star/uno/Sequence.h>
25
26#include <com/sun/star/linguistic2/XLinguProperties.hpp>
27#include <com/sun/star/linguistic2/XThesaurus.hpp>
28
30#include <linguistic/misc.hxx>
31
32#include <map>
33#include <memory>
34
35#include "defs.hxx"
36
37
39 public cppu::WeakImplHelper< css::linguistic2::XThesaurus >,
40 public LinguDispatcher
41{
42 typedef std::shared_ptr< LangSvcEntries_Thes > LangSvcEntries_Thes_Ptr_t;
43 typedef std::map< LanguageType, LangSvcEntries_Thes_Ptr_t > ThesSvcByLangMap_t;
45
46 css::uno::Reference< css::linguistic2::XLinguProperties > xPropSet;
47
50
51 inline const css::uno::Reference< css::linguistic2::XLinguProperties > &
52 GetPropSet();
53
54 void ClearSvcList();
55
56public:
58 virtual ~ThesaurusDispatcher() override;
59
60 // XSupportedLocales
61 virtual css::uno::Sequence< css::lang::Locale > SAL_CALL
62 getLocales() override;
63 virtual sal_Bool SAL_CALL
64 hasLocale( const css::lang::Locale& aLocale ) override;
65
66 // XThesaurus
67 virtual css::uno::Sequence< css::uno::Reference< css::linguistic2::XMeaning > > SAL_CALL
68 queryMeanings( const OUString& aTerm,
69 const css::lang::Locale& aLocale,
70 const css::uno::Sequence< ::css::beans::PropertyValue >& aProperties ) override;
71
72 // LinguDispatcher
73 virtual void
74 SetServiceList( const css::lang::Locale &rLocale,
75 const css::uno::Sequence< OUString > &rSvcImplNames ) override;
76 virtual css::uno::Sequence< OUString >
77 GetServiceList( const css::lang::Locale &rLocale ) const override;
78};
79
80
81inline const css::uno::Reference< css::linguistic2::XLinguProperties > &
83{
84 if (!xPropSet.is())
86 return xPropSet;
87}
88
89
90#endif
91
92/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::uno::Reference< css::linguistic2::XMeaning > > SAL_CALL queryMeanings(const OUString &aTerm, const css::lang::Locale &aLocale, const css::uno::Sequence< ::css::beans::PropertyValue > &aProperties) override
Definition: thesdsp.cxx:97
virtual ~ThesaurusDispatcher() override
Definition: thesdsp.cxx:59
ThesaurusDispatcher & operator=(const ThesaurusDispatcher &)=delete
ThesaurusDispatcher(const ThesaurusDispatcher &)=delete
std::map< LanguageType, LangSvcEntries_Thes_Ptr_t > ThesSvcByLangMap_t
Definition: thesdsp.hxx:43
css::uno::Reference< css::linguistic2::XLinguProperties > xPropSet
Definition: thesdsp.hxx:46
virtual void SetServiceList(const css::lang::Locale &rLocale, const css::uno::Sequence< OUString > &rSvcImplNames) override
Definition: thesdsp.cxx:191
virtual sal_Bool SAL_CALL hasLocale(const css::lang::Locale &aLocale) override
Definition: thesdsp.cxx:88
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getLocales() override
Definition: thesdsp.cxx:73
virtual css::uno::Sequence< OUString > GetServiceList(const css::lang::Locale &rLocale) const override
Definition: thesdsp.cxx:223
const css::uno::Reference< css::linguistic2::XLinguProperties > & GetPropSet()
Definition: thesdsp.hxx:82
ThesSvcByLangMap_t aSvcMap
Definition: thesdsp.hxx:44
std::shared_ptr< LangSvcEntries_Thes > LangSvcEntries_Thes_Ptr_t
Definition: thesdsp.hxx:42
uno::Reference< XLinguProperties > GetLinguProperties()
Definition: misc.cxx:666
unsigned char sal_Bool