1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_uri_XUriReference_idl__
25*b1cdbd2cSJim Jagielski#define __com_sun_star_uri_XUriReference_idl__
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski#include <com/sun/star/uno/XInterface.idl>
28*b1cdbd2cSJim Jagielski
29*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module uri {
30*b1cdbd2cSJim Jagielski
31*b1cdbd2cSJim Jagielski/**
32*b1cdbd2cSJim Jagielski   represents generic, mutable URI references.
33*b1cdbd2cSJim Jagielski
34*b1cdbd2cSJim Jagielski   <p>See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC&nbsp;2396</a> for a
35*b1cdbd2cSJim Jagielski   description of URI references and related terms.</p>
36*b1cdbd2cSJim Jagielski
37*b1cdbd2cSJim Jagielski   <p>This interface only handles generic URI references (both absolute and
38*b1cdbd2cSJim Jagielski   relative).  For specific URI schemes, there will be additional interfaces
39*b1cdbd2cSJim Jagielski   that offer extra, scheme-specific functionality.</p>
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski   @see com::sun::star::uri::UriReferenceFactory
42*b1cdbd2cSJim Jagielski   which allows to create URI reference objects that support
43*b1cdbd2cSJim Jagielski   <type scope="com::sun::star::uri">XUriReference</type> and additional,
44*b1cdbd2cSJim Jagielski   scheme-specific interfaces.
45*b1cdbd2cSJim Jagielski
46*b1cdbd2cSJim Jagielski   @since OpenOffice 2.0
47*b1cdbd2cSJim Jagielski */
48*b1cdbd2cSJim Jagielskipublished interface XUriReference: com::sun::star::uno::XInterface {
49*b1cdbd2cSJim Jagielski    /**
50*b1cdbd2cSJim Jagielski       returns the textual representation of the complete URI reference.
51*b1cdbd2cSJim Jagielski
52*b1cdbd2cSJim Jagielski       @returns
53*b1cdbd2cSJim Jagielski       the textual representation of the complete URI reference.  The exact
54*b1cdbd2cSJim Jagielski       spelling of the URI reference is retained.
55*b1cdbd2cSJim Jagielski     */
56*b1cdbd2cSJim Jagielski    string getUriReference();
57*b1cdbd2cSJim Jagielski
58*b1cdbd2cSJim Jagielski    /**
59*b1cdbd2cSJim Jagielski       returns whether this URI reference is absolute or relative.
60*b1cdbd2cSJim Jagielski
61*b1cdbd2cSJim Jagielski       @returns
62*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference is absolute, <FALSE/> if it is relative.
63*b1cdbd2cSJim Jagielski     */
64*b1cdbd2cSJim Jagielski    boolean isAbsolute();
65*b1cdbd2cSJim Jagielski
66*b1cdbd2cSJim Jagielski    /**
67*b1cdbd2cSJim Jagielski       returns the scheme part of this (absolute) URI reference.
68*b1cdbd2cSJim Jagielski
69*b1cdbd2cSJim Jagielski       @returns
70*b1cdbd2cSJim Jagielski       the textual representation of the scheme part (with the exact spelling
71*b1cdbd2cSJim Jagielski       retained; without the delimiting &ldquo;<code>:</code>&rdquo;), if this
72*b1cdbd2cSJim Jagielski       is an absolute URI reference; otherwise, an empty <atom>string</atom> is
73*b1cdbd2cSJim Jagielski       returned.
74*b1cdbd2cSJim Jagielski     */
75*b1cdbd2cSJim Jagielski    string getScheme();
76*b1cdbd2cSJim Jagielski
77*b1cdbd2cSJim Jagielski    /**
78*b1cdbd2cSJim Jagielski       returns the scheme-specific part of this URI reference.
79*b1cdbd2cSJim Jagielski
80*b1cdbd2cSJim Jagielski       <p>For an absolute URI reference, the scheme-specific part is everything
81*b1cdbd2cSJim Jagielski       after the scheme part and the delimiting &ldquo;<code>:</code>&rdquo;,
82*b1cdbd2cSJim Jagielski       and before the optional &ldquo;<code>#</code>&rdquo; and fragment part.
83*b1cdbd2cSJim Jagielski       For a relative URI reference, the scheme-specific part is everything
84*b1cdbd2cSJim Jagielski       before the optional &ldquo;<code>#</code>&rdquo; and fragment part.</p>
85*b1cdbd2cSJim Jagielski
86*b1cdbd2cSJim Jagielski       @returns
87*b1cdbd2cSJim Jagielski       the textual representation of the scheme-specific part (with the exact
88*b1cdbd2cSJim Jagielski       spelling retained).
89*b1cdbd2cSJim Jagielski     */
90*b1cdbd2cSJim Jagielski    string getSchemeSpecificPart();
91*b1cdbd2cSJim Jagielski
92*b1cdbd2cSJim Jagielski    /**
93*b1cdbd2cSJim Jagielski       returns whether this URI reference is hierarchical or opaque.
94*b1cdbd2cSJim Jagielski
95*b1cdbd2cSJim Jagielski       <p>An absolute URI reference is hierarchical if its scheme-specific part
96*b1cdbd2cSJim Jagielski       starts with &ldquo;<code>/</code>&rdquo;.  A relative URI reference is
97*b1cdbd2cSJim Jagielski       always hierarchical.</p>
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski       @returns
100*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference is hierarchical, <FALSE/> if it is opaque.
101*b1cdbd2cSJim Jagielski     */
102*b1cdbd2cSJim Jagielski    boolean isHierarchical();
103*b1cdbd2cSJim Jagielski
104*b1cdbd2cSJim Jagielski    /**
105*b1cdbd2cSJim Jagielski       returns whether this (hierarchical) URI reference has an authority part.
106*b1cdbd2cSJim Jagielski
107*b1cdbd2cSJim Jagielski       @returns
108*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference is hierarchical and has an authority part.
109*b1cdbd2cSJim Jagielski     */
110*b1cdbd2cSJim Jagielski    boolean hasAuthority();
111*b1cdbd2cSJim Jagielski
112*b1cdbd2cSJim Jagielski    /**
113*b1cdbd2cSJim Jagielski       returns the authority part of this (hierarchical) URI reference.
114*b1cdbd2cSJim Jagielski
115*b1cdbd2cSJim Jagielski       @returns
116*b1cdbd2cSJim Jagielski       the textual representation of the authority part (with the exact spelling
117*b1cdbd2cSJim Jagielski       retained), if this is a hierarchical URI reference that has an authority
118*b1cdbd2cSJim Jagielski       part; otherwise, an empty <atom>string</atom> is returned.
119*b1cdbd2cSJim Jagielski     */
120*b1cdbd2cSJim Jagielski    string getAuthority();
121*b1cdbd2cSJim Jagielski
122*b1cdbd2cSJim Jagielski    /**
123*b1cdbd2cSJim Jagielski       returns the path part of this URI reference.
124*b1cdbd2cSJim Jagielski
125*b1cdbd2cSJim Jagielski       @returns
126*b1cdbd2cSJim Jagielski       the textual representation of the path part (with the exact spelling
127*b1cdbd2cSJim Jagielski       retained), if this is a hierarchical URI reference; for an opaque URI
128*b1cdbd2cSJim Jagielski       reference, the scheme-specific part (with the exact spelling retained) is
129*b1cdbd2cSJim Jagielski       returned.
130*b1cdbd2cSJim Jagielski     */
131*b1cdbd2cSJim Jagielski    string getPath();
132*b1cdbd2cSJim Jagielski
133*b1cdbd2cSJim Jagielski    /**
134*b1cdbd2cSJim Jagielski       returns whether this (relative) URI reference has a relative path.
135*b1cdbd2cSJim Jagielski
136*b1cdbd2cSJim Jagielski       @returns
137*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference is relative and has a relative path.
138*b1cdbd2cSJim Jagielski     */
139*b1cdbd2cSJim Jagielski    boolean hasRelativePath();
140*b1cdbd2cSJim Jagielski
141*b1cdbd2cSJim Jagielski    /**
142*b1cdbd2cSJim Jagielski       returns the number of path segments of this (hierarchical) URI reference.
143*b1cdbd2cSJim Jagielski
144*b1cdbd2cSJim Jagielski       <p>For an opaque URI reference, and for a hierarchical URI reference with
145*b1cdbd2cSJim Jagielski       an empty path, the number of path segments is zero.  For a hierarchical
146*b1cdbd2cSJim Jagielski       URI reference with an absolute, non-empty path, the number of path
147*b1cdbd2cSJim Jagielski       segments equals the number of &ldquo;<code>/</code>&rdquo; delimiters.
148*b1cdbd2cSJim Jagielski       For a hierarchical URI reference with a relative, non-empty path, the
149*b1cdbd2cSJim Jagielski       number of path segments equals the number of &ldquo;<code>/</code>&rdquo;
150*b1cdbd2cSJim Jagielski       delimiters, plus one.</p>
151*b1cdbd2cSJim Jagielski
152*b1cdbd2cSJim Jagielski       @returns
153*b1cdbd2cSJim Jagielski       the number of path segments.
154*b1cdbd2cSJim Jagielski     */
155*b1cdbd2cSJim Jagielski    long getPathSegmentCount();
156*b1cdbd2cSJim Jagielski
157*b1cdbd2cSJim Jagielski    /**
158*b1cdbd2cSJim Jagielski       returns a given path segment of this (hierarchical) URI reference.
159*b1cdbd2cSJim Jagielski
160*b1cdbd2cSJim Jagielski       @param index
161*b1cdbd2cSJim Jagielski       the index of the path segment, starting at zero.
162*b1cdbd2cSJim Jagielski
163*b1cdbd2cSJim Jagielski       @returns
164*b1cdbd2cSJim Jagielski       the textual representation of the given path segment (with the exact
165*b1cdbd2cSJim Jagielski       spelling retained, without any delimiting &ldquo;<code>/</code>&rdquo;),
166*b1cdbd2cSJim Jagielski       if this URI reference is hierarchical and has that many path segments;
167*b1cdbd2cSJim Jagielski       otherwise, and in particular if <code>index</code> is negative, an empty
168*b1cdbd2cSJim Jagielski       <atom>string</atom> is returned.
169*b1cdbd2cSJim Jagielski     */
170*b1cdbd2cSJim Jagielski    string getPathSegment([in] long index);
171*b1cdbd2cSJim Jagielski
172*b1cdbd2cSJim Jagielski    /**
173*b1cdbd2cSJim Jagielski       returns whether this (hierarchical) URI reference has a query part.
174*b1cdbd2cSJim Jagielski
175*b1cdbd2cSJim Jagielski       @returns
176*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference is hierarchical and has a query part.
177*b1cdbd2cSJim Jagielski     */
178*b1cdbd2cSJim Jagielski    boolean hasQuery();
179*b1cdbd2cSJim Jagielski
180*b1cdbd2cSJim Jagielski    /**
181*b1cdbd2cSJim Jagielski       returns the query part of this (hierarchical) URI reference.
182*b1cdbd2cSJim Jagielski
183*b1cdbd2cSJim Jagielski       @returns
184*b1cdbd2cSJim Jagielski       the textual representation of the query part (with the exact spelling
185*b1cdbd2cSJim Jagielski       retained; without the delimiting &ldquo;<code>?</code>&rdquo;), if this
186*b1cdbd2cSJim Jagielski       is a hierarchical URI reference that has a query part; otherwise, an
187*b1cdbd2cSJim Jagielski       empty <atom>string</atom> is returned.
188*b1cdbd2cSJim Jagielski     */
189*b1cdbd2cSJim Jagielski    string getQuery();
190*b1cdbd2cSJim Jagielski
191*b1cdbd2cSJim Jagielski    /**
192*b1cdbd2cSJim Jagielski       returns whether this URI reference has a fragment part.
193*b1cdbd2cSJim Jagielski
194*b1cdbd2cSJim Jagielski       @returns
195*b1cdbd2cSJim Jagielski       <TRUE/> if this URI reference has a fragment part.
196*b1cdbd2cSJim Jagielski     */
197*b1cdbd2cSJim Jagielski    boolean hasFragment();
198*b1cdbd2cSJim Jagielski
199*b1cdbd2cSJim Jagielski    /**
200*b1cdbd2cSJim Jagielski       returns the fragment part of this URI reference.
201*b1cdbd2cSJim Jagielski
202*b1cdbd2cSJim Jagielski       @returns
203*b1cdbd2cSJim Jagielski       the textual representation of the fragment part (with the exact spelling
204*b1cdbd2cSJim Jagielski       retained; without the delimiting &ldquo;<code>#</code>&rdquo;), if this
205*b1cdbd2cSJim Jagielski       is a URI reference that has a fragment part; otherwise, an empty
206*b1cdbd2cSJim Jagielski       <atom>string</atom> is returned.
207*b1cdbd2cSJim Jagielski     */
208*b1cdbd2cSJim Jagielski    string getFragment();
209*b1cdbd2cSJim Jagielski
210*b1cdbd2cSJim Jagielski    /**
211*b1cdbd2cSJim Jagielski       sets the fragment part of this URI reference.
212*b1cdbd2cSJim Jagielski
213*b1cdbd2cSJim Jagielski       @param fragment
214*b1cdbd2cSJim Jagielski       the textual representation of the new fragment part.  The exact spelling
215*b1cdbd2cSJim Jagielski       will be preserved, and no escaping is performed.
216*b1cdbd2cSJim Jagielski     */
217*b1cdbd2cSJim Jagielski    void setFragment([in] string fragment);
218*b1cdbd2cSJim Jagielski
219*b1cdbd2cSJim Jagielski    /**
220*b1cdbd2cSJim Jagielski       clears the fragment part of this URI reference.
221*b1cdbd2cSJim Jagielski     */
222*b1cdbd2cSJim Jagielski    void clearFragment();
223*b1cdbd2cSJim Jagielski};
224*b1cdbd2cSJim Jagielski
225*b1cdbd2cSJim Jagielski}; }; }; };
226*b1cdbd2cSJim Jagielski
227*b1cdbd2cSJim Jagielski#endif
228