1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_uri_XExternalUriReferenceTranslator_idl__
29#define __com_sun_star_uri_XExternalUriReferenceTranslator_idl__
30
31#include <com/sun/star/uno/XInterface.idl>
32
33module com { module sun { module star { module uri {
34
35/**
36   translates between external and internal URI references.
37
38   <p>Some URI schemes leave unspecified important aspects of how to interpret
39   URIs of those schemes.  For example, it is unspecified for &ldquo;file&rdquo;
40   URLs how to map the byte sequences that constitute the path segments of a
41   &ldquo;file&rdquo; URL to filenames on a given platform:  The UNO environment
42   always assumes that path segments of &ldquo;file&rdquo; URLs represent
43   UTF-8&ndash;encoded strings (which have to be mapped to filenames in a
44   platform-specific way), while other applications typically assume that path
45   segments of &ldquo;file&rdquo; URLs directly represent a platform's
46   byte-sequence filenames.  This interface offers methods to translate between
47   such <dfn>internal</dfn> URIs (e.g., UTF-8&ndash;encoded &ldquo;file&rdquo;
48   URLs used within the UNO environment) and <dfn>external</dfn> URIs (e.g.,
49   byte-sequence&ndash;oriented &ldquo;file&rdquo; URLs used by other
50   applications).  Typically, only &ldquo;file&rdquo; URLs are affected by this
51   translation.</p>
52
53   <p>Since the translation process is based on URI schemes, relative URI
54   references (that do not include a scheme) are left unmodified by the
55   translation process.</p>
56
57   @since OOo 2.0
58 */
59published interface XExternalUriReferenceTranslator {
60    /**
61       returns the internal counterpart of an external URI reference.
62
63       @param externalUriReference
64       an external URI reference.
65
66       @returns
67       the internal counterpart of the given external URI reference.  An empty
68       string is returned if the given external URI reference either is an empty
69       string or cannot be converted (for example, because it contains illegal
70       characters).
71     */
72    string translateToInternal([in] string externalUriReference);
73
74    /**
75       returns the external counterpart of an internal URI reference.
76
77       @param internalUriReference
78       an internal URI reference.
79
80       @returns
81       the external counterpart of the given internal URI reference.  An empty
82       string is returned if the given internal URI reference either is an empty
83       string or cannot be converted (for example, because it contains illegal
84       characters).
85     */
86    string translateToExternal([in] string internalUriReference);
87};
88
89}; }; }; };
90
91#endif
92