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