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