lok: intercept the UNO command ".uno:ThesaurusDialog"
[LibreOffice.git] / cppuhelper / source / typemanager.hxx
blob1547a5c0c21df211f9e80cb720bbe9448149494a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #ifndef INCLUDED_CPPUHELPER_SOURCE_TYPEMANAGER_HXX
11 #define INCLUDED_CPPUHELPER_SOURCE_TYPEMANAGER_HXX
13 #include <sal/config.h>
15 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
16 #include <com/sun/star/container/XSet.hpp>
17 #include <com/sun/star/lang/XServiceInfo.hpp>
18 #include <com/sun/star/reflection/TypeDescriptionSearchDepth.hpp>
19 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
20 #include <com/sun/star/uno/Reference.hxx>
21 #include <com/sun/star/uno/Sequence.hxx>
22 #include <cppuhelper/basemutex.hxx>
23 #include <cppuhelper/compbase.hxx>
24 #include <rtl/ref.hxx>
25 #include <sal/types.h>
27 namespace com { namespace sun { namespace star {
28 namespace reflection { class XTypeDescription; }
29 } } }
30 namespace unoidl {
31 class ConstantGroupEntity;
32 class Entity;
33 class EnumTypeEntity;
34 class Manager;
37 namespace cppuhelper {
39 typedef cppu::WeakComponentImplHelper<
40 css::lang::XServiceInfo, css::container::XHierarchicalNameAccess,
41 css::container::XSet, css::reflection::XTypeDescriptionEnumerationAccess >
42 TypeManager_Base;
44 class TypeManager: private cppu::BaseMutex, public TypeManager_Base {
45 public:
46 TypeManager();
48 using TypeManager_Base::acquire;
49 using TypeManager_Base::release;
51 void init(OUString const & rdbUris);
53 css::uno::Any find(OUString const & name);
55 css::uno::Reference< css::reflection::XTypeDescription > resolve(
56 OUString const & name);
58 private:
59 virtual ~TypeManager() throw () override;
61 virtual void SAL_CALL disposing() override;
63 virtual OUString SAL_CALL getImplementationName() override;
65 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
67 virtual css::uno::Sequence< OUString > SAL_CALL
68 getSupportedServiceNames() override;
70 virtual css::uno::Any SAL_CALL getByHierarchicalName(
71 OUString const & aName) override;
73 virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) override;
75 virtual css::uno::Type SAL_CALL getElementType() override;
77 virtual sal_Bool SAL_CALL hasElements() override;
79 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
80 createEnumeration() override;
82 virtual sal_Bool SAL_CALL has(css::uno::Any const & aElement) override;
84 virtual void SAL_CALL insert(css::uno::Any const & aElement) override;
86 virtual void SAL_CALL remove(css::uno::Any const & aElement) override;
88 virtual css::uno::Reference< css::reflection::XTypeDescriptionEnumeration >
89 SAL_CALL createTypeDescriptionEnumeration(
90 OUString const & moduleName,
91 css::uno::Sequence< css::uno::TypeClass > const & types,
92 css::reflection::TypeDescriptionSearchDepth depth) override;
94 void readRdbDirectory(OUString const & uri, bool optional);
96 void readRdbFile(OUString const & uri, bool optional);
98 css::uno::Any getSequenceType(OUString const & name);
100 css::uno::Any getInstantiatedStruct(
101 OUString const & name, sal_Int32 separator);
103 css::uno::Any getInterfaceMember(
104 OUString const & name, sal_Int32 separator);
106 css::uno::Any getNamed(
107 OUString const & name,
108 rtl::Reference< unoidl::Entity > const & entity);
110 static css::uno::Any getEnumMember(
111 rtl::Reference< unoidl::EnumTypeEntity > const & entity,
112 OUString const & member);
114 static css::uno::Any getConstant(
115 OUString const & constantGroupName,
116 rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
117 OUString const & member);
119 rtl::Reference< unoidl::Entity > findEntity(OUString const & name);
121 rtl::Reference< unoidl::Manager > manager_;
126 #endif
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */