1*0a1e2f0eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0a1e2f0eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0a1e2f0eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0a1e2f0eSAndrew Rist  * distributed with this work for additional information
6*0a1e2f0eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0a1e2f0eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0a1e2f0eSAndrew Rist  * "License"); you may not use this file except in compliance
9*0a1e2f0eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*0a1e2f0eSAndrew Rist  *
11*0a1e2f0eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*0a1e2f0eSAndrew Rist  *
13*0a1e2f0eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0a1e2f0eSAndrew Rist  * software distributed under the License is distributed on an
15*0a1e2f0eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0a1e2f0eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*0a1e2f0eSAndrew Rist  * specific language governing permissions and limitations
18*0a1e2f0eSAndrew Rist  * under the License.
19*0a1e2f0eSAndrew Rist  *
20*0a1e2f0eSAndrew Rist  *************************************************************/
21*0a1e2f0eSAndrew Rist 
22*0a1e2f0eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #if ! defined INCLUDED_DP_COMPBACKENDDB_HXX
25cdf0e10cSrcweir #define INCLUDED_DP_COMPBACKENDDB_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "rtl/ustring.hxx"
28cdf0e10cSrcweir #include "rtl/string.hxx"
29cdf0e10cSrcweir #include <vector>
30cdf0e10cSrcweir #include <list>
31cdf0e10cSrcweir #include "dp_backenddb.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace css = ::com::sun::star;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace com { namespace sun { namespace star {
36cdf0e10cSrcweir         namespace uno {
37cdf0e10cSrcweir         class XComponentContext;
38cdf0e10cSrcweir         }
39cdf0e10cSrcweir         namespace xml { namespace dom {
40cdf0e10cSrcweir             class XDocument;
41cdf0e10cSrcweir             class XNode;
42cdf0e10cSrcweir         }}
43cdf0e10cSrcweir         namespace xml { namespace xpath {
44cdf0e10cSrcweir             class XXPathAPI;
45cdf0e10cSrcweir         }}
46cdf0e10cSrcweir }}}
47cdf0e10cSrcweir 
48cdf0e10cSrcweir namespace dp_registry {
49cdf0e10cSrcweir namespace backend {
50cdf0e10cSrcweir namespace component {
51cdf0e10cSrcweir 
52cdf0e10cSrcweir /* The XML file stores the extensions which are currently registered.
53cdf0e10cSrcweir    They will be removed when they are revoked.
54cdf0e10cSrcweir    The format looks like this:
55cdf0e10cSrcweir 
56cdf0e10cSrcweir <?xml version="1.0"?>
57cdf0e10cSrcweir <component-backend-db xmlns="http://openoffice.org/extensionmanager/component-registry/2010">
58cdf0e10cSrcweir   <component url="vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/5CD5.tmp_/leaves1.oxt/extensionoptions.jar">
59cdf0e10cSrcweir     <name>FileName</name>
60cdf0e10cSrcweir     <java-type-library>true</java-type-library>
61cdf0e10cSrcweir     <implementation-names>
62cdf0e10cSrcweir       <name>com.sun.star.comp.extensionoptions.OptionsEventHandler$_OptionsEventHandler</name>
63cdf0e10cSrcweir       ...
64cdf0e10cSrcweir     </implementation-names>
65cdf0e10cSrcweir     <singletons>
66cdf0e10cSrcweir       <item>
67cdf0e10cSrcweir         <key>com.sun.star.java.theJavaVirtualMachine</key>
68cdf0e10cSrcweir         <value>com.sun.star.java.JavaVirtualMachine</value>
69cdf0e10cSrcweir       </item>
70cdf0e10cSrcweir       ...
71cdf0e10cSrcweir     </singletons>
72cdf0e10cSrcweir   </component>
73cdf0e10cSrcweir 
74cdf0e10cSrcweir   <component ...>
75cdf0e10cSrcweir   ...
76cdf0e10cSrcweir </component-backend-db>
77cdf0e10cSrcweir  */
78cdf0e10cSrcweir class ComponentBackendDb: public dp_registry::backend::BackendDb
79cdf0e10cSrcweir {
80cdf0e10cSrcweir protected:
81cdf0e10cSrcweir     virtual ::rtl::OUString getDbNSName();
82cdf0e10cSrcweir     virtual ::rtl::OUString getNSPrefix();
83cdf0e10cSrcweir     virtual ::rtl::OUString getRootElementName();
84cdf0e10cSrcweir     virtual ::rtl::OUString getKeyElementName();
85cdf0e10cSrcweir 
86cdf0e10cSrcweir public:
87cdf0e10cSrcweir     struct Data
88cdf0e10cSrcweir     {
Datadp_registry::backend::component::ComponentBackendDb::Data89cdf0e10cSrcweir         Data(): javaTypeLibrary(false) {};
90cdf0e10cSrcweir 
91cdf0e10cSrcweir         ::std::list< ::rtl::OUString> implementationNames;
92cdf0e10cSrcweir         /* every singleton has a key and a value
93cdf0e10cSrcweir          */
94cdf0e10cSrcweir         ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString> >singletons;
95cdf0e10cSrcweir         bool javaTypeLibrary;
96cdf0e10cSrcweir     };
97cdf0e10cSrcweir 
98cdf0e10cSrcweir public:
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     ComponentBackendDb( css::uno::Reference<css::uno::XComponentContext> const &  xContext,
101cdf0e10cSrcweir                         ::rtl::OUString const & url);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     void addEntry(::rtl::OUString const & url, Data const & data);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     Data getEntry(::rtl::OUString const & url);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 
108cdf0e10cSrcweir };
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 
112cdf0e10cSrcweir }
113cdf0e10cSrcweir }
114cdf0e10cSrcweir }
115cdf0e10cSrcweir #endif
116cdf0e10cSrcweir 
117