merge the formfield patch from ooo-build
[ooovba.git] / jvmfwk / source / fwkbase.hxx
blob0b97086249e45248c529fbd1d5b0f2d0fb42622a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fwkbase.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #if !defined INCLUDED_JVMFWK_FWKBASE_HXX
31 #define INCLUDED_JVMFWK_FWKBASE_HXX
32 #include "rtl/ustring.hxx"
33 #include "libxmlutil.hxx"
34 namespace jfw
37 class VendorSettings
39 ::rtl::OUString m_xmlDocVendorSettingsFileUrl;
40 CXmlDocPtr m_xmlDocVendorSettings;
41 CXPathContextPtr m_xmlPathContextVendorSettings;
43 public:
44 VendorSettings();
46 /** Gets all plugin library URLs with the corresponding vendor name.
48 It uses the /javaSelection/plugins/library element from the javavendors.xml
49 to locate the library.
50 Is is verified that the plug-in exist. If a plug-in does not exist then an
51 exception is thrown containing the error JFW_E_CONFIGURATION
53 ::std::vector<PluginLibrary> getPluginData();
55 /* returns the file URL to the plugin.
57 ::rtl::OUString getPluginLibrary(const ::rtl::OUString& sVendor);
59 VersionInfo getVersionInformation(const ::rtl::OUString & sVendor);
61 ::std::vector< ::rtl::OUString> getSupportedVendors();
64 /* The class offers functions to retrieve verified bootstrap parameters.
66 namespace BootParams
69 /* Gets the file URL to the JRE which has been determined by the
70 bootstrap parameter UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME.
72 In direct mode either of them must be set. If not an exception is thrown.
74 ::rtl::OUString getJREHome();
76 ::std::vector< ::rtl::OString> getVMParameters();
78 ::rtl::OUString getUserData();
80 ::rtl::OUString getSharedData();
82 ::rtl::OUString getInstallData();
83 /* returns the file URL to the vendor settings xml file.
85 ::rtl::OUString getVendorSettings();
87 /* User the parameter UNO_JAVA_JFW_CLASSPATH and UNO_JAVA_JFW_ENV_CLASSPATH
88 to compose a classpath
90 ::rtl::OString getClasspath();
92 ::rtl::OUString getClasspathUrls();
94 /** returns the content of UNO_JAVA_JFW_INSTALL_EXPIRE or a pretermined
95 value. If the bootstrap variable contains a string that cannot be
96 converted by OUString then it returns the predetermined value.
98 ::sal_uInt32 getInstallDataExpiration();
100 } //end namespace
104 enum JFW_MODE
106 JFW_MODE_APPLICATION,
108 JFW_MODE_DIRECT
111 JFW_MODE getMode();
113 /** creates the -Djava.class.path option with the complete classpath, including
114 the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS.
116 ::rtl::OString makeClassPathOption(::rtl::OUString const & sUserClassPath);
118 ::rtl::OString getSettingsPath( const ::rtl::OUString & sURL);
120 /** Get the system path to the javasettings.xml
121 Converts the URL returned from getUserSettingsURL to a
122 Systempath. An empty string is returned if the file
123 does not exist.
124 @throws FrameworkException
126 ::rtl::OString getUserSettingsPath();
128 ::rtl::OString getInstallSettingsPath();
130 /** Returns the system path of the share settings file.
131 Returns a valid string or throws an exception.
132 @throws FrameworkException
134 ::rtl::OString getSharedSettingsPath();
136 /* returns a valid string or throws an exception.
137 @throws FrameworkException
139 ::rtl::OString getVendorSettingsPath();
141 ::rtl::OUString buildClassPathFromDirectory(const ::rtl::OUString & relPath);
143 /** Called from writeJavaInfoData. It sets the process identifier. When
144 java is to be started, then the current id is compared to the one set by
145 this function. If they are identical then the Java was selected in the
146 same process. If that Java needs a prepared environment, such as a
147 LD_LIBRARY_PATH, then it must not be started in this process.
149 void setJavaSelected();
151 /** Determines if the currently selected Java was set in this process.
153 @see setProcessId()
155 bool wasJavaSelectedInSameProcess();
156 /* Only for application mode.
158 ::rtl::OUString getApplicationClassPath();
161 #endif