xref: /aoo42x/main/jvmfwk/source/elements.hxx (revision fb0b81f5)
15ac42e1fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
35ac42e1fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
45ac42e1fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
55ac42e1fSAndrew Rist  * distributed with this work for additional information
65ac42e1fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
75ac42e1fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
85ac42e1fSAndrew Rist  * "License"); you may not use this file except in compliance
95ac42e1fSAndrew Rist  * with the License.  You may obtain a copy of the License at
105ac42e1fSAndrew Rist  *
115ac42e1fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
125ac42e1fSAndrew Rist  *
135ac42e1fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
145ac42e1fSAndrew Rist  * software distributed under the License is distributed on an
155ac42e1fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165ac42e1fSAndrew Rist  * KIND, either express or implied.  See the License for the
175ac42e1fSAndrew Rist  * specific language governing permissions and limitations
185ac42e1fSAndrew Rist  * under the License.
195ac42e1fSAndrew Rist  *
205ac42e1fSAndrew Rist  *************************************************************/
215ac42e1fSAndrew Rist 
225ac42e1fSAndrew Rist 
23cdf0e10cSrcweir #if !defined INCLUDED_JVMFWK_ELEMENTS_HXX
24cdf0e10cSrcweir #define INCLUDED_JVMFWK_ELEMENTS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vector>
27cdf0e10cSrcweir #include "jvmfwk/framework.h"
28cdf0e10cSrcweir #include "fwkutil.hxx"
29cdf0e10cSrcweir #include "rtl/ustring.hxx"
30cdf0e10cSrcweir #include "rtl/byteseq.hxx"
31cdf0e10cSrcweir #include "libxml/parser.h"
32cdf0e10cSrcweir #include "boost/optional.hpp"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #define NS_JAVA_FRAMEWORK "http://openoffice.org/2004/java/framework/1.0"
35cdf0e10cSrcweir #define NS_SCHEMA_INSTANCE "http://www.w3.org/2001/XMLSchema-instance"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace jfw
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 
40cdf0e10cSrcweir /** gets the value of the updated element from the javavendors.xml.
41cdf0e10cSrcweir  */
42cdf0e10cSrcweir rtl::OString getElementUpdated();
43cdf0e10cSrcweir 
44cdf0e10cSrcweir /** create the child elements within the root structure for each platform.
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     @param bNeedsSave
47cdf0e10cSrcweir     [out]If true then the respective structure of elements was added and the
48cdf0e10cSrcweir     document needs to be saved.
49cdf0e10cSrcweir  */
50cdf0e10cSrcweir void createSettingsStructure(
51cdf0e10cSrcweir     xmlDoc * document, bool * bNeedsSave);
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 
54cdf0e10cSrcweir /** represents the settings saved in the /java/javaInfo element.
55cdf0e10cSrcweir     It is used within class NodeJava which determines the settings
56cdf0e10cSrcweir     file.
57cdf0e10cSrcweir */
58cdf0e10cSrcweir class CNodeJavaInfo
59cdf0e10cSrcweir {
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir     CNodeJavaInfo();
62cdf0e10cSrcweir     ~CNodeJavaInfo();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     /** if true, then javaInfo is empty. When writeToNode is called
65cdf0e10cSrcweir         then all child elements are deleted.
66cdf0e10cSrcweir      */
67cdf0e10cSrcweir     bool m_bEmptyNode;
68cdf0e10cSrcweir     /** Contains the value of the <updated> element of
69cdf0e10cSrcweir         the javavendors.xml after loadFromNode was called.
70cdf0e10cSrcweir         It is not used, when the javaInfo node is written.
71cdf0e10cSrcweir         see writeToNode
72cdf0e10cSrcweir      */
73cdf0e10cSrcweir     ::rtl::OString sAttrVendorUpdate;
74cdf0e10cSrcweir     /** contains the nil value of the /java/javaInfo@xsi:nil attribute.
75cdf0e10cSrcweir         Default is true;
76cdf0e10cSrcweir      */
77cdf0e10cSrcweir     bool bNil;
78cdf0e10cSrcweir     /** contains the value of the /java/javaInfo@autoSelect attribute.
79cdf0e10cSrcweir         Default is true. If it is false then the user has modified the JRE
80cdf0e10cSrcweir         selection by actively choosing a JRE from the options dialog. That is,
81cdf0e10cSrcweir         the function jfw_setSelectedJRE was called. Contrary, the function
82cdf0e10cSrcweir         jfw_findAndSelectJRE sets the attribute to true.
83cdf0e10cSrcweir      */
84cdf0e10cSrcweir     bool bAutoSelect;
85cdf0e10cSrcweir     ::rtl::OUString sVendor;
86cdf0e10cSrcweir     ::rtl::OUString sLocation;
87cdf0e10cSrcweir     ::rtl::OUString sVersion;
88cdf0e10cSrcweir     sal_uInt64 nFeatures;
89cdf0e10cSrcweir     sal_uInt64 nRequirements;
90cdf0e10cSrcweir     ::rtl::ByteSequence arVendorData;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     /** reads the node /java/javaInfo.
93cdf0e10cSrcweir         If javaInfo@xsi:nil = true then member bNil is set to true
94cdf0e10cSrcweir         an no further elements are read.
95cdf0e10cSrcweir      */
96cdf0e10cSrcweir     void loadFromNode(xmlDoc * pDoc,xmlNode * pJavaInfo);
97cdf0e10cSrcweir     /** The attribut nil will be set to false. The function gets the value
98cdf0e10cSrcweir         javaSettings/updated from the javavendors.xml and writes it to
99cdf0e10cSrcweir         javaInfo@vendorUpdate in javasettings.xml
100cdf0e10cSrcweir      */
101cdf0e10cSrcweir     void writeToNode(xmlDoc * pDoc, xmlNode * pJavaInfo) const;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     /** returns NULL if javaInfo is nil.
104cdf0e10cSrcweir      */
105cdf0e10cSrcweir     JavaInfo * makeJavaInfo() const;
106cdf0e10cSrcweir };
107cdf0e10cSrcweir 
108cdf0e10cSrcweir /** this class represents the java settings  based on a particular
109cdf0e10cSrcweir     settings file.
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     Which settings file is used is determined by the value passed into the
112cdf0e10cSrcweir     constructo and the values of the bootstrap parameters UNO_JAVA_JFW_USER_DATA,
113cdf0e10cSrcweir     UNO_JAVA_JFW_SHARED_DATA,_JAVA_JFW_INSTALL_DATA.
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     If the value is USER_OR_INSTALL then it depends of the bootstrap parameter
116cdf0e10cSrcweir     UNO_JAVA_JFW_INSTALL_DATA. If it has as value then it is used. Otherwise the
117cdf0e10cSrcweir     value from UNO_JAVA_JFW_USER_DATA is used.
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     The method load reads the data from the settings file.
120cdf0e10cSrcweir     The method write stores the data into the settings file.
121cdf0e10cSrcweir  */
122cdf0e10cSrcweir class NodeJava
123cdf0e10cSrcweir {
124cdf0e10cSrcweir public:
125cdf0e10cSrcweir     enum Layer { USER_OR_INSTALL, USER, SHARED, INSTALL };
126cdf0e10cSrcweir private:
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     /** creates settings file and fills it with default values.
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         When this function is called then it creates the
131a893be29SPedro Giffuni         settings file at the position determined by the bootstrap parameters
132cdf0e10cSrcweir         (UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA,
133cdf0e10cSrcweir         UNO_JAVA_JFW_INSTALL_DATA) and m_layer, unless the file already exists
134cdf0e10cSrcweir         (see createSettingsDocument).
135cdf0e10cSrcweir 
136cdf0e10cSrcweir         @return
137cdf0e10cSrcweir         JFW_E_CONFIG_READWRITE
138cdf0e10cSrcweir     */
139cdf0e10cSrcweir     void prepareSettingsDocument() const;
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     /** helper function for prepareSettingsDocument.
142cdf0e10cSrcweir     */
143cdf0e10cSrcweir     void createSettingsDocument() const;
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     /** returns the system path to the data file which is to be used. The value
146*fb0b81f5Smseidel         depends on the member m_layer and the bootstrap parameters UNO_JAVA_JFW_USER_DATA,
147cdf0e10cSrcweir         UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_INSTALL_DATA which this may be.
148cdf0e10cSrcweir     */
149cdf0e10cSrcweir     ::rtl::OString getSettingsPath() const;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     /** returns the file URL to the data file which is to be used. See getSettingsPath.
152cdf0e10cSrcweir     */
153cdf0e10cSrcweir     ::rtl::OUString getSettingsURL() const;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     /** Verifies if the respective settings file exist. In case UNO_JAVA_JFW_INSTALL_DATA
156cdf0e10cSrcweir         is used, the age is checked. If the file is too old then we assume that it does not
157cdf0e10cSrcweir         exist and wipe its contents. Then still FILE_DOES_NOT_EXIST is returned.
158cdf0e10cSrcweir      */
159cdf0e10cSrcweir     jfw::FileStatus checkSettingsFileStatus() const;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     /** Determines the layer for which the instance the loads and writes the
162cdf0e10cSrcweir         data.
163cdf0e10cSrcweir     */
164cdf0e10cSrcweir     Layer m_layer;
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     /** User configurable option.  /java/enabled
167cdf0e10cSrcweir         If /java/enabled@xsi:nil == true then the value will be uninitialized
168cdf0e10cSrcweir         after a call to load().
169cdf0e10cSrcweir     */
170cdf0e10cSrcweir     boost::optional<sal_Bool> m_enabled;
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     /** User configurable option. /java/userClassPath
173cdf0e10cSrcweir         If /java/userClassPath@xsi:nil == true then the value is uninitialized
174cdf0e10cSrcweir         after a call to load().
175cdf0e10cSrcweir     */
176cdf0e10cSrcweir     boost::optional< ::rtl::OUString> m_userClassPath;
177cdf0e10cSrcweir     /** User configurable option.  /java/javaInfo
178cdf0e10cSrcweir         If /java/javaInfo@xsi:nil == true then the value is uninitialized
179cdf0e10cSrcweir         after a call to load.
180cdf0e10cSrcweir      */
181cdf0e10cSrcweir     boost::optional<CNodeJavaInfo> m_javaInfo;
182cdf0e10cSrcweir     /** User configurable option. /java/vmParameters
183cdf0e10cSrcweir         If /java/vmParameters@xsi:nil == true then the value is uninitialized
184cdf0e10cSrcweir         after a call to load.
185cdf0e10cSrcweir     */
186cdf0e10cSrcweir     boost::optional< ::std::vector< ::rtl::OUString> > m_vmParameters;
187cdf0e10cSrcweir     /** User configurable option. /java/jreLocations
188cdf0e10cSrcweir         If /java/jreLocaltions@xsi:nil == true then the value is uninitialized
189cdf0e10cSrcweir         after a call to load.
190cdf0e10cSrcweir     */
191cdf0e10cSrcweir     boost::optional< ::std::vector< ::rtl::OUString> > m_JRELocations;
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     /** Only in INSTALL mode. Then NodeJava.write writes a <modified> element
194cdf0e10cSrcweir         which contains the seconds value of the TimeValue (osl/time.h), obtained
195cdf0e10cSrcweir         with osl_getSystemTime.
196cdf0e10cSrcweir         It returns 0 if the value cannot be obtained.
197cdf0e10cSrcweir         This is used to fix the problem that the modified time of the settings
198cdf0e10cSrcweir         file is incorrect because it resides on an NFS volume where the NFS
199cdf0e10cSrcweir         server and NFS client do not have the same system time. For example if
200cdf0e10cSrcweir         the server time is ahead of the client time then checkSettingsFileStatus
201cdf0e10cSrcweir         deleted the settings. So even if javaldx determined a Java
202cdf0e10cSrcweir         (jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then
203cdf0e10cSrcweir         it looked again for a java by calling jfw_findAndSelectJRE, which
204cdf0e10cSrcweir         returned a JFW_E_NONE. But the following jfw_startVM returned again
205cdf0e10cSrcweir         JFW_E_NO_SELECT. So it looped. (see issue i114509)
206cdf0e10cSrcweir 
207cdf0e10cSrcweir         NFS server and NFS client should have the same time. It is common
208cdf0e10cSrcweir         practise to enforce this in networks. We actually should not work
209cdf0e10cSrcweir         around a malconfigured network. We must however, make sure that we do
210cdf0e10cSrcweir         not loop. Maybe a better approach is, that:
211cdf0e10cSrcweir         - assume that mtime and system time are reliable
212cdf0e10cSrcweir         - checkSettingsFile uses system time and mtime of the settings file,
213cdf0e10cSrcweir         instset of using getModifiedTime.
214cdf0e10cSrcweir         - allow a small error margin
215cdf0e10cSrcweir         - jfw_startVM must return a JFW_E_EXPIRED_SETTINGS
216cdf0e10cSrcweir         - XJavaVM::startVM should prevent the loop by processing the new return+        value
217cdf0e10cSrcweir 
218cdf0e10cSrcweir     */
219cdf0e10cSrcweir     sal_uInt32 getModifiedTime() const;
220cdf0e10cSrcweir 
221cdf0e10cSrcweir public:
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     NodeJava(Layer theLayer = USER_OR_INSTALL);
224cdf0e10cSrcweir 
225cdf0e10cSrcweir     /** sets m_enabled.
226cdf0e10cSrcweir         /java/enabled@xsi:nil will be set to false when write is called.
227cdf0e10cSrcweir      */
228cdf0e10cSrcweir     void setEnabled(sal_Bool bEnabled);
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     /** sets m_sUserClassPath. See setEnabled.
231cdf0e10cSrcweir      */
232cdf0e10cSrcweir     void setUserClassPath(const ::rtl::OUString & sClassPath);
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     /** sets m_aInfo. See setEnabled.
235cdf0e10cSrcweir         @param bAutoSelect
236cdf0e10cSrcweir         true- called by jfw_setSelectedJRE
237cdf0e10cSrcweir         false called by jfw_findAndSelectJRE
238cdf0e10cSrcweir      */
239cdf0e10cSrcweir     void setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect);
240cdf0e10cSrcweir 
241cdf0e10cSrcweir     /** sets the /java/vmParameters/param elements.
242cdf0e10cSrcweir         When this method all previous values are removed and replaced
243cdf0e10cSrcweir         by those in arParameters.
244cdf0e10cSrcweir         /java/vmParameters@xsi:nil will be set to true when write() is
245cdf0e10cSrcweir         called.
246cdf0e10cSrcweir      */
247cdf0e10cSrcweir     void setVmParameters(rtl_uString  * * arParameters, sal_Int32 size);
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     /** sets the /java/jreLocations/location elements.
250cdf0e10cSrcweir         When this method is called then all previous values are removed
251cdf0e10cSrcweir         and replaced by those in arParamters.
252cdf0e10cSrcweir         /java/jreLocations@xsi:nil will be set to true write() is called.
253cdf0e10cSrcweir      */
254cdf0e10cSrcweir     void setJRELocations(rtl_uString  * * arParameters, sal_Int32 size);
255cdf0e10cSrcweir 
256cdf0e10cSrcweir     /** adds a location to the already existing locations.
257cdf0e10cSrcweir         Note: call load() before, then add the location and then call write().
258cdf0e10cSrcweir     */
259cdf0e10cSrcweir     void addJRELocation(rtl_uString * sLocation);
260cdf0e10cSrcweir 
261cdf0e10cSrcweir     /** writes the data to user settings.
262cdf0e10cSrcweir      */
263cdf0e10cSrcweir     void write() const;
264cdf0e10cSrcweir 
265cdf0e10cSrcweir     /** load the values of the settings file.
266cdf0e10cSrcweir      */
267cdf0e10cSrcweir     void load();
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     /** returns the value of the element /java/enabled
270cdf0e10cSrcweir      */
271cdf0e10cSrcweir     const boost::optional<sal_Bool> & getEnabled() const;
272cdf0e10cSrcweir     /** returns the value of the element /java/userClassPath.
273cdf0e10cSrcweir      */
274cdf0e10cSrcweir     const boost::optional< ::rtl::OUString> & getUserClassPath() const;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir     /** returns the value of the element /java/javaInfo.
277cdf0e10cSrcweir      */
278cdf0e10cSrcweir     const boost::optional<CNodeJavaInfo> & getJavaInfo() const;
279cdf0e10cSrcweir 
280cdf0e10cSrcweir     /** returns the parameters from the element /java/vmParameters/param.
281cdf0e10cSrcweir      */
282cdf0e10cSrcweir     const boost::optional< ::std::vector< ::rtl::OUString> > & getVmParameters() const;
283cdf0e10cSrcweir 
284cdf0e10cSrcweir     /** returns the parameters from the element /java/jreLocations/location.
285cdf0e10cSrcweir      */
286cdf0e10cSrcweir     const boost::optional< ::std::vector< ::rtl::OUString> > & getJRELocations() const;
287cdf0e10cSrcweir };
288cdf0e10cSrcweir 
289cdf0e10cSrcweir /** merges the settings for shared, user and installation during construction.
290cdf0e10cSrcweir     The class uses a simple merge mechanism for the javasettings.xml files in share and
291cdf0e10cSrcweir     user. The following elements completly overwrite the corresponding elements
292cdf0e10cSrcweir     from share:
293cdf0e10cSrcweir     /java/enabled
294cdf0e10cSrcweir     /java/userClassPath
295cdf0e10cSrcweir     /java/vmParameters
296cdf0e10cSrcweir     /java/jreLocations
297cdf0e10cSrcweir     /java/javaInfo
298cdf0e10cSrcweir 
299cdf0e10cSrcweir     In case of an installation, the shared and user settings are completely
300cdf0e10cSrcweir     disregarded.
301cdf0e10cSrcweir 
302cdf0e10cSrcweir     The locations of the different settings files is obtained through the
303cdf0e10cSrcweir     bootstrap variables:
304cdf0e10cSrcweir     UNO_JAVA_JFW_USER_DATA
305cdf0e10cSrcweir     UNO_JAVA_JFW_SHARED_DATA
306cdf0e10cSrcweir     UNO_JAVA_JFW_INSTALL_DATA
307cdf0e10cSrcweir 
308cdf0e10cSrcweir     The class also determines useful default values for settings which have not been made.
309cdf0e10cSrcweir */
310cdf0e10cSrcweir class MergedSettings
311cdf0e10cSrcweir {
312cdf0e10cSrcweir private:
313cdf0e10cSrcweir     const MergedSettings& operator = (MergedSettings&);
314cdf0e10cSrcweir     MergedSettings(MergedSettings&);
315cdf0e10cSrcweir 
316cdf0e10cSrcweir     void merge(const NodeJava & share, const NodeJava & user);
317cdf0e10cSrcweir 
318cdf0e10cSrcweir     sal_Bool m_bEnabled;
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     ::rtl::OUString m_sClassPath;
321cdf0e10cSrcweir 
322cdf0e10cSrcweir     ::std::vector< ::rtl::OUString> m_vmParams;
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     ::std::vector< ::rtl::OUString> m_JRELocations;
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     CNodeJavaInfo m_javaInfo;
327cdf0e10cSrcweir 
328cdf0e10cSrcweir public:
329cdf0e10cSrcweir     MergedSettings();
330cdf0e10cSrcweir     virtual ~MergedSettings();
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     /** the default is true.
333cdf0e10cSrcweir      */
334cdf0e10cSrcweir     sal_Bool getEnabled() const;
335cdf0e10cSrcweir 
336cdf0e10cSrcweir     const ::rtl::OUString & getUserClassPath() const;
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     ::std::vector< ::rtl::OString> getVmParametersUtf8() const;
339cdf0e10cSrcweir     /** returns a JavaInfo structure representing the node
340cdf0e10cSrcweir         /java/javaInfo. Every time a new JavaInfo structure is created
341cdf0e10cSrcweir         which needs to be freed by the caller.
342cdf0e10cSrcweir         If both, user and share settings are nil, then NULL is returned.
343cdf0e10cSrcweir     */
344cdf0e10cSrcweir     JavaInfo * createJavaInfo() const;
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     /** returns the value of the attribute /java/javaInfo[@vendorUpdate].
347cdf0e10cSrcweir      */
348cdf0e10cSrcweir     ::rtl::OString const & getJavaInfoAttrVendorUpdate() const;
349cdf0e10cSrcweir 
350cdf0e10cSrcweir #ifdef WNT
351cdf0e10cSrcweir     /** returns the javaInfo@autoSelect attribute.
352cdf0e10cSrcweir         Before calling this function loadFromSettings must be called.
353cdf0e10cSrcweir         It uses the javaInfo@autoSelect attribute  to determine
354cdf0e10cSrcweir         the return value;
355cdf0e10cSrcweir      */
356cdf0e10cSrcweir     bool getJavaInfoAttrAutoSelect() const;
357cdf0e10cSrcweir #endif
358cdf0e10cSrcweir 
359cdf0e10cSrcweir     /** returns an array.
360cdf0e10cSrcweir         Caller must free the strings and the array.
361cdf0e10cSrcweir      */
362cdf0e10cSrcweir     void getVmParametersArray(rtl_uString *** parParameters, sal_Int32 * size) const;
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     /** returns an array.
365cdf0e10cSrcweir         Caller must free the strings and the array.
366cdf0e10cSrcweir      */
367cdf0e10cSrcweir     void getJRELocations(rtl_uString *** parLocations, sal_Int32 * size) const;
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     const ::std::vector< ::rtl::OUString> & getJRELocations() const;
370cdf0e10cSrcweir };
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 
373cdf0e10cSrcweir class VersionInfo
374cdf0e10cSrcweir {
375cdf0e10cSrcweir     ::std::vector< ::rtl::OUString> vecExcludeVersions;
376cdf0e10cSrcweir     rtl_uString ** arVersions;
377cdf0e10cSrcweir 
378cdf0e10cSrcweir public:
379cdf0e10cSrcweir     VersionInfo();
380cdf0e10cSrcweir     ~VersionInfo();
381cdf0e10cSrcweir 
382cdf0e10cSrcweir     void addExcludeVersion(const ::rtl::OUString& sVersion);
383cdf0e10cSrcweir 
384cdf0e10cSrcweir     ::rtl::OUString sMinVersion;
385cdf0e10cSrcweir     ::rtl::OUString sMaxVersion;
386cdf0e10cSrcweir 
387cdf0e10cSrcweir     /** The caller DOES NOT get ownership of the strings. That is he
388cdf0e10cSrcweir         does not need to release the strings.
389cdf0e10cSrcweir         The array exists as long as this object exists.
390cdf0e10cSrcweir     */
391cdf0e10cSrcweir 
392cdf0e10cSrcweir     rtl_uString** getExcludeVersions();
393cdf0e10cSrcweir     sal_Int32 getExcludeVersionSize();
394cdf0e10cSrcweir };
395cdf0e10cSrcweir 
396cdf0e10cSrcweir struct PluginLibrary
397cdf0e10cSrcweir {
398cdf0e10cSrcweir     PluginLibrary()
399cdf0e10cSrcweir     {
400cdf0e10cSrcweir     }
401cdf0e10cSrcweir     PluginLibrary(rtl::OUString vendor,::rtl::OUString path) :
402cdf0e10cSrcweir         sVendor(vendor), sPath(path)
403cdf0e10cSrcweir     {
404cdf0e10cSrcweir     }
405cdf0e10cSrcweir     /** contains the vendor string which is later userd in the xml API
406cdf0e10cSrcweir      */
407cdf0e10cSrcweir     ::rtl::OUString sVendor;
408cdf0e10cSrcweir     /** File URL the plug-in library
409cdf0e10cSrcweir      */
410cdf0e10cSrcweir     ::rtl::OUString sPath;
411cdf0e10cSrcweir };
412cdf0e10cSrcweir 
413cdf0e10cSrcweir } //end namespace
414cdf0e10cSrcweir #endif
415