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/.
12 #include <sal/config.h>
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>
26 namespace com::sun::star
{
27 namespace reflection
{ class XTypeDescription
; }
30 class ConstantGroupEntity
;
36 namespace cppuhelper
{
38 typedef cppu::WeakComponentImplHelper
<
39 css::lang::XServiceInfo
, css::container::XHierarchicalNameAccess
,
40 css::container::XSet
, css::reflection::XTypeDescriptionEnumerationAccess
>
43 class TypeManager
: private cppu::BaseMutex
, public TypeManager_Base
{
47 using TypeManager_Base::acquire
;
48 using TypeManager_Base::release
;
50 void init(OUString
const & rdbUris
);
52 css::uno::Any
find(OUString
const & name
);
54 css::uno::Reference
< css::reflection::XTypeDescription
> resolve(
55 OUString
const & name
);
58 virtual ~TypeManager() throw () override
;
60 virtual void SAL_CALL
disposing() override
;
62 virtual OUString SAL_CALL
getImplementationName() override
;
64 virtual sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
66 virtual css::uno::Sequence
< OUString
> SAL_CALL
67 getSupportedServiceNames() override
;
69 virtual css::uno::Any SAL_CALL
getByHierarchicalName(
70 OUString
const & aName
) override
;
72 virtual sal_Bool SAL_CALL
hasByHierarchicalName(OUString
const & aName
) override
;
74 virtual css::uno::Type SAL_CALL
getElementType() override
;
76 virtual sal_Bool SAL_CALL
hasElements() override
;
78 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
79 createEnumeration() override
;
81 virtual sal_Bool SAL_CALL
has(css::uno::Any
const & aElement
) override
;
83 virtual void SAL_CALL
insert(css::uno::Any
const & aElement
) override
;
85 virtual void SAL_CALL
remove(css::uno::Any
const & aElement
) override
;
87 virtual css::uno::Reference
< css::reflection::XTypeDescriptionEnumeration
>
88 SAL_CALL
createTypeDescriptionEnumeration(
89 OUString
const & moduleName
,
90 css::uno::Sequence
< css::uno::TypeClass
> const & types
,
91 css::reflection::TypeDescriptionSearchDepth depth
) override
;
93 void readRdbDirectory(OUString
const & uri
, bool optional
);
95 void readRdbFile(OUString
const & uri
, bool optional
);
97 css::uno::Any
getSequenceType(OUString
const & name
);
99 css::uno::Any
getInstantiatedStruct(
100 OUString
const & name
, sal_Int32 separator
);
102 css::uno::Any
getInterfaceMember(
103 OUString
const & name
, sal_Int32 separator
);
105 css::uno::Any
getNamed(
106 OUString
const & name
,
107 rtl::Reference
< unoidl::Entity
> const & entity
);
109 static css::uno::Any
getEnumMember(
110 rtl::Reference
< unoidl::EnumTypeEntity
> const & entity
,
111 OUString
const & member
);
113 static css::uno::Any
getConstant(
114 OUString
const & constantGroupName
,
115 rtl::Reference
< unoidl::ConstantGroupEntity
> const & entity
,
116 OUString
const & member
);
118 rtl::Reference
< unoidl::Entity
> findEntity(OUString
const & name
);
120 rtl::Reference
< unoidl::Manager
> manager_
;
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */