1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_util_XOfficeInstallationDirectories_idl__
25#define __com_sun_star_util_XOfficeInstallationDirectories_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31module com { module sun { module star { module util {
32
33//============================================================================
34/** encapsulates access to the current office installation directory and
35    office user data directory, provides functionality to create URLs
36    containing relocatable (not absolute) references to the current office
37    installation directory and user data directory and vice versa.
38
39    <p>This functionality is useful when data containing references to the
40    current office installation directory must be made persistent and re-read
41    later. In many cases, storing the reference directly would destroy the
42    relocatability of an office installation.
43
44    @since OpenOffice 2.0
45 */
46published interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface
47{
48    //------------------------------------------------------------------------
49    /** returns the absolute URL containing the directory of the current office
50        installation (e.g. "file:///opt/OpenOffice.org".)
51
52        @returns
53        the absolute URL containing the directory of the current office
54        installation.
55     */
56    string getOfficeInstallationDirectoryURL();
57
58    //------------------------------------------------------------------------
59    /** returns the absolute URL containing the directory where the current
60        office installation expects its user data (e.g.
61        "file:///home/kso/.openoffice.org".)
62
63        @returns
64        the absolute URL containing the directory of the current office
65        user data.
66     */
67    string getOfficeUserDataDirectoryURL();
68
69    //------------------------------------------------------------------------
70    /** calculates a relocatable URL from the given URL.
71
72        <p>If the given URL contains an absolute reference to the current office
73        installation directory or office user data directory, this method will
74        replace the absolute reference by an opaque placeholder string.
75        <code>makeRelocatableURL</code> must be used in order to re-replace the
76        placeholder by an absolute reference.
77
78        @param URL
79        The URL for that a relocatable URL is requested. In case the URL does
80        not contain a reference to the current office installation or to the office
81        user data directory, the input URL will be returned unchanged.
82
83        @returns
84        The relocatable URL.
85     */
86    string makeRelocatableURL( [in] string URL );
87
88    //------------------------------------------------------------------------
89    /** the counterpart of <code>makeRelocatableURL</code>.
90
91        <p>If the given URL contains a placeholder for an absolute reference to
92        the current office installation directory or for the office user data
93        directory, that was created using <code>makeRelocatableURL</code>, the
94        respective placeholder will be replaced by an absolute reference to the
95        current office installation directory or office user data directory.
96
97        @param URL
98        The URL for that an absolaute URL is requested. In case the URL does
99        not contain the opaque relocation placholder used by
100        <code>makeRelocatableURL</code>, the input URL will be returned
101        unchanged.
102
103        @returns
104        The absolute URL.
105     */
106    string makeAbsoluteURL( [in] string URL );
107};
108
109}; }; }; };
110
111#endif
112