2004-11-09 07:00:47 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* $RCSfile: fwkbase.hxx,v $
|
|
|
|
* $Revision: 1.7 $
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
2008-04-11 04:28:38 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-11-09 07:00:47 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#if !defined INCLUDED_JVMFWK_FWKBASE_HXX
|
|
|
|
#define INCLUDED_JVMFWK_FWKBASE_HXX
|
|
|
|
#include "rtl/ustring.hxx"
|
|
|
|
#include "libxmlutil.hxx"
|
|
|
|
namespace jfw
|
|
|
|
{
|
|
|
|
|
|
|
|
class VendorSettings
|
|
|
|
{
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString m_xmlDocVendorSettingsFileUrl;
|
2004-11-09 07:00:47 -06:00
|
|
|
CXmlDocPtr m_xmlDocVendorSettings;
|
|
|
|
CXPathContextPtr m_xmlPathContextVendorSettings;
|
|
|
|
|
|
|
|
public:
|
|
|
|
VendorSettings();
|
|
|
|
|
|
|
|
/** Gets all plugin library URLs with the corresponding vendor name.
|
|
|
|
|
|
|
|
It uses the /javaSelection/plugins/library element from the javavendors.xml
|
|
|
|
to locate the library.
|
|
|
|
Is is verified that the plug-in exist. If a plug-in does not exist then an
|
|
|
|
exception is thrown containing the error JFW_E_CONFIGURATION
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::std::vector<PluginLibrary> getPluginData();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/* returns the file URL to the plugin.
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getPluginLibrary(const ::rtl::OUString& sVendor);
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
VersionInfo getVersionInformation(const ::rtl::OUString & sVendor);
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::std::vector< ::rtl::OUString> getSupportedVendors();
|
2004-11-09 07:00:47 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
/* The class offers functions to retrieve verified bootstrap parameters.
|
|
|
|
*/
|
|
|
|
namespace BootParams
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Gets the file URL to the JRE which has been determined by the
|
|
|
|
bootstrap parameter UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME.
|
|
|
|
|
|
|
|
In direct mode either of them must be set. If not an exception is thrown.
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getJREHome();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::std::vector< ::rtl::OString> getVMParameters();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getUserData();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getSharedData();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getInstallData();
|
2004-11-09 07:00:47 -06:00
|
|
|
/* returns the file URL to the vendor settings xml file.
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getVendorSettings();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/* User the parameter UNO_JAVA_JFW_CLASSPATH and UNO_JAVA_JFW_ENV_CLASSPATH
|
|
|
|
to compose a classpath
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString getClasspath();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getClasspathUrls();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
/** returns the content of UNO_JAVA_JFW_INSTALL_EXPIRE or a pretermined
|
|
|
|
value. If the bootstrap variable contains a string that cannot be
|
|
|
|
converted by OUString then it returns the predetermined value.
|
|
|
|
*/
|
|
|
|
::sal_uInt32 getInstallDataExpiration();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
} //end namespace
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum JFW_MODE
|
|
|
|
{
|
|
|
|
JFW_MODE_APPLICATION,
|
|
|
|
|
|
|
|
JFW_MODE_DIRECT
|
|
|
|
};
|
|
|
|
|
|
|
|
JFW_MODE getMode();
|
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
/** creates the -Djava.class.path option with the complete classpath, including
|
|
|
|
the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS.
|
2004-11-09 07:00:47 -06:00
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString makeClassPathOption(::rtl::OUString const & sUserClassPath);
|
|
|
|
|
|
|
|
::rtl::OString getSettingsPath( const ::rtl::OUString & sURL);
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/** Get the system path to the javasettings.xml
|
|
|
|
Converts the URL returned from getUserSettingsURL to a
|
|
|
|
Systempath. An empty string is returned if the file
|
|
|
|
does not exist.
|
|
|
|
@throws FrameworkException
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString getUserSettingsPath();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString getInstallSettingsPath();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/** Returns the system path of the share settings file.
|
|
|
|
Returns a valid string or throws an exception.
|
|
|
|
@throws FrameworkException
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString getSharedSettingsPath();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/* Determines the application base which is either the BaseInstallation
|
|
|
|
(see getBaseInstallation) or the directory where the executable is resides.
|
|
|
|
|
|
|
|
This function always returns a URL or throws an exception.
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getApplicationBase();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
/* returns a valid string or throws an exception.
|
|
|
|
@throws FrameworkException
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OString getVendorSettingsPath();
|
2004-11-09 07:00:47 -06:00
|
|
|
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString buildClassPathFromDirectory(const ::rtl::OUString & relPath);
|
2004-11-09 07:00:47 -06:00
|
|
|
|
|
|
|
/** Called from writeJavaInfoData. It sets the process identifier. When
|
|
|
|
java is to be started, then the current id is compared to the one set by
|
|
|
|
this function. If they are identical then the Java was selected in the
|
|
|
|
same process. If that Java needs a prepared environment, such as a
|
|
|
|
LD_LIBRARY_PATH, then it must not be started in this process.
|
|
|
|
*/
|
|
|
|
void setJavaSelected();
|
|
|
|
|
|
|
|
/** Determines if the currently selected Java was set in this process.
|
|
|
|
|
|
|
|
@see setProcessId()
|
|
|
|
*/
|
|
|
|
bool wasJavaSelectedInSameProcess();
|
|
|
|
/* Only for application mode.
|
|
|
|
*/
|
2007-06-13 01:58:05 -05:00
|
|
|
::rtl::OUString getApplicationClassPath();
|
2004-11-09 07:00:47 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|