1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
20 #define INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
22 #include "rtl/ustring.hxx"
23 #include "libxmlutil.hxx"
30 OUString m_xmlDocVendorSettingsFileUrl
;
31 CXmlDocPtr m_xmlDocVendorSettings
;
32 CXPathContextPtr m_xmlPathContextVendorSettings
;
37 /** Gets all plugin library URLs with the corresponding vendor name.
39 It uses the /javaSelection/plugins/library element from the javavendors.xml
40 to locate the library.
41 Is is verified that the plug-in exist. If a plug-in does not exist then an
42 exception is thrown containing the error JFW_E_CONFIGURATION
44 ::std::vector
<PluginLibrary
> getPluginData();
46 /* returns the file URL to the plugin.
48 OUString
getPluginLibrary(const OUString
& sVendor
);
50 VersionInfo
getVersionInformation(const OUString
& sVendor
);
52 ::std::vector
< OUString
> getSupportedVendors();
55 /* The class offers functions to retrieve verified bootstrap parameters.
60 /* Gets the file URL to the JRE which has been determined by the
61 bootstrap parameter UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME.
63 In direct mode either of them must be set. If not an exception is thrown.
65 OUString
getJREHome();
67 ::std::vector
< OString
> getVMParameters();
69 OUString
getUserData();
71 OUString
getSharedData();
73 /* returns the file URL to the vendor settings xml file.
75 OUString
getVendorSettings();
77 /* User the parameter UNO_JAVA_JFW_CLASSPATH and UNO_JAVA_JFW_ENV_CLASSPATH
78 to compose a classpath
80 OString
getClasspath();
82 OUString
getClasspathUrls();
97 /** creates the -Djava.class.path option with the complete classpath, including
98 the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS.
100 OString
makeClassPathOption(OUString
const & sUserClassPath
);
102 OString
getSettingsPath( const OUString
& sURL
);
104 /** Get the system path to the javasettings.xml
105 Converts the URL returned from getUserSettingsURL to a
106 Systempath. An empty string is returned if the file
108 @throws FrameworkException
110 OString
getUserSettingsPath();
112 /** Returns the system path of the share settings file.
113 Returns a valid string or throws an exception.
114 @throws FrameworkException
116 OString
getSharedSettingsPath();
118 /* returns a valid string or throws an exception.
119 @throws FrameworkException
121 OString
getVendorSettingsPath();
123 OUString
buildClassPathFromDirectory(const OUString
& relPath
);
125 /** Called from writeJavaInfoData. It sets the process identifier. When
126 java is to be started, then the current id is compared to the one set by
127 this function. If they are identical then the Java was selected in the
128 same process. If that Java needs a prepared environment, such as a
129 LD_LIBRARY_PATH, then it must not be started in this process.
131 void setJavaSelected();
133 /** Determines if the currently selected Java was set in this process.
137 bool wasJavaSelectedInSameProcess();
138 /* Only for application mode.
140 OUString
getApplicationClassPath();
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */