Branch data 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_DP_COMPBACKENDDB_HXX
21 : : #define INCLUDED_DP_COMPBACKENDDB_HXX
22 : :
23 : : #include "rtl/ustring.hxx"
24 : : #include "rtl/string.hxx"
25 : : #include <vector>
26 : : #include <list>
27 : : #include "dp_backenddb.hxx"
28 : :
29 : : namespace css = ::com::sun::star;
30 : :
31 : : namespace com { namespace sun { namespace star {
32 : : namespace uno {
33 : : class XComponentContext;
34 : : }
35 : : }}}
36 : :
37 : : namespace dp_registry {
38 : : namespace backend {
39 : : namespace component {
40 : :
41 : : /* The XML file stores the extensions which are currently registered.
42 : : They will be removed when they are revoked.
43 : : The format looks like this:
44 : :
45 : : <?xml version="1.0"?>
46 : : <component-backend-db xmlns="http://openoffice.org/extensionmanager/component-registry/2010">
47 : : <component url="vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/5CD5.tmp_/leaves1.oxt/extensionoptions.jar">
48 : : <name>FileName</name>
49 : : <java-type-library>true</java-type-library>
50 : : <implementation-names>
51 : : <name>com.sun.star.comp.extensionoptions.OptionsEventHandler$_OptionsEventHandler</name>
52 : : ...
53 : : </implementation-names>
54 : : <singletons>
55 : : <item>
56 : : <key>com.sun.star.java.theJavaVirtualMachine</key>
57 : : <value>com.sun.star.java.JavaVirtualMachine</value>
58 : : </item>
59 : : ...
60 : : </singletons>
61 : : </component>
62 : :
63 : : <component ...>
64 : : ...
65 : : </component-backend-db>
66 : : */
67 [ - + ]: 760 : class ComponentBackendDb: public dp_registry::backend::BackendDb
68 : : {
69 : : protected:
70 : : virtual ::rtl::OUString getDbNSName();
71 : : virtual ::rtl::OUString getNSPrefix();
72 : : virtual ::rtl::OUString getRootElementName();
73 : : virtual ::rtl::OUString getKeyElementName();
74 : :
75 : : public:
76 : 74 : struct Data
77 : : {
78 [ + - ]: 68 : Data(): javaTypeLibrary(false) {};
79 : :
80 : : ::std::list< ::rtl::OUString> implementationNames;
81 : : ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString> >singletons;
82 : : // map from singleton names to implementation names
83 : : bool javaTypeLibrary;
84 : : };
85 : :
86 : : public:
87 : :
88 : : ComponentBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
89 : : ::rtl::OUString const & url);
90 : :
91 : : void addEntry(::rtl::OUString const & url, Data const & data);
92 : :
93 : : Data getEntry(::rtl::OUString const & url);
94 : :
95 : :
96 : : };
97 : :
98 : :
99 : :
100 : : }
101 : : }
102 : : }
103 : : #endif
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|