1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
21 #define _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/uno/RuntimeException.hpp>
25 #include <sal/types.h>
26 #include "ucbhelper/ucbhelperdllapi.h"
28 namespace com
{ namespace sun
{ namespace star
{ namespace ucb
{
29 class XUniversalContentBroker
;
34 //============================================================================
35 /** Get a 'root' URL for the most 'local' file content provider.
38 The result can be used as the rBaseURL parameter of
39 ucb::getFileURLFromSystemPath().
42 either a 'root' URL for the most 'local' file content provider, or an
43 empty string, if no such URL can meaningfully be constructed.
45 UCBHELPER_DLLPUBLIC OUString
getLocalFileURL()
46 SAL_THROW((com::sun::star::uno::RuntimeException
));
48 //============================================================================
49 /** Using a specific content provider manager, convert a file path in system
50 dependent notation to a (file) URL.
53 A content provider manager. Must not be null.
56 See the corresponding parameter of
57 com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
60 See the corresponding parameter of
61 com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
64 a URL, if the content provider registered at the content provider manager
65 that is responsible for the base URL returns a URL when calling
66 com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath()
67 on it. Otherwise, an empty string is returned.
70 com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath().
72 UCBHELPER_DLLPUBLIC OUString
73 getFileURLFromSystemPath(
74 com::sun::star::uno::Reference
<
75 com::sun::star::ucb::XUniversalContentBroker
> const &
77 OUString
const & rBaseURL
,
78 OUString
const & rSystemPath
)
79 SAL_THROW((com::sun::star::uno::RuntimeException
));
81 //============================================================================
82 /** Using a specific content provider manager, convert a (file) URL to a
83 file path in system dependent notation.
86 A content provider manager. Must not be null.
89 See the corresponding parameter of
90 com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
93 a system path, if the content provider registered at the content provider
94 manager that is responsible for the base URL returns a system path when
96 com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL()
97 on it. Otherwise, an empty string is returned.
100 com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
102 UCBHELPER_DLLPUBLIC OUString
103 getSystemPathFromFileURL(
104 com::sun::star::uno::Reference
<
105 com::sun::star::ucb::XUniversalContentBroker
> const &
107 OUString
const & rURL
)
108 SAL_THROW((com::sun::star::uno::RuntimeException
));
112 #endif // _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */