1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef __com_sun_star_uri_XUriReference_idl__
29 #define __com_sun_star_uri_XUriReference_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
33 module com
{ module sun
{ module star
{ module uri
{
36 represents generic, mutable URI references.
38 <p>See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a> for a
39 description of URI references and related terms.</p>
41 <p>This interface only handles generic URI references (both absolute and
42 relative). For specific URI schemes, there will be additional interfaces
43 that offer extra, scheme-specific functionality.</p>
45 @see com::sun::star::uri::UriReferenceFactory
46 which allows to create URI reference objects that support
47 <type scope="com::sun::star::uri">XUriReference</type> and additional,
48 scheme-specific interfaces.
52 published
interface XUriReference
: com
::sun
::star
::uno
::XInterface
{
54 returns the textual representation of the complete URI reference.
57 the textual representation of the complete URI reference. The exact
58 spelling of the URI reference is retained.
60 string getUriReference
();
63 returns whether this URI reference is absolute or relative.
66 <TRUE/> if this URI reference is absolute, <FALSE/> if it is relative.
71 returns the scheme part of this (absolute) URI reference.
74 the textual representation of the scheme part (with the exact spelling
75 retained; without the delimiting “<code>:</code>”), if this
76 is an absolute URI reference; otherwise, an empty <atom>string</atom> is
82 returns the scheme-specific part of this URI reference.
84 <p>For an absolute URI reference, the scheme-specific part is everything
85 after the scheme part and the delimiting “<code>:</code>”,
86 and before the optional “<code>#</code>” and fragment part.
87 For a relative URI reference, the scheme-specific part is everything
88 before the optional “<code>#</code>” and fragment part.</p>
91 the textual representation of the scheme-specific part (with the exact
94 string getSchemeSpecificPart
();
97 returns whether this URI reference is hierarchical or opaque.
99 <p>An absolute URI reference is hierarchical if its scheme-specific part
100 starts with “<code>/</code>”. A relative URI reference is
101 always hierarchical.</p>
104 <TRUE/> if this URI reference is hierarchical, <FALSE/> if it is opaque.
106 boolean isHierarchical
();
109 returns whether this (hierarchical) URI reference has an authority part.
112 <TRUE/> if this URI reference is hierarchical and has an authority part.
114 boolean hasAuthority
();
117 returns the authority part of this (hierarchical) URI reference.
120 the textual representation of the authority part (with the exact spelling
121 retained), if this is a hierarchical URI reference that has an authority
122 part; otherwise, an empty <atom>string</atom> is returned.
124 string getAuthority
();
127 returns the path part of this URI reference.
130 the textual representation of the path part (with the exact spelling
131 retained), if this is a hierarchical URI reference; for an opaque URI
132 reference, the scheme-specific part (with the exact spelling retained) is
138 returns whether this (relative) URI reference has a relative path.
141 <TRUE/> if this URI reference is relative and has a relative path.
143 boolean hasRelativePath
();
146 returns the number of path segments of this (hierarchical) URI reference.
148 <p>For an opaque URI reference, and for a hierarchical URI reference with
149 an empty path, the number of path segments is zero. For a hierarchical
150 URI reference with an absolute, non-empty path, the number of path
151 segments equals the number of “<code>/</code>” delimiters.
152 For a hierarchical URI reference with a relative, non-empty path, the
153 number of path segments equals the number of “<code>/</code>”
154 delimiters, plus one.</p>
157 the number of path segments.
159 long getPathSegmentCount
();
162 returns a given path segment of this (hierarchical) URI reference.
165 the index of the path segment, starting at zero.
168 the textual representation of the given path segment (with the exact
169 spelling retained, without any delimiting “<code>/</code>”),
170 if this URI reference is hierarchical and has that many path segments;
171 otherwise, and in particular if <code>index</code> is negative, an empty
172 <atom>string</atom> is returned.
174 string getPathSegment
([in] long index
);
177 returns whether this (hierarchical) URI reference has a query part.
180 <TRUE/> if this URI reference is hierarchical and has a query part.
185 returns the query part of this (hierarchical) URI reference.
188 the textual representation of the query part (with the exact spelling
189 retained; without the delimiting “<code>?</code>”), if this
190 is a hierarchical URI reference that has a query part; otherwise, an
191 empty <atom>string</atom> is returned.
196 returns whether this URI reference has a fragment part.
199 <TRUE/> if this URI reference has a fragment part.
201 boolean hasFragment
();
204 returns the fragment part of this URI reference.
207 the textual representation of the fragment part (with the exact spelling
208 retained; without the delimiting “<code>#</code>”), if this
209 is a URI reference that has a fragment part; otherwise, an empty
210 <atom>string</atom> is returned.
212 string getFragment
();
215 sets the fragment part of this URI reference.
218 the textual representation of the new fragment part. The exact spelling
219 will be preserved, and no escaping is performed.
221 void setFragment
([in] string fragment
);
224 clears the fragment part of this URI reference.
226 void clearFragment
();