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 __com_sun_star_uri_XUriReference_idl__
21 #define __com_sun_star_uri_XUriReference_idl__
23 #include
<com
/sun
/star
/uno
/XInterface.idl
>
25 module com
{ module sun
{ module star
{ module uri
{
28 represents generic, mutable URI references.
30 <p>See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a> for a
31 description of URI references and related terms.</p>
33 <p>This interface only handles generic URI references (both absolute and
34 relative). For specific URI schemes, there will be additional interfaces
35 that offer extra, scheme-specific functionality.</p>
37 @see com::sun::star::uri::UriReferenceFactory
38 which allows to create URI reference objects that support
39 com::sun::star::uri::XUriReference and additional,
40 scheme-specific interfaces.
44 published
interface XUriReference
: com
::sun
::star
::uno
::XInterface
{
46 returns the textual representation of the complete URI reference.
49 the textual representation of the complete URI reference. The exact
50 spelling of the URI reference is retained.
52 string getUriReference
();
55 returns whether this URI reference is absolute or relative.
58 `TRUE` if this URI reference is absolute, `FALSE` if it is relative.
63 returns the scheme part of this (absolute) URI reference.
66 the textual representation of the scheme part (with the exact spelling
67 retained; without the delimiting “<code>:</code>”), if this
68 is an absolute URI reference; otherwise, an empty `string` is
74 returns the scheme-specific part of this URI reference.
76 <p>For an absolute URI reference, the scheme-specific part is everything
77 after the scheme part and the delimiting “<code>:</code>”,
78 and before the optional “<code>#</code>” and fragment part.
79 For a relative URI reference, the scheme-specific part is everything
80 before the optional “<code>#</code>” and fragment part.</p>
83 the textual representation of the scheme-specific part (with the exact
86 string getSchemeSpecificPart
();
89 returns whether this URI reference is hierarchical or opaque.
91 <p>An absolute URI reference is hierarchical if its scheme-specific part
92 starts with “<code>/</code>”. A relative URI reference is
93 always hierarchical.</p>
96 `TRUE` if this URI reference is hierarchical, `FALSE` if it is opaque.
98 boolean isHierarchical
();
101 returns whether this (hierarchical) URI reference has an authority part.
104 `TRUE` if this URI reference is hierarchical and has an authority part.
106 boolean hasAuthority
();
109 returns the authority part of this (hierarchical) URI reference.
112 the textual representation of the authority part (with the exact spelling
113 retained), if this is a hierarchical URI reference that has an authority
114 part; otherwise, an empty `string` is returned.
116 string getAuthority
();
119 returns the path part of this URI reference.
122 the textual representation of the path part (with the exact spelling
123 retained), if this is a hierarchical URI reference; for an opaque URI
124 reference, the scheme-specific part (with the exact spelling retained) is
130 returns whether this (relative) URI reference has a relative path.
133 `TRUE` if this URI reference is relative and has a relative path.
135 boolean hasRelativePath
();
138 returns the number of path segments of this (hierarchical) URI reference.
140 <p>For an opaque URI reference, and for a hierarchical URI reference with
141 an empty path, the number of path segments is zero. For a hierarchical
142 URI reference with an absolute, non-empty path, the number of path
143 segments equals the number of “<code>/</code>” delimiters.
144 For a hierarchical URI reference with a relative, non-empty path, the
145 number of path segments equals the number of “<code>/</code>”
146 delimiters, plus one.</p>
149 the number of path segments.
151 long getPathSegmentCount
();
154 returns a given path segment of this (hierarchical) URI reference.
157 the index of the path segment, starting at zero.
160 the textual representation of the given path segment (with the exact
161 spelling retained, without any delimiting “<code>/</code>”),
162 if this URI reference is hierarchical and has that many path segments;
163 otherwise, and in particular if <code>index</code> is negative, an empty
164 `string` is returned.
166 string getPathSegment
([in] long index
);
169 returns whether this (hierarchical) URI reference has a query part.
172 `TRUE` if this URI reference is hierarchical and has a query part.
177 returns the query part of this (hierarchical) URI reference.
180 the textual representation of the query part (with the exact spelling
181 retained; without the delimiting “<code>?</code>”), if this
182 is a hierarchical URI reference that has a query part; otherwise, an
183 empty `string` is returned.
188 returns whether this URI reference has a fragment part.
191 `TRUE` if this URI reference has a fragment part.
193 boolean hasFragment
();
196 returns the fragment part of this URI reference.
199 the textual representation of the fragment part (with the exact spelling
200 retained; without the delimiting “<code>#</code>”), if this
201 is a URI reference that has a fragment part; otherwise, an empty
202 `string` is returned.
204 string getFragment
();
207 sets the fragment part of this URI reference.
210 the textual representation of the new fragment part. The exact spelling
211 will be preserved, and no escaping is performed.
213 void setFragment
([in] string fragment
);
216 clears the fragment part of this URI reference.
218 void clearFragment
();
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */