1408a4873SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3408a4873SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4408a4873SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5408a4873SAndrew Rist * distributed with this work for additional information
6408a4873SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7408a4873SAndrew Rist * to you under the Apache License, Version 2.0 (the
8408a4873SAndrew Rist * "License"); you may not use this file except in compliance
9408a4873SAndrew Rist * with the License.  You may obtain a copy of the License at
10408a4873SAndrew Rist *
11408a4873SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12408a4873SAndrew Rist *
13408a4873SAndrew Rist * Unless required by applicable law or agreed to in writing,
14408a4873SAndrew Rist * software distributed under the License is distributed on an
15408a4873SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16408a4873SAndrew Rist * KIND, either express or implied.  See the License for the
17408a4873SAndrew Rist * specific language governing permissions and limitations
18408a4873SAndrew Rist * under the License.
19408a4873SAndrew Rist *
20408a4873SAndrew Rist *************************************************************/
21408a4873SAndrew Rist
22408a4873SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_uri_XExternalUriReferenceTranslator_idl__
25cdf0e10cSrcweir#define __com_sun_star_uri_XExternalUriReferenceTranslator_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir
29cdf0e10cSrcweirmodule com { module sun { module star { module uri {
30cdf0e10cSrcweir
31cdf0e10cSrcweir/**
32cdf0e10cSrcweir   translates between external and internal URI references.
33cdf0e10cSrcweir
34cdf0e10cSrcweir   <p>Some URI schemes leave unspecified important aspects of how to interpret
35cdf0e10cSrcweir   URIs of those schemes.  For example, it is unspecified for &ldquo;file&rdquo;
36cdf0e10cSrcweir   URLs how to map the byte sequences that constitute the path segments of a
37cdf0e10cSrcweir   &ldquo;file&rdquo; URL to filenames on a given platform:  The UNO environment
38cdf0e10cSrcweir   always assumes that path segments of &ldquo;file&rdquo; URLs represent
39cdf0e10cSrcweir   UTF-8&ndash;encoded strings (which have to be mapped to filenames in a
40cdf0e10cSrcweir   platform-specific way), while other applications typically assume that path
41cdf0e10cSrcweir   segments of &ldquo;file&rdquo; URLs directly represent a platform's
42cdf0e10cSrcweir   byte-sequence filenames.  This interface offers methods to translate between
43cdf0e10cSrcweir   such <dfn>internal</dfn> URIs (e.g., UTF-8&ndash;encoded &ldquo;file&rdquo;
44cdf0e10cSrcweir   URLs used within the UNO environment) and <dfn>external</dfn> URIs (e.g.,
45cdf0e10cSrcweir   byte-sequence&ndash;oriented &ldquo;file&rdquo; URLs used by other
46cdf0e10cSrcweir   applications).  Typically, only &ldquo;file&rdquo; URLs are affected by this
47cdf0e10cSrcweir   translation.</p>
48cdf0e10cSrcweir
49cdf0e10cSrcweir   <p>Since the translation process is based on URI schemes, relative URI
50cdf0e10cSrcweir   references (that do not include a scheme) are left unmodified by the
51cdf0e10cSrcweir   translation process.</p>
52cdf0e10cSrcweir
53*95a17a32SJürgen Schmidt   @since OpenOffice 2.0
54cdf0e10cSrcweir */
55cdf0e10cSrcweirpublished interface XExternalUriReferenceTranslator {
56cdf0e10cSrcweir    /**
57cdf0e10cSrcweir       returns the internal counterpart of an external URI reference.
58cdf0e10cSrcweir
59cdf0e10cSrcweir       @param externalUriReference
60cdf0e10cSrcweir       an external URI reference.
61cdf0e10cSrcweir
62cdf0e10cSrcweir       @returns
63cdf0e10cSrcweir       the internal counterpart of the given external URI reference.  An empty
64cdf0e10cSrcweir       string is returned if the given external URI reference either is an empty
65cdf0e10cSrcweir       string or cannot be converted (for example, because it contains illegal
66cdf0e10cSrcweir       characters).
67cdf0e10cSrcweir     */
68cdf0e10cSrcweir    string translateToInternal([in] string externalUriReference);
69cdf0e10cSrcweir
70cdf0e10cSrcweir    /**
71cdf0e10cSrcweir       returns the external counterpart of an internal URI reference.
72cdf0e10cSrcweir
73cdf0e10cSrcweir       @param internalUriReference
74cdf0e10cSrcweir       an internal URI reference.
75cdf0e10cSrcweir
76cdf0e10cSrcweir       @returns
77cdf0e10cSrcweir       the external counterpart of the given internal URI reference.  An empty
78cdf0e10cSrcweir       string is returned if the given internal URI reference either is an empty
79cdf0e10cSrcweir       string or cannot be converted (for example, because it contains illegal
80cdf0e10cSrcweir       characters).
81cdf0e10cSrcweir     */
82cdf0e10cSrcweir    string translateToExternal([in] string internalUriReference);
83cdf0e10cSrcweir};
84cdf0e10cSrcweir
85cdf0e10cSrcweir}; }; }; };
86cdf0e10cSrcweir
87cdf0e10cSrcweir#endif
88