Line data Source code
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 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_UNODEVTOOLS_TYPEMANAGER_HXX
21 : #define INCLUDED_UNODEVTOOLS_TYPEMANAGER_HXX
22 :
23 : #include <codemaker/typemanager.hxx>
24 : #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
25 :
26 : #include <boost/unordered_map.hpp>
27 : #include <vector>
28 :
29 : class RegistryKey;
30 :
31 : namespace typereg { class Reader; }
32 :
33 : typedef boost::unordered_map
34 : <
35 : ::rtl::OString, // Typename
36 : RTTypeClass, // TypeClass
37 : HashString,
38 : EqualString
39 : > T2TypeClassMap;
40 :
41 : namespace unodevtools {
42 :
43 0 : struct UnoTypeManagerImpl
44 : {
45 0 : UnoTypeManagerImpl() {}
46 :
47 : T2TypeClassMap m_t2TypeClass;
48 : ::com::sun::star::uno::Reference<
49 : ::com::sun::star::container::XHierarchicalNameAccess> m_tdmgr;
50 : };
51 :
52 : class UnoTypeManager : public TypeManager
53 : {
54 : public:
55 : UnoTypeManager();
56 : ~UnoTypeManager();
57 :
58 : UnoTypeManager( const UnoTypeManager& value )
59 : : TypeManager(value)
60 : , m_pImpl( value.m_pImpl )
61 : {}
62 :
63 : sal_Bool init(const ::std::vector< ::rtl::OUString > registries);
64 :
65 : sal_Bool isValidType(const ::rtl::OString& name) const;
66 : ::rtl::OString getTypeName(RegistryKey& rTypeKey) const;
67 : typereg::Reader getTypeReader(
68 : const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const;
69 : typereg::Reader getTypeReader(RegistryKey& rTypeKey) const;
70 : RTTypeClass getTypeClass(const ::rtl::OString& name) const;
71 : RTTypeClass getTypeClass(RegistryKey& rTypeKey) const;
72 :
73 : protected:
74 : void release();
75 :
76 : UnoTypeManagerImpl* m_pImpl;
77 : };
78 :
79 : }
80 :
81 : #endif // _UNODEVTOOLS_TYPEMANAGER_HXX_
82 :
83 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|