fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / jvmfwk / source / fwkutil.hxx
blob6168d35c40b780fbb7cb6816c6a8d155ff0b8317
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_FWKUTIL_HXX
20 #define INCLUDED_JVMFWK_SOURCE_FWKUTIL_HXX
22 #include <config_features.h>
23 #include <config_folders.h>
25 #include "sal/config.h"
26 #include "osl/mutex.hxx"
27 #include "rtl/bootstrap.hxx"
28 #include "rtl/instance.hxx"
29 #include "rtl/ustrbuf.hxx"
30 #include "rtl/byteseq.hxx"
31 #include "osl/thread.hxx"
32 #if OSL_DEBUG_LEVEL >=2
33 #include <stdio.h>
34 #endif
37 namespace jfw
40 /** Returns the file URL of the directory where the framework library
41 (this library) resides.
43 OUString getLibraryLocation();
45 /** provides a bootstrap class which already knows the values from the
46 jvmfkwrc file.
48 struct Bootstrap :
49 public ::rtl::StaticWithInit< const rtl::Bootstrap *, Bootstrap > {
50 const rtl::Bootstrap * operator () () {
51 OUStringBuffer buf(256);
52 buf.append(getLibraryLocation());
53 #ifdef MACOSX
54 // For some reason the jvmfwk3rc file is traditionally in
55 // LIBO_URE_ETC_FOLDER
56 buf.appendAscii( "/../" LIBO_URE_ETC_FOLDER );
57 #endif
58 buf.appendAscii(SAL_CONFIGFILE("/jvmfwk3"));
59 OUString sIni = buf.makeStringAndClear();
60 ::rtl::Bootstrap * bootstrap = new ::rtl::Bootstrap(sIni);
61 #if OSL_DEBUG_LEVEL >=2
62 OString o = OUStringToOString( sIni , osl_getThreadTextEncoding() );
63 fprintf(stderr, "[Java framework] Using configuration file %s\n" , o.getStr() );
64 #endif
65 return bootstrap;
69 struct FwkMutex: public ::rtl::Static<osl::Mutex, FwkMutex> {};
71 rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData);
72 rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data);
74 OUString getPlatform();
77 OUString getDirFromFile(const OUString& usFilePath);
79 enum FileStatus
81 FILE_OK,
82 FILE_DOES_NOT_EXIST,
83 FILE_INVALID
86 /** checks if the URL is a file.
88 If it is a link to a file than
89 it is resolved. Assuming that the argument
90 represents a relative URL then FILE_INVALID
91 is returned.
94 @return
95 one of the values of FileStatus.
97 @exception
98 Errors occurred during determining if the file exists
100 FileStatus checkFileURL(const OUString & path);
102 bool isAccessibilitySupportDesired();
104 OUString retrieveClassPath( OUString const & macro );
106 #endif
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */