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_uri_XExternalUriReferenceTranslator_idl__
25#define __com_sun_star_uri_XExternalUriReferenceTranslator_idl__
26
27#include <com/sun/star/uno/XInterface.idl>
28
29module com { module sun { module star { module uri {
30
31/**
32   translates between external and internal URI references.
33
34   <p>Some URI schemes leave unspecified important aspects of how to interpret
35   URIs of those schemes.  For example, it is unspecified for &ldquo;file&rdquo;
36   URLs how to map the byte sequences that constitute the path segments of a
37   &ldquo;file&rdquo; URL to filenames on a given platform:  The UNO environment
38   always assumes that path segments of &ldquo;file&rdquo; URLs represent
39   UTF-8&ndash;encoded strings (which have to be mapped to filenames in a
40   platform-specific way), while other applications typically assume that path
41   segments of &ldquo;file&rdquo; URLs directly represent a platform's
42   byte-sequence filenames.  This interface offers methods to translate between
43   such <dfn>internal</dfn> URIs (e.g., UTF-8&ndash;encoded &ldquo;file&rdquo;
44   URLs used within the UNO environment) and <dfn>external</dfn> URIs (e.g.,
45   byte-sequence&ndash;oriented &ldquo;file&rdquo; URLs used by other
46   applications).  Typically, only &ldquo;file&rdquo; URLs are affected by this
47   translation.</p>
48
49   <p>Since the translation process is based on URI schemes, relative URI
50   references (that do not include a scheme) are left unmodified by the
51   translation process.</p>
52
53   @since OpenOffice 2.0
54 */
55published interface XExternalUriReferenceTranslator {
56    /**
57       returns the internal counterpart of an external URI reference.
58
59       @param externalUriReference
60       an external URI reference.
61
62       @returns
63       the internal counterpart of the given external URI reference.  An empty
64       string is returned if the given external URI reference either is an empty
65       string or cannot be converted (for example, because it contains illegal
66       characters).
67     */
68    string translateToInternal([in] string externalUriReference);
69
70    /**
71       returns the external counterpart of an internal URI reference.
72
73       @param internalUriReference
74       an internal URI reference.
75
76       @returns
77       the external counterpart of the given internal URI reference.  An empty
78       string is returned if the given internal URI reference either is an empty
79       string or cannot be converted (for example, because it contains illegal
80       characters).
81     */
82    string translateToExternal([in] string internalUriReference);
83};
84
85}; }; }; };
86
87#endif
88