1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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/compbase4.hxx"
29 #include "osl/mutex.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
; }
37 namespace rtl
{ class OUString
; }
39 class ConstantGroupEntity
;
45 namespace cppuhelper
{
47 typedef cppu::WeakComponentImplHelper4
<
48 css::lang::XServiceInfo
, css::container::XHierarchicalNameAccess
,
49 css::container::XSet
, css::reflection::XTypeDescriptionEnumerationAccess
>
52 class TypeManager
: private osl::Mutex
, public TypeManager_Base
{
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
);
67 virtual ~TypeManager() throw ();
69 virtual void SAL_CALL
disposing();
71 virtual rtl::OUString SAL_CALL
getImplementationName()
72 throw (css::uno::RuntimeException
);
74 virtual sal_Bool SAL_CALL
supportsService(rtl::OUString
const & ServiceName
)
75 throw (css::uno::RuntimeException
);
77 virtual css::uno::Sequence
< rtl::OUString
> SAL_CALL
78 getSupportedServiceNames() throw (css::uno::RuntimeException
);
80 virtual css::uno::Any SAL_CALL
getByHierarchicalName(
81 rtl::OUString
const & aName
)
83 css::container::NoSuchElementException
, css::uno::RuntimeException
);
85 virtual sal_Bool SAL_CALL
hasByHierarchicalName(rtl::OUString
const & aName
)
86 throw (css::uno::RuntimeException
);
88 virtual css::uno::Type SAL_CALL
getElementType()
89 throw (css::uno::RuntimeException
);
91 virtual sal_Bool SAL_CALL
hasElements() throw (css::uno::RuntimeException
);
93 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
94 createEnumeration() throw (css::uno::RuntimeException
);
96 virtual sal_Bool SAL_CALL
has(css::uno::Any
const & aElement
)
97 throw (css::uno::RuntimeException
);
99 virtual void SAL_CALL
insert(css::uno::Any
const & aElement
)
101 css::lang::IllegalArgumentException
,
102 css::container::ElementExistException
, css::uno::RuntimeException
);
104 virtual void SAL_CALL
remove(css::uno::Any
const & aElement
)
106 css::lang::IllegalArgumentException
,
107 css::container::NoSuchElementException
, css::uno::RuntimeException
);
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
)
115 css::reflection::NoSuchTypeNameException
,
116 css::reflection::InvalidTypeNameException
,
117 css::uno::RuntimeException
);
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
, rtl::Reference
< unoidl::Entity
> entity
);
136 css::uno::Any
getEnumMember(
137 rtl::Reference
< unoidl::EnumTypeEntity
> entity
,
138 rtl::OUString
const & member
);
140 css::uno::Any
getConstant(
141 rtl::OUString
const & constantGroupName
,
142 rtl::Reference
< unoidl::ConstantGroupEntity
> entity
,
143 rtl::OUString
const & member
);
145 rtl::Reference
< unoidl::Entity
> findEntity(rtl::OUString
const & name
);
147 rtl::Reference
< unoidl::Manager
> manager_
;
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */