Bump version to 4.3-4
[LibreOffice.git] / cppuhelper / source / typemanager.hxx
blobf4546e8a19f8827a9eb815fd3d9bdd035723cbe7
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/ElementExistException.hpp"
16 #include "com/sun/star/container/NoSuchElementException.hpp"
17 #include "com/sun/star/container/XHierarchicalNameAccess.hpp"
18 #include "com/sun/star/container/XSet.hpp"
19 #include "com/sun/star/lang/IllegalArgumentException.hpp"
20 #include "com/sun/star/lang/XServiceInfo.hpp"
21 #include "com/sun/star/reflection/InvalidTypeNameException.hpp"
22 #include "com/sun/star/reflection/NoSuchTypeNameException.hpp"
23 #include "com/sun/star/reflection/TypeDescriptionSearchDepth.hpp"
24 #include "com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp"
25 #include "com/sun/star/uno/Reference.hxx"
26 #include "com/sun/star/uno/RuntimeException.hpp"
27 #include "com/sun/star/uno/Sequence.hxx"
28 #include "cppuhelper/basemutex.hxx"
29 #include "cppuhelper/compbase4.hxx"
30 #include "rtl/ref.hxx"
31 #include "sal/types.h"
33 namespace com { namespace sun { namespace star {
34 namespace uno { class Any; }
35 namespace reflection { class XTypeDescription; }
36 } } }
37 namespace rtl { class OUString; }
38 namespace unoidl {
39 class ConstantGroupEntity;
40 class Entity;
41 class EnumTypeEntity;
42 class Manager;
45 namespace cppuhelper {
47 typedef cppu::WeakComponentImplHelper4<
48 css::lang::XServiceInfo, css::container::XHierarchicalNameAccess,
49 css::container::XSet, css::reflection::XTypeDescriptionEnumerationAccess >
50 TypeManager_Base;
52 class TypeManager: private cppu::BaseMutex, public TypeManager_Base {
53 public:
54 TypeManager();
56 using TypeManager_Base::acquire;
57 using TypeManager_Base::release;
59 void init(rtl::OUString const & rdbUris);
61 css::uno::Any find(rtl::OUString const & name);
63 css::uno::Reference< css::reflection::XTypeDescription > resolve(
64 rtl::OUString const & name);
66 private:
67 virtual ~TypeManager() throw ();
69 virtual void SAL_CALL disposing() SAL_OVERRIDE;
71 virtual rtl::OUString SAL_CALL getImplementationName()
72 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
75 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 virtual css::uno::Sequence< rtl::OUString > SAL_CALL
78 getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 virtual css::uno::Any SAL_CALL getByHierarchicalName(
81 rtl::OUString const & aName)
82 throw (
83 css::container::NoSuchElementException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 virtual sal_Bool SAL_CALL hasByHierarchicalName(rtl::OUString const & aName)
86 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 virtual css::uno::Type SAL_CALL getElementType()
89 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
93 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
94 createEnumeration() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 virtual sal_Bool SAL_CALL has(css::uno::Any const & aElement)
97 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 virtual void SAL_CALL insert(css::uno::Any const & aElement)
100 throw (
101 css::lang::IllegalArgumentException,
102 css::container::ElementExistException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 virtual void SAL_CALL remove(css::uno::Any const & aElement)
105 throw (
106 css::lang::IllegalArgumentException,
107 css::container::NoSuchElementException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 virtual css::uno::Reference< css::reflection::XTypeDescriptionEnumeration >
110 SAL_CALL createTypeDescriptionEnumeration(
111 rtl::OUString const & moduleName,
112 css::uno::Sequence< css::uno::TypeClass > const & types,
113 css::reflection::TypeDescriptionSearchDepth depth)
114 throw (
115 css::reflection::NoSuchTypeNameException,
116 css::reflection::InvalidTypeNameException,
117 css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 void readRdbs(rtl::OUString const & uris);
121 void readRdbDirectory(rtl::OUString const & uri, bool optional);
123 void readRdbFile(rtl::OUString const & uri, bool optional);
125 css::uno::Any getSequenceType(rtl::OUString const & name);
127 css::uno::Any getInstantiatedStruct(
128 rtl::OUString const & name, sal_Int32 separator);
130 css::uno::Any getInterfaceMember(
131 rtl::OUString const & name, sal_Int32 separator);
133 css::uno::Any getNamed(
134 rtl::OUString const & name,
135 rtl::Reference< unoidl::Entity > const & entity);
137 css::uno::Any getEnumMember(
138 rtl::Reference< unoidl::EnumTypeEntity > const & entity,
139 rtl::OUString const & member);
141 css::uno::Any getConstant(
142 rtl::OUString const & constantGroupName,
143 rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
144 rtl::OUString const & member);
146 rtl::Reference< unoidl::Entity > findEntity(rtl::OUString const & name);
148 rtl::Reference< unoidl::Manager > manager_;
153 #endif
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */