summaryrefslogtreecommitdiffstats
path: root/udkapi/com/sun/star/uri/XUriReference.idl
blob: ba42f283f8c61942bbc8f65806d11f4bac8b5887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef __com_sun_star_uri_XUriReference_idl__
#define __com_sun_star_uri_XUriReference_idl__

#include <com/sun/star/uno/XInterface.idl>

module com { module sun { module star { module uri {

/**
   represents generic, mutable URI references.

   <p>See <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC&nbsp;3986</a> for a
   description of URI references and related terms.</p>

   <p>This interface only handles generic URI references (both absolute and
   relative).  For specific URI schemes, there will be additional interfaces
   that offer extra, scheme-specific functionality.</p>

   @see com::sun::star::uri::UriReferenceFactory
   which allows to create URI reference objects that support
   com::sun::star::uri::XUriReference and additional,
   scheme-specific interfaces.

   @since OOo 2.0
 */
published interface XUriReference: com::sun::star::uno::XInterface {
    /**
       returns the textual representation of the complete URI reference.

       @returns
       the textual representation of the complete URI reference.  The exact
       spelling of the URI reference is retained.
     */
    string getUriReference();

    /**
       returns whether this URI reference is absolute or relative.

       <p>A URI is absolute if it has a scheme.</p>

       @returns
       `TRUE` if this URI reference is absolute, `FALSE` if it is relative.
     */
    boolean isAbsolute();

    /**
       returns the scheme part of this (absolute) URI reference.

       @returns
       the textual representation of the scheme part (with the exact spelling
       retained; without the delimiting &ldquo;<code>:</code>&rdquo;), if this
       is an absolute URI reference; otherwise, an empty `string` is
       returned.
     */
    string getScheme();

    /**
       returns the scheme-specific part of this URI reference.

       <p>For an absolute URI reference, the scheme-specific part is everything
       after the scheme part and the delimiting &ldquo;<code>:</code>&rdquo;,
       and before the optional &ldquo;<code>#</code>&rdquo; and fragment part.
       For a relative URI reference, the scheme-specific part is everything
       before the optional &ldquo;<code>#</code>&rdquo; and fragment part.</p>

       @returns
       the textual representation of the scheme-specific part (with the exact
       spelling retained).
     */
    string getSchemeSpecificPart();

    /**
       returns whether this URI reference is hierarchical or opaque, in the sense of RFC&nbsp2396.

       <p>An absolute URI reference is hierarchical if its scheme-specific part
       starts with &ldquo;<code>/</code>&rdquo;.  A relative URI reference is
       always hierarchical.</p>

       @returns
       `TRUE` if this URI reference is hierarchical, `FALSE` if it is opaque.

       @deprecated RFC&nbsp;3986 no longer differentiates between hierarchical and opaque URIs.
     */
    boolean isHierarchical();

    /**
       returns whether this URI reference has an authority part.

       @returns
       `TRUE` if this URI reference has an authority part.
     */
    boolean hasAuthority();

    /**
       returns the authority part of this URI reference.

       @returns
       the textual representation of the authority part (with the exact spelling
       retained), if this is a URI reference that has an authority
       part; otherwise, an empty `string` is returned.
     */
    string getAuthority();

    /**
       returns the path part of this URI reference.

       @returns
       the textual representation of the path part (with the exact spelling
       retained).
     */
    string getPath();

    /**
       returns whether this URI reference has a relative path.

       @returns
       `TRUE` if this URI reference has a relative path.
     */
    boolean hasRelativePath();

    /**
       returns the number of path segments of this URI reference.

       <p>For a URI reference with
       an empty path, the number of path segments is zero.  For a
       URI reference with an absolute, non-empty path, the number of path
       segments equals the number of &ldquo;<code>/</code>&rdquo; delimiters.
       For a URI reference with a relative, non-empty path, the
       number of path segments equals the number of &ldquo;<code>/</code>&rdquo;
       delimiters, plus one.</p>

       @returns
       the number of path segments.
     */
    long getPathSegmentCount();

    /**
       returns a given path segment of this URI reference.

       @param index
       the index of the path segment, starting at zero.

       @returns
       the textual representation of the given path segment (with the exact
       spelling retained, without any delimiting &ldquo;<code>/</code>&rdquo;),
       if this URI reference has that many path segments;
       otherwise, and in particular if <code>index</code> is negative, an empty
       `string` is returned.
     */
    string getPathSegment([in] long index);

    /**
       returns whether this URI reference has a query part.

       @returns
       `TRUE` if this URI reference has a query part.
     */
    boolean hasQuery();

    /**
       returns the query part of this URI reference.

       @returns
       the textual representation of the query part (with the exact spelling
       retained; without the delimiting &ldquo;<code>?</code>&rdquo;), if this
       is a URI reference that has a query part; otherwise, an
       empty `string` is returned.
     */
    string getQuery();

    /**
       returns whether this URI reference has a fragment part.

       @returns
       `TRUE` if this URI reference has a fragment part.
     */
    boolean hasFragment();

    /**
       returns the fragment part of this URI reference.

       @returns
       the textual representation of the fragment part (with the exact spelling
       retained; without the delimiting &ldquo;<code>#</code>&rdquo;), if this
       is a URI reference that has a fragment part; otherwise, an empty
       `string` is returned.
     */
    string getFragment();

    /**
       sets the fragment part of this URI reference.

       @param fragment
       the textual representation of the new fragment part.  The exact spelling
       will be preserved, and no escaping is performed.
     */
    void setFragment([in] string fragment);

    /**
       clears the fragment part of this URI reference.
     */
    void clearFragment();
};

}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */