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 20#ifndef __com_sun_star_util_XOfficeInstallationDirectories_idl__ 21#define __com_sun_star_util_XOfficeInstallationDirectories_idl__ 22 23#include <com/sun/star/uno/XInterface.idl> 24 25module com { module sun { module star { module util { 26 27/** encapsulates access to the current office installation directory and 28 office user data directory, provides functionality to create URLs 29 containing relocatable (not absolute) references to the current office 30 installation directory and user data directory and vice versa. 31 32 <p>This functionality is useful when data containing references to the 33 current office installation directory must be made persistent and re-read 34 later. In many cases, storing the reference directly would destroy the 35 relocatability of an office installation. 36 37 @since OOo 2.0 38 */ 39published interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface 40{ 41 /** returns the absolute URL containing the directory of the current office 42 installation (for example "file:///opt/LibreOffice") 43 44 @returns 45 the absolute URL containing the directory of the current office 46 installation. 47 */ 48 string getOfficeInstallationDirectoryURL(); 49 50 /** returns the absolute URL containing the directory where the current 51 office installation expects its user data (for example 52 "file:///home/kso/.config/libreoffice/4") 53 54 @returns 55 the absolute URL containing the directory of the current office 56 user data. 57 */ 58 string getOfficeUserDataDirectoryURL(); 59 60 /** calculates a relocatable URL from the given URL. 61 62 <p>If the given URL contains an absolute reference to the current office 63 installation directory or office user data directory, this method will 64 replace the absolute reference by an opaque placeholder string. 65 <code>makeRelocatableURL</code> must be used in order to re-replace the 66 placeholder by an absolute reference. 67 68 @param URL 69 The URL for that a relocatable URL is requested. In case the URL does 70 not contain a reference to the current office installation or to the office 71 user data directory, the input URL will be returned unchanged. 72 73 @returns 74 The relocatable URL. 75 */ 76 string makeRelocatableURL( [in] string URL ); 77 78 /** the counterpart of <code>makeRelocatableURL</code>. 79 80 <p>If the given URL contains a placeholder for an absolute reference to 81 the current office installation directory or for the office user data 82 directory, that was created using <code>makeRelocatableURL</code>, the 83 respective placeholder will be replaced by an absolute reference to the 84 current office installation directory or office user data directory. 85 86 @param URL 87 The URL for that an absolute URL is requested. In case the URL does 88 not contain the opaque relocation placeholder used by 89 <code>makeRelocatableURL</code>, the input URL will be returned 90 unchanged. 91 92 @returns 93 The absolute URL. 94 */ 95 string makeAbsoluteURL( [in] string URL ); 96}; 97 98}; }; }; }; 99 100#endif 101 102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 103