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/basemutex.hxx>
29 #include <cppuhelper/compbase.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::WeakComponentImplHelper
<
48 css::lang::XServiceInfo
, css::container::XHierarchicalNameAccess
,
49 css::container::XSet
, css::reflection::XTypeDescriptionEnumerationAccess
>
52 class TypeManager
: private cppu::BaseMutex
, 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 () override
;
69 virtual void SAL_CALL
disposing() override
;
71 virtual rtl::OUString SAL_CALL
getImplementationName() override
;
73 virtual sal_Bool SAL_CALL
supportsService(rtl::OUString
const & ServiceName
) override
;
75 virtual css::uno::Sequence
< rtl::OUString
> SAL_CALL
76 getSupportedServiceNames() override
;
78 virtual css::uno::Any SAL_CALL
getByHierarchicalName(
79 rtl::OUString
const & aName
) override
;
81 virtual sal_Bool SAL_CALL
hasByHierarchicalName(rtl::OUString
const & aName
) override
;
83 virtual css::uno::Type SAL_CALL
getElementType() override
;
85 virtual sal_Bool SAL_CALL
hasElements() override
;
87 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
88 createEnumeration() override
;
90 virtual sal_Bool SAL_CALL
has(css::uno::Any
const & aElement
) override
;
92 virtual void SAL_CALL
insert(css::uno::Any
const & aElement
) override
;
94 virtual void SAL_CALL
remove(css::uno::Any
const & aElement
) override
;
96 virtual css::uno::Reference
< css::reflection::XTypeDescriptionEnumeration
>
97 SAL_CALL
createTypeDescriptionEnumeration(
98 rtl::OUString
const & moduleName
,
99 css::uno::Sequence
< css::uno::TypeClass
> const & types
,
100 css::reflection::TypeDescriptionSearchDepth depth
) override
;
102 void readRdbDirectory(rtl::OUString
const & uri
, bool optional
);
104 void readRdbFile(rtl::OUString
const & uri
, bool optional
);
106 css::uno::Any
getSequenceType(rtl::OUString
const & name
);
108 css::uno::Any
getInstantiatedStruct(
109 rtl::OUString
const & name
, sal_Int32 separator
);
111 css::uno::Any
getInterfaceMember(
112 rtl::OUString
const & name
, sal_Int32 separator
);
114 css::uno::Any
getNamed(
115 rtl::OUString
const & name
,
116 rtl::Reference
< unoidl::Entity
> const & entity
);
118 static css::uno::Any
getEnumMember(
119 rtl::Reference
< unoidl::EnumTypeEntity
> const & entity
,
120 rtl::OUString
const & member
);
122 static css::uno::Any
getConstant(
123 rtl::OUString
const & constantGroupName
,
124 rtl::Reference
< unoidl::ConstantGroupEntity
> const & entity
,
125 rtl::OUString
const & member
);
127 rtl::Reference
< unoidl::Entity
> findEntity(rtl::OUString
const & name
);
129 rtl::Reference
< unoidl::Manager
> manager_
;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */