char array should be null terminated
[LibreOffice.git] / jvmfwk / source / fwkbase.hxx
blob0a15f7628e8e140d9ab75e4c79b2e0673c6f992b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #if !defined INCLUDED_JVMFWK_FWKBASE_HXX
29 #define INCLUDED_JVMFWK_FWKBASE_HXX
30 #include "rtl/ustring.hxx"
31 #include "libxmlutil.hxx"
32 namespace jfw
35 class VendorSettings
37 ::rtl::OUString m_xmlDocVendorSettingsFileUrl;
38 CXmlDocPtr m_xmlDocVendorSettings;
39 CXPathContextPtr m_xmlPathContextVendorSettings;
41 public:
42 VendorSettings();
44 /** Gets all plugin library URLs with the corresponding vendor name.
46 It uses the /javaSelection/plugins/library element from the javavendors.xml
47 to locate the library.
48 Is is verified that the plug-in exist. If a plug-in does not exist then an
49 exception is thrown containing the error JFW_E_CONFIGURATION
51 ::std::vector<PluginLibrary> getPluginData();
53 /* returns the file URL to the plugin.
55 ::rtl::OUString getPluginLibrary(const ::rtl::OUString& sVendor);
57 VersionInfo getVersionInformation(const ::rtl::OUString & sVendor);
59 ::std::vector< ::rtl::OUString> getSupportedVendors();
62 /* The class offers functions to retrieve verified bootstrap parameters.
64 namespace BootParams
67 /* Gets the file URL to the JRE which has been determined by the
68 bootstrap parameter UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME.
70 In direct mode either of them must be set. If not an exception is thrown.
72 ::rtl::OUString getJREHome();
74 ::std::vector< ::rtl::OString> getVMParameters();
76 ::rtl::OUString getUserData();
78 ::rtl::OUString getSharedData();
80 ::rtl::OUString getInstallData();
81 /* returns the file URL to the vendor settings xml file.
83 ::rtl::OUString getVendorSettings();
85 /* User the parameter UNO_JAVA_JFW_CLASSPATH and UNO_JAVA_JFW_ENV_CLASSPATH
86 to compose a classpath
88 ::rtl::OString getClasspath();
90 ::rtl::OUString getClasspathUrls();
92 /** returns the content of UNO_JAVA_JFW_INSTALL_EXPIRE or a pretermined
93 value. If the bootstrap variable contains a string that cannot be
94 converted by OUString then it returns the predetermined value.
96 ::sal_uInt32 getInstallDataExpiration();
98 } //end namespace
102 enum JFW_MODE
104 JFW_MODE_APPLICATION,
106 JFW_MODE_DIRECT
109 JFW_MODE getMode();
111 /** creates the -Djava.class.path option with the complete classpath, including
112 the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS.
114 ::rtl::OString makeClassPathOption(::rtl::OUString const & sUserClassPath);
116 ::rtl::OString getSettingsPath( const ::rtl::OUString & sURL);
118 /** Get the system path to the javasettings.xml
119 Converts the URL returned from getUserSettingsURL to a
120 Systempath. An empty string is returned if the file
121 does not exist.
122 @throws FrameworkException
124 ::rtl::OString getUserSettingsPath();
126 ::rtl::OString getInstallSettingsPath();
128 /** Returns the system path of the share settings file.
129 Returns a valid string or throws an exception.
130 @throws FrameworkException
132 ::rtl::OString getSharedSettingsPath();
134 /* returns a valid string or throws an exception.
135 @throws FrameworkException
137 ::rtl::OString getVendorSettingsPath();
139 ::rtl::OUString buildClassPathFromDirectory(const ::rtl::OUString & relPath);
141 /** Called from writeJavaInfoData. It sets the process identifier. When
142 java is to be started, then the current id is compared to the one set by
143 this function. If they are identical then the Java was selected in the
144 same process. If that Java needs a prepared environment, such as a
145 LD_LIBRARY_PATH, then it must not be started in this process.
147 void setJavaSelected();
149 /** Determines if the currently selected Java was set in this process.
151 @see setProcessId()
153 bool wasJavaSelectedInSameProcess();
154 /* Only for application mode.
156 ::rtl::OUString getApplicationClassPath();
159 #endif
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */