LibreOffice Module cppuhelper (master)  1
typemanager.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 
10 #pragma once
11 
12 #include <sal/config.h>
13 
14 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
15 #include <com/sun/star/container/XSet.hpp>
16 #include <com/sun/star/lang/XServiceInfo.hpp>
17 #include <com/sun/star/reflection/TypeDescriptionSearchDepth.hpp>
18 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
19 #include <com/sun/star/uno/Reference.hxx>
20 #include <com/sun/star/uno/Sequence.hxx>
21 #include <cppuhelper/basemutex.hxx>
22 #include <cppuhelper/compbase.hxx>
23 #include <rtl/ref.hxx>
24 #include <sal/types.h>
25 
26 namespace com::sun::star {
27  namespace reflection { class XTypeDescription; }
28 }
29 namespace unoidl {
30  class ConstantGroupEntity;
31  class Entity;
32  class EnumTypeEntity;
33  class Manager;
34 }
35 
36 namespace cppuhelper {
37 
38 typedef cppu::WeakComponentImplHelper<
39  css::lang::XServiceInfo, css::container::XHierarchicalNameAccess,
40  css::container::XSet, css::reflection::XTypeDescriptionEnumerationAccess >
42 
44 public:
45  TypeManager();
46 
47  using TypeManager_Base::acquire;
48  using TypeManager_Base::release;
49 
50  void init(OUString const & rdbUris);
51 
52  css::uno::Any find(OUString const & name);
53 
54  css::uno::Reference< css::reflection::XTypeDescription > resolve(
55  OUString const & name);
56 
57 private:
58  virtual ~TypeManager() noexcept override;
59 
60  virtual void SAL_CALL disposing() override;
61 
62  virtual OUString SAL_CALL getImplementationName() override;
63 
64  virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
65 
66  virtual css::uno::Sequence< OUString > SAL_CALL
67  getSupportedServiceNames() override;
68 
69  virtual css::uno::Any SAL_CALL getByHierarchicalName(
70  OUString const & aName) override;
71 
72  virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) override;
73 
74  virtual css::uno::Type SAL_CALL getElementType() override;
75 
76  virtual sal_Bool SAL_CALL hasElements() override;
77 
78  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
79  createEnumeration() override;
80 
81  virtual sal_Bool SAL_CALL has(css::uno::Any const & aElement) override;
82 
83  virtual void SAL_CALL insert(css::uno::Any const & aElement) override;
84 
85  virtual void SAL_CALL remove(css::uno::Any const & aElement) override;
86 
87  virtual css::uno::Reference< css::reflection::XTypeDescriptionEnumeration >
89  OUString const & moduleName,
90  css::uno::Sequence< css::uno::TypeClass > const & types,
91  css::reflection::TypeDescriptionSearchDepth depth) override;
92 
93  void readRdbDirectory(OUString const & uri, bool optional);
94 
95  void readRdbFile(OUString const & uri, bool optional);
96 
97  css::uno::Any getSequenceType(OUString const & name);
98 
99  css::uno::Any getInstantiatedStruct(
100  OUString const & name, sal_Int32 separator);
101 
102  css::uno::Any getInterfaceMember(
103  OUString const & name, sal_Int32 separator);
104 
105  css::uno::Any getNamed(
106  OUString const & name,
107  rtl::Reference< unoidl::Entity > const & entity);
108 
109  static css::uno::Any getEnumMember(
111  OUString const & member);
112 
113  static css::uno::Any getConstant(
114  OUString const & constantGroupName,
116  OUString const & member);
117 
118  rtl::Reference< unoidl::Entity > findEntity(OUString const & name);
119 
121 };
122 
123 }
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const &aName) override
rtl::Reference< unoidl::Manager > manager_
virtual ~TypeManager() noexcept override
virtual sal_Bool SAL_CALL hasElements() override
css::uno::Any find(OUString const &name)
rtl::Reference< unoidl::Entity > findEntity(OUString const &name)
static css::uno::Any getEnumMember(rtl::Reference< unoidl::EnumTypeEntity > const &entity, OUString const &member)
css::uno::Any getInstantiatedStruct(OUString const &name, sal_Int32 separator)
css::uno::Any getInterfaceMember(OUString const &name, sal_Int32 separator)
virtual sal_Bool SAL_CALL has(css::uno::Any const &aElement) override
virtual void SAL_CALL disposing() override
css::uno::Any getNamed(OUString const &name, rtl::Reference< unoidl::Entity > const &entity)
void readRdbDirectory(OUString const &uri, bool optional)
virtual sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
base class for all classes who want derive from cppu::WeakComponentImplHelperXX.
Definition: basemutex.hxx:39
unsigned char sal_Bool
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual void SAL_CALL insert(css::uno::Any const &aElement) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getByHierarchicalName(OUString const &aName) override
exports com.sun.star. reflection
void readRdbFile(OUString const &uri, bool optional)
css::uno::Any getSequenceType(OUString const &name)
OUString aName
const char * name
void init(OUString const &rdbUris)
cppu::WeakComponentImplHelper< css::lang::XServiceInfo, css::container::XHierarchicalNameAccess, css::container::XSet, css::reflection::XTypeDescriptionEnumerationAccess > TypeManager_Base
Definition: typemanager.hxx:41
virtual css::uno::Reference< css::reflection::XTypeDescriptionEnumeration > SAL_CALL createTypeDescriptionEnumeration(OUString const &moduleName, css::uno::Sequence< css::uno::TypeClass > const &types, css::reflection::TypeDescriptionSearchDepth depth) override
css::uno::Reference< css::reflection::XTypeDescription > resolve(OUString const &name)
static css::uno::Any getConstant(OUString const &constantGroupName, rtl::Reference< unoidl::ConstantGroupEntity > const &entity, OUString const &member)
exports com.sun.star. uri