Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
20 : #define INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
21 :
22 : #include "rtl/ustring.hxx"
23 : #include "libxmlutil.hxx"
24 :
25 : namespace jfw
26 : {
27 :
28 154 : class VendorSettings
29 : {
30 : OUString m_xmlDocVendorSettingsFileUrl;
31 : CXmlDocPtr m_xmlDocVendorSettings;
32 : CXPathContextPtr m_xmlPathContextVendorSettings;
33 :
34 : public:
35 : VendorSettings();
36 :
37 : VersionInfo getVersionInformation(const OUString & sVendor);
38 :
39 : ::std::vector< OUString> getSupportedVendors();
40 : };
41 :
42 : /* The class offers functions to retrieve verified bootstrap parameters.
43 : */
44 : namespace BootParams
45 : {
46 :
47 : /* Gets the file URL to the JRE which has been determined by the
48 : bootstrap parameter UNO_JAVA_JFW_JREHOME or UNO_JAVA_JFW_ENV_JREHOME.
49 :
50 : In direct mode either of them must be set. If not an exception is thrown.
51 : */
52 : OUString getJREHome();
53 :
54 : ::std::vector< OString> getVMParameters();
55 :
56 : OUString getUserData();
57 :
58 : OUString getSharedData();
59 :
60 : /* returns the file URL to the vendor settings xml file.
61 : */
62 : OUString getVendorSettings();
63 :
64 : /* User the parameter UNO_JAVA_JFW_CLASSPATH and UNO_JAVA_JFW_ENV_CLASSPATH
65 : to compose a classpath
66 : */
67 : OString getClasspath();
68 :
69 : OUString getClasspathUrls();
70 :
71 : } //end namespace
72 :
73 :
74 :
75 : enum JFW_MODE
76 : {
77 : JFW_MODE_APPLICATION,
78 :
79 : JFW_MODE_DIRECT
80 : };
81 :
82 : JFW_MODE getMode();
83 :
84 : /** creates the -Djava.class.path option with the complete classpath, including
85 : the paths which are set by UNO_JAVA_JFW_CLASSPATH_URLS.
86 : */
87 : OString makeClassPathOption(OUString const & sUserClassPath);
88 :
89 : OString getSettingsPath( const OUString & sURL);
90 :
91 : /** Get the system path to the javasettings.xml
92 : Converts the URL returned from getUserSettingsURL to a
93 : Systempath. An empty string is returned if the file
94 : does not exist.
95 : @throws FrameworkException
96 : */
97 : OString getUserSettingsPath();
98 :
99 : /** Returns the system path of the share settings file.
100 : Returns a valid string or throws an exception.
101 : @throws FrameworkException
102 : */
103 : OString getSharedSettingsPath();
104 :
105 : /* returns a valid string or throws an exception.
106 : @throws FrameworkException
107 : */
108 : OString getVendorSettingsPath();
109 :
110 : /** Called from writeJavaInfoData. It sets the process identifier. When
111 : java is to be started, then the current id is compared to the one set by
112 : this function. If they are identical then the Java was selected in the
113 : same process. If that Java needs a prepared environment, such as a
114 : LD_LIBRARY_PATH, then it must not be started in this process.
115 : */
116 : void setJavaSelected();
117 :
118 : /** Determines if the currently selected Java was set in this process.
119 :
120 : @see setProcessId()
121 : */
122 : bool wasJavaSelectedInSameProcess();
123 : /* Only for application mode.
124 : */
125 : OUString getApplicationClassPath();
126 : }
127 :
128 : #endif
129 :
130 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|