2004-04-19 09:57:02 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* $RCSfile: fwkutil.hxx,v $
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* $Revision: 1.12 $
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* last change: $Author: rt $ $Date: 2005-09-07 19:35:48 $
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* This library 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 for more details.
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
2005-09-07 13:35:48 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2004-04-19 09:57:02 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#if !defined INCLUDED_JVMFWK_FWKUTIL_HXX
|
|
|
|
#define INCLUDED_JVMFWK_FWKUTIL_HXX
|
|
|
|
|
|
|
|
#include "osl/mutex.hxx"
|
2004-11-09 07:01:18 -06:00
|
|
|
#include "rtl/bootstrap.hxx"
|
2004-04-19 09:57:02 -05:00
|
|
|
namespace jfw
|
|
|
|
{
|
|
|
|
osl::Mutex * getFwkMutex();
|
|
|
|
|
|
|
|
rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData);
|
|
|
|
rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data);
|
|
|
|
|
2004-04-26 08:47:39 -05:00
|
|
|
rtl::OUString getPlatform();
|
2004-11-09 07:01:18 -06:00
|
|
|
/** provides a bootstrap class which already knows the values from the
|
|
|
|
jvmfkwrc file.
|
|
|
|
*/
|
|
|
|
const rtl::Bootstrap& getBootstrap();
|
2004-05-17 07:55:32 -05:00
|
|
|
|
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
rtl::OUString getDirFromFile(const rtl::OUString& usFilePath);
|
2004-05-17 07:55:32 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
rtl::OUString getFileFromURL(const rtl::OUString& sFileURL);
|
2004-04-26 09:54:23 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
/** Returns the file URL of the directory where the framework library
|
|
|
|
(this library) resides.
|
|
|
|
*/
|
|
|
|
rtl::OUString getLibraryLocation();
|
2004-04-26 09:54:23 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
/** Returns the file URL of the folder where the executable resides.
|
2004-04-26 09:54:23 -05:00
|
|
|
*/
|
2004-11-09 07:01:18 -06:00
|
|
|
rtl::OUString getExecutableDirectory();
|
|
|
|
/** Locates the plugin library and returns the file URL.
|
2005-06-17 04:12:55 -05:00
|
|
|
|
|
|
|
First tries to locate plugin relative to baseUrl. If that fails, tries to
|
|
|
|
locate plugin relative to the executable. If that fails, and plugin
|
|
|
|
contains no slashes, tries to locate plugin in a platform-specific way
|
|
|
|
(e.g., LD_LIBRARY_PATH).
|
|
|
|
|
|
|
|
@param baseUrl
|
|
|
|
The base file URL relative to which the plugin argument is interpreted.
|
|
|
|
|
|
|
|
@param plugin
|
2004-11-09 07:01:18 -06:00
|
|
|
The argument is just the name of the plugin or a relative path
|
|
|
|
from the directory of the executable.
|
2004-04-26 09:54:23 -05:00
|
|
|
*/
|
2005-06-17 04:12:55 -05:00
|
|
|
rtl::OUString findPlugin(
|
|
|
|
const rtl::OUString & baseUrl, const rtl::OUString & plugin);
|
2004-11-09 07:01:18 -06:00
|
|
|
//Todo still needed?
|
2004-05-18 06:51:54 -05:00
|
|
|
rtl::OUString searchFileNextToThisLib(const rtl::OUString & sFile);
|
2004-05-17 07:55:32 -05:00
|
|
|
class CNodeJava;
|
|
|
|
|
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
enum FileStatus
|
|
|
|
{
|
|
|
|
FILE_OK,
|
|
|
|
FILE_DOES_NOT_EXIST,
|
|
|
|
FILE_INVALID
|
|
|
|
};
|
2004-04-19 09:57:02 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
/** checks if the URL is a file.
|
2004-07-23 05:55:20 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
If it is a link to a file than
|
|
|
|
it is resolved. Assuming that the argument
|
|
|
|
represents a relative URL then FILE_INVALID
|
|
|
|
is returned.
|
2004-07-23 05:55:20 -05:00
|
|
|
|
2004-04-19 09:57:02 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
@return
|
|
|
|
one of the values of FileStatus.
|
2004-04-19 09:57:02 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
@exception
|
|
|
|
Errors occured during determining if the file exists
|
2004-04-19 09:57:02 -05:00
|
|
|
*/
|
2004-11-09 07:01:18 -06:00
|
|
|
FileStatus checkFileURL(const rtl::OUString & path);
|
2004-04-19 09:57:02 -05:00
|
|
|
|
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
struct PluginLibrary;
|
|
|
|
class VersionInfo;
|
|
|
|
class CJavaInfo;
|
2004-04-19 09:57:02 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
bool isAccessibilitySupportDesired();
|
2004-04-19 09:57:02 -05:00
|
|
|
|
2004-11-09 07:01:18 -06:00
|
|
|
rtl::OUString buildClassPathFromDirectory(const rtl::OUString & relPath);
|
2004-04-19 09:57:02 -05:00
|
|
|
|
|
|
|
rtl::OUString retrieveClassPath( ::rtl::OUString const & macro );
|
|
|
|
}
|
|
|
|
#endif
|