* commit 'ooo/DEV300_m101': (185 commits) chart52: cleanup unused legend entry stuff in preparation of issue #i82802# masterfix: #i10000# add missing dependency in offapi sb138: #i115619# fix for MinGW sb138: #i115619#, #i116038# use osl_setThreadName in binaryurp sb138: #i115619# osl_setThreadName gridsort: i116682: update UnoControlDialog to reflect XDialog gridsort: minor changes to the new API: - renamed XMutableGridDataModel::setRowHeading to updateRowHeading for consistency reasons - renamed XSortableGridDataModel to XSortableGridData - actually, this is not a full-fledged model in itself. gridsort: grid control related unit tests (first set, more to come) sb138: #i116038# fresh implementation of binary URP bridge chart52: #28670# make the legend within charts resizeable - part 2 gridsort: re-did the column resizing - introduced XGridColumn.Flexibility, determining to which degree the column is resized during auto-column-resizing - removed XGridColumn.PreferredWidth - there really is no need for this anymore now - documented the relationship between XGridColumn.Flexibility and XGridColumn.Resizeable - re-implemented TableControl_Impl::impl_ni_updateColumnWidths, with (hopefully) less magic sb139: #i116530# improve Java URP bridge error notification by utilizing the java.lang.Throwable cause facility gridsort: document the relationship between soorting the data and notifying XGridDataListeners gridsort: introduce XGridColumn::DataModelIndex. this allows for column removal/insertion at the GridColumnModel, without the need to touch the GridDataModel locales34: #i112431# adapt documentation to reality gridsort: introduce XSortableGridDataModel::removeColumnSort gridsort: #163172# added UNO API support for sorting grid data. Implementation still unfinished. Things missing in the SortableGridData implementation - add as listener to the delegator, so we're notified of changes - translate and multiplex those changes - do own notifications (XGridDataListener.dataChanged) when the sort order changed - (possibly) update the sort order when the data in the current sort-column changed gridsort: made the row title a row heading, being an Any instead of a string gridsort: XMutableGridData: renamed updateRow to updateRowData for consistency; introduced updateRowToolTip as shortcut for multiple updateCellToolTip calls gridsort: updateCell->updateCellData, setCellToolTip->updateCellToolTip; in both methods, have (Col,Row) params instead of (Row,Col), for consistency reasons ... Conflicts: bridges/inc/bridges/remote/bridgeimpl.hxx bridges/inc/bridges/remote/connection.h bridges/inc/bridges/remote/context.h bridges/inc/bridges/remote/helper.hxx bridges/inc/bridges/remote/mapping.hxx bridges/inc/bridges/remote/proxy.hxx bridges/inc/bridges/remote/remote.h bridges/inc/bridges/remote/remote.hxx bridges/inc/bridges/remote/stub.hxx bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx bridges/source/remote/context/context.cxx bridges/source/remote/static/helper.cxx bridges/source/remote/static/mapping.cxx bridges/source/remote/static/proxy.cxx bridges/source/remote/static/remote.cxx bridges/source/remote/static/remote_types.cxx bridges/source/remote/static/remote_types.hxx bridges/source/remote/static/stub.cxx bridges/source/remote/urp/urp_bridgeimpl.cxx bridges/source/remote/urp/urp_bridgeimpl.hxx bridges/source/remote/urp/urp_cache.h bridges/source/remote/urp/urp_cache.hxx bridges/source/remote/urp/urp_dispatch.cxx bridges/source/remote/urp/urp_dispatch.hxx bridges/source/remote/urp/urp_environment.cxx bridges/source/remote/urp/urp_job.cxx bridges/source/remote/urp/urp_job.hxx bridges/source/remote/urp/urp_log.cxx bridges/source/remote/urp/urp_log.hxx bridges/source/remote/urp/urp_marshal.cxx bridges/source/remote/urp/urp_marshal.hxx bridges/source/remote/urp/urp_marshal_decl.hxx bridges/source/remote/urp/urp_property.hxx bridges/source/remote/urp/urp_propertyobject.cxx bridges/source/remote/urp/urp_propertyobject.hxx bridges/source/remote/urp/urp_reader.cxx bridges/source/remote/urp/urp_reader.hxx bridges/source/remote/urp/urp_replycontainer.hxx bridges/source/remote/urp/urp_threadid.cxx bridges/source/remote/urp/urp_threadid.hxx bridges/source/remote/urp/urp_unmarshal.cxx bridges/source/remote/urp/urp_unmarshal.hxx bridges/source/remote/urp/urp_writer.cxx bridges/source/remote/urp/urp_writer.hxx cppu/source/threadpool/threadpool.cxx cppu/util/target.pmk cppuhelper/qa/propertysetmixin/comp_propertysetmixin.cxx cppuhelper/source/interfacecontainer.cxx cpputools/source/regcomplazy/regcomplazy.cxx jurt/prj/d.lst jvmfwk/source/elements.cxx offapi/com/sun/star/awt/grid/GridDataEvent.idl offapi/com/sun/star/awt/grid/XGridColumn.idl offapi/com/sun/star/awt/tab/makefile.mk offapi/com/sun/star/chart2/ExplicitIncrementData.idl offapi/com/sun/star/chart2/XPlotter.idl offapi/com/sun/star/chart2/XUndoHelper.idl offapi/com/sun/star/document/MediaDescriptor.idl offapi/com/sun/star/document/makefile.mk offapi/com/sun/star/linguistic2/XLanguageGuessing.idl offapi/com/sun/star/script/ModuleInfo.idl offapi/com/sun/star/script/ModuleType.idl offapi/com/sun/star/text/TextMarkupType.idl offapi/com/sun/star/util/XTextSearch.idl offapi/com/sun/star/xml/sax/XFastAttributeList.idl pyuno/source/loader/makefile.mk remotebridges/source/bridge/bridge_connection.cxx remotebridges/source/bridge/bridge_connection.hxx remotebridges/source/bridge/bridge_provider.cxx remotebridges/source/bridge/remote_bridge.cxx remotebridges/source/bridge/remote_bridge.hxx remotebridges/source/dynamicloader/dynamicloader.cxx remotebridges/source/factory/bridgefactory.cxx remotebridges/source/factory/bridgeimpl.cxx remotebridges/source/factory/bridgeimpl.hxx remotebridges/source/factory/makefile.mk sal/cppunittester/cppunittester.cxx sal/inc/osl/diagnose.h sal/osl/os2/system.h sal/osl/unx/diagnose.c sal/osl/unx/file_misc.cxx sal/osl/unx/process_impl.cxx sal/osl/w32/diagnose.c sal/osl/w32/process.cxx sal/prj/build.lst sal/qa/rtl/math/makefile.mk sal/qa/rtl/math/rtl_math.cxx sal/qa/rtl/math/rtl_old_testint64.cxx sal/qa/rtl/math/test_rtl_math.cxx sal/systools/win32/kill/kill.cxx sal/textenc/tencinfo.c sal/util/sal.map stoc/source/inspect/introspection.cxx stoc/source/security/file_policy.cxx stoc/source/simpleregistry/simpleregistry.cxx
423 lines
14 KiB
C++
423 lines
14 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*************************************************************************
|
|
*
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
*
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* This file is part of OpenOffice.org.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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).
|
|
*
|
|
* 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.
|
|
*
|
|
************************************************************************/
|
|
#if !defined INCLUDED_JVMFWK_ELEMENTS_HXX
|
|
#define INCLUDED_JVMFWK_ELEMENTS_HXX
|
|
|
|
#include <vector>
|
|
#include "jvmfwk/framework.h"
|
|
#include "fwkutil.hxx"
|
|
#include "rtl/ustring.hxx"
|
|
#include "rtl/byteseq.hxx"
|
|
#include "libxml/parser.h"
|
|
#include "boost/optional.hpp"
|
|
|
|
#define NS_JAVA_FRAMEWORK "http://openoffice.org/2004/java/framework/1.0"
|
|
#define NS_SCHEMA_INSTANCE "http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
namespace jfw
|
|
{
|
|
|
|
/** gets the value of the updated element from the javavendors.xml.
|
|
*/
|
|
rtl::OString getElementUpdated();
|
|
|
|
/** create the child elements within the root structure for each platform.
|
|
|
|
@param bNeedsSave
|
|
[out]If true then the respective structure of elements was added and the
|
|
document needs to be saved.
|
|
*/
|
|
void createSettingsStructure(
|
|
xmlDoc * document, bool * bNeedsSave);
|
|
|
|
|
|
/** represents the settings saved in the /java/javaInfo element.
|
|
It is used within class NodeJava which determines the settings
|
|
file.
|
|
*/
|
|
class CNodeJavaInfo
|
|
{
|
|
public:
|
|
CNodeJavaInfo();
|
|
~CNodeJavaInfo();
|
|
|
|
/** if true, then javaInfo is empty. When writeToNode is called
|
|
then all child elements are deleted.
|
|
*/
|
|
bool m_bEmptyNode;
|
|
/** Contains the value of the <updated> element of
|
|
the javavendors.xml after loadFromNode was called.
|
|
It is not used, when the javaInfo node is written.
|
|
see writeToNode
|
|
*/
|
|
::rtl::OString sAttrVendorUpdate;
|
|
/** contains the nil value of the /java/javaInfo@xsi:nil attribute.
|
|
Default is true;
|
|
*/
|
|
bool bNil;
|
|
/** contains the value of the /java/javaInfo@autoSelect attribute.
|
|
Default is true. If it is false then the user has modified the JRE
|
|
selection by actively choosing a JRE from the options dialog. That is,
|
|
the function jfw_setSelectedJRE was called. Contrary, the function
|
|
jfw_findAndSelectJRE sets the attribute to true.
|
|
*/
|
|
bool bAutoSelect;
|
|
::rtl::OUString sVendor;
|
|
::rtl::OUString sLocation;
|
|
::rtl::OUString sVersion;
|
|
sal_uInt64 nFeatures;
|
|
sal_uInt64 nRequirements;
|
|
::rtl::ByteSequence arVendorData;
|
|
|
|
/** reads the node /java/javaInfo.
|
|
If javaInfo@xsi:nil = true then member bNil is set to true
|
|
an no further elements are read.
|
|
*/
|
|
void loadFromNode(xmlDoc * pDoc,xmlNode * pJavaInfo);
|
|
/** The attribut nil will be set to false. The function gets the value
|
|
javaSettings/updated from the javavendors.xml and writes it to
|
|
javaInfo@vendorUpdate in javasettings.xml
|
|
*/
|
|
void writeToNode(xmlDoc * pDoc, xmlNode * pJavaInfo) const;
|
|
|
|
/** returns NULL if javaInfo is nil.
|
|
*/
|
|
JavaInfo * makeJavaInfo() const;
|
|
};
|
|
|
|
/** this class represents the java settings based on a particular
|
|
settings file.
|
|
|
|
Which settings file is used is determined by the value passed into the
|
|
constructo and the values of the bootstrap parameters UNO_JAVA_JFW_USER_DATA,
|
|
UNO_JAVA_JFW_SHARED_DATA,_JAVA_JFW_INSTALL_DATA.
|
|
|
|
If the value is USER_OR_INSTALL then it depends of the bootstrap parameter
|
|
UNO_JAVA_JFW_INSTALL_DATA. If it has as value then it is used. Otherwise the
|
|
value from UNO_JAVA_JFW_USER_DATA is used.
|
|
|
|
The method load reads the data from the settings file.
|
|
The method write stores the data into the settings file.
|
|
*/
|
|
class NodeJava
|
|
{
|
|
public:
|
|
enum Layer { USER_OR_INSTALL, USER, SHARED, INSTALL };
|
|
private:
|
|
|
|
/** creates settings file and fills it with default values.
|
|
|
|
When this function is called then it creates the
|
|
settings file at the possition determined by the bootstrap parameters
|
|
(UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA,
|
|
UNO_JAVA_JFW_INSTALL_DATA) and m_layer, unless the file already exists
|
|
(see createSettingsDocument).
|
|
|
|
@return
|
|
JFW_E_CONFIG_READWRITE
|
|
*/
|
|
void prepareSettingsDocument() const;
|
|
|
|
/** helper function for prepareSettingsDocument.
|
|
*/
|
|
void createSettingsDocument() const;
|
|
|
|
/** returns the system path to the data file which is to be used. The value
|
|
depends on
|
|
the the member m_layer and the bootstrap paramters UNO_JAVA_JFW_USER_DATA,
|
|
UNO_JAVA_JFW_SHARED_DATA and UNO_JAVA_JFW_INSTALL_DATA which this may be.
|
|
*/
|
|
::rtl::OString getSettingsPath() const;
|
|
|
|
/** returns the file URL to the data file which is to be used. See getSettingsPath.
|
|
*/
|
|
::rtl::OUString getSettingsURL() const;
|
|
|
|
/** Verifies if the respective settings file exist. In case UNO_JAVA_JFW_INSTALL_DATA
|
|
is used, the age is checked. If the file is too old then we assume that it does not
|
|
exist and wipe its contents. Then still FILE_DOES_NOT_EXIST is returned.
|
|
*/
|
|
jfw::FileStatus checkSettingsFileStatus() const;
|
|
|
|
/** Determines the layer for which the instance the loads and writes the
|
|
data.
|
|
*/
|
|
Layer m_layer;
|
|
|
|
/** User configurable option. /java/enabled
|
|
If /java/enabled@xsi:nil == true then the value will be uninitialized
|
|
after a call to load().
|
|
*/
|
|
boost::optional<sal_Bool> m_enabled;
|
|
|
|
/** User configurable option. /java/userClassPath
|
|
If /java/userClassPath@xsi:nil == true then the value is uninitialized
|
|
after a call to load().
|
|
*/
|
|
boost::optional< ::rtl::OUString> m_userClassPath;
|
|
/** User configurable option. /java/javaInfo
|
|
If /java/javaInfo@xsi:nil == true then the value is uninitialized
|
|
after a call to load.
|
|
*/
|
|
boost::optional<CNodeJavaInfo> m_javaInfo;
|
|
/** User configurable option. /java/vmParameters
|
|
If /java/vmParameters@xsi:nil == true then the value is uninitialized
|
|
after a call to load.
|
|
*/
|
|
boost::optional< ::std::vector< ::rtl::OUString> > m_vmParameters;
|
|
/** User configurable option. /java/jreLocations
|
|
If /java/jreLocaltions@xsi:nil == true then the value is uninitialized
|
|
after a call to load.
|
|
*/
|
|
boost::optional< ::std::vector< ::rtl::OUString> > m_JRELocations;
|
|
|
|
/** Only in INSTALL mode. Then NodeJava.write writes a <modified> element
|
|
which contains the seconds value of the TimeValue (osl/time.h), obtained
|
|
with osl_getSystemTime.
|
|
It returns 0 if the value cannot be obtained.
|
|
This is used to fix the problem that the modified time of the settings
|
|
file is incorrect because it resides on an NFS volume where the NFS
|
|
server and NFS client do not have the same system time. For example if
|
|
the server time is ahead of the client time then checkSettingsFileStatus
|
|
deleted the settings. So even if javaldx determined a Java
|
|
(jfw_findAndSelectJRE) then jfw_startVM returned a JFW_E_NO_SELECT. Then
|
|
it looked again for a java by calling jfw_findAndSelectJRE, which
|
|
returned a JFW_E_NONE. But the following jfw_startVM returned again
|
|
JFW_E_NO_SELECT. So it looped. (see issue i114509)
|
|
|
|
NFS server and NFS client should have the same time. It is common
|
|
practise to enforce this in networks. We actually should not work
|
|
around a malconfigured network. We must however, make sure that we do
|
|
not loop. Maybe a better approach is, that:
|
|
- assume that mtime and system time are reliable
|
|
- checkSettingsFile uses system time and mtime of the settings file,
|
|
instset of using getModifiedTime.
|
|
- allow a small error margin
|
|
- jfw_startVM must return a JFW_E_EXPIRED_SETTINGS
|
|
- XJavaVM::startVM should prevent the loop by processing the new return+ value
|
|
|
|
*/
|
|
sal_uInt32 getModifiedTime() const;
|
|
|
|
public:
|
|
|
|
NodeJava(Layer theLayer = USER_OR_INSTALL);
|
|
|
|
/** sets m_enabled.
|
|
/java/enabled@xsi:nil will be set to false when write is called.
|
|
*/
|
|
void setEnabled(sal_Bool bEnabled);
|
|
|
|
/** sets m_sUserClassPath. See setEnabled.
|
|
*/
|
|
void setUserClassPath(const ::rtl::OUString & sClassPath);
|
|
|
|
/** sets m_aInfo. See setEnabled.
|
|
@param bAutoSelect
|
|
true- called by jfw_setSelectedJRE
|
|
false called by jfw_findAndSelectJRE
|
|
*/
|
|
void setJavaInfo(const JavaInfo * pInfo, bool bAutoSelect);
|
|
|
|
/** sets the /java/vmParameters/param elements.
|
|
When this method all previous values are removed and replaced
|
|
by those in arParameters.
|
|
/java/vmParameters@xsi:nil will be set to true when write() is
|
|
called.
|
|
*/
|
|
void setVmParameters(rtl_uString * * arParameters, sal_Int32 size);
|
|
|
|
/** sets the /java/jreLocations/location elements.
|
|
When this method is called then all previous values are removed
|
|
and replaced by those in arParamters.
|
|
/java/jreLocations@xsi:nil will be set to true write() is called.
|
|
*/
|
|
void setJRELocations(rtl_uString * * arParameters, sal_Int32 size);
|
|
|
|
/** adds a location to the already existing locations.
|
|
Note: call load() before, then add the location and then call write().
|
|
*/
|
|
void addJRELocation(rtl_uString * sLocation);
|
|
|
|
/** writes the data to user settings.
|
|
*/
|
|
void write() const;
|
|
|
|
/** load the values of the settings file.
|
|
*/
|
|
void load();
|
|
|
|
/** returns the value of the element /java/enabled
|
|
*/
|
|
const boost::optional<sal_Bool> & getEnabled() const;
|
|
/** returns the value of the element /java/userClassPath.
|
|
*/
|
|
const boost::optional< ::rtl::OUString> & getUserClassPath() const;
|
|
|
|
/** returns the value of the element /java/javaInfo.
|
|
*/
|
|
const boost::optional<CNodeJavaInfo> & getJavaInfo() const;
|
|
|
|
/** returns the parameters from the element /java/vmParameters/param.
|
|
*/
|
|
const boost::optional< ::std::vector< ::rtl::OUString> > & getVmParameters() const;
|
|
|
|
/** returns the parameters from the element /java/jreLocations/location.
|
|
*/
|
|
const boost::optional< ::std::vector< ::rtl::OUString> > & getJRELocations() const;
|
|
};
|
|
|
|
/** merges the settings for shared, user and installation during construction.
|
|
The class uses a simple merge mechanism for the javasettings.xml files in share and
|
|
user. The following elements completly overwrite the corresponding elements
|
|
from share:
|
|
/java/enabled
|
|
/java/userClassPath
|
|
/java/vmParameters
|
|
/java/jreLocations
|
|
/java/javaInfo
|
|
|
|
In case of an installation, the shared and user settings are completely
|
|
disregarded.
|
|
|
|
The locations of the different settings files is obtained through the
|
|
bootstrap variables:
|
|
UNO_JAVA_JFW_USER_DATA
|
|
UNO_JAVA_JFW_SHARED_DATA
|
|
UNO_JAVA_JFW_INSTALL_DATA
|
|
|
|
The class also determines useful default values for settings which have not been made.
|
|
*/
|
|
class MergedSettings
|
|
{
|
|
private:
|
|
const MergedSettings& operator = (MergedSettings&);
|
|
MergedSettings(MergedSettings&);
|
|
|
|
void merge(const NodeJava & share, const NodeJava & user);
|
|
|
|
sal_Bool m_bEnabled;
|
|
|
|
::rtl::OUString m_sClassPath;
|
|
|
|
::std::vector< ::rtl::OUString> m_vmParams;
|
|
|
|
::std::vector< ::rtl::OUString> m_JRELocations;
|
|
|
|
CNodeJavaInfo m_javaInfo;
|
|
|
|
public:
|
|
MergedSettings();
|
|
virtual ~MergedSettings();
|
|
|
|
/** the default is true.
|
|
*/
|
|
sal_Bool getEnabled() const;
|
|
|
|
const ::rtl::OUString & getUserClassPath() const;
|
|
|
|
::std::vector< ::rtl::OString> getVmParametersUtf8() const;
|
|
/** returns a JavaInfo structure representing the node
|
|
/java/javaInfo. Every time a new JavaInfo structure is created
|
|
which needs to be freed by the caller.
|
|
If both, user and share settings are nil, then NULL is returned.
|
|
*/
|
|
JavaInfo * createJavaInfo() const;
|
|
|
|
/** returns the value of the attribute /java/javaInfo[@vendorUpdate].
|
|
*/
|
|
::rtl::OString const & getJavaInfoAttrVendorUpdate() const;
|
|
|
|
#ifdef WNT
|
|
/** returns the javaInfo@autoSelect attribute.
|
|
Before calling this function loadFromSettings must be called.
|
|
It uses the javaInfo@autoSelect attribute to determine
|
|
the return value;
|
|
*/
|
|
bool getJavaInfoAttrAutoSelect() const;
|
|
#endif
|
|
|
|
/** returns an array.
|
|
Caller must free the strings and the array.
|
|
*/
|
|
void getVmParametersArray(rtl_uString *** parParameters, sal_Int32 * size) const;
|
|
|
|
/** returns an array.
|
|
Caller must free the strings and the array.
|
|
*/
|
|
void getJRELocations(rtl_uString *** parLocations, sal_Int32 * size) const;
|
|
|
|
const ::std::vector< ::rtl::OUString> & getJRELocations() const;
|
|
};
|
|
|
|
|
|
class VersionInfo
|
|
{
|
|
::std::vector< ::rtl::OUString> vecExcludeVersions;
|
|
rtl_uString ** arVersions;
|
|
|
|
public:
|
|
VersionInfo();
|
|
~VersionInfo();
|
|
|
|
void addExcludeVersion(const ::rtl::OUString& sVersion);
|
|
|
|
::rtl::OUString sMinVersion;
|
|
::rtl::OUString sMaxVersion;
|
|
|
|
/** The caller DOES NOT get ownership of the strings. That is he
|
|
does not need to release the strings.
|
|
The array exists as long as this object exists.
|
|
*/
|
|
|
|
rtl_uString** getExcludeVersions();
|
|
sal_Int32 getExcludeVersionSize();
|
|
};
|
|
|
|
struct PluginLibrary
|
|
{
|
|
PluginLibrary()
|
|
{
|
|
}
|
|
PluginLibrary(rtl::OUString vendor,::rtl::OUString path) :
|
|
sVendor(vendor), sPath(path)
|
|
{
|
|
}
|
|
/** contains the vendor string which is later userd in the xml API
|
|
*/
|
|
::rtl::OUString sVendor;
|
|
/** File URL the plug-in library
|
|
*/
|
|
::rtl::OUString sPath;
|
|
};
|
|
|
|
} //end namespace
|
|
#endif
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|