1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_uri_XVndSunStarScriptUrl_idl__
29#define __com_sun_star_uri_XVndSunStarScriptUrl_idl__
30
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#include <com/sun/star/uno/XInterface.idl>
33
34module com { module sun { module star { module uri {
35
36/**
37   represents absolute &ldquo;vnd.sun.star.script&rdquo; URLs.
38
39   <p>These URLs are of the form<br/>
40   &emsp;<var>vnd-sun-star-script-url</var> =
41   <code>"VND.SUN.STAR.SCRIPT:"</code> <var>name</var> [<code>"?"</code>
42   <var>parameter</var> *(<code>"&"</code> <var>parameter</var>)]<br/>
43   &emsp;<var>name</var> = 1*<var>schar</var><br/>
44   &emsp;<var>parameter</var> = <var>key</var> <code>"="</code>
45   <var>value</var><br/>
46   &emsp;<var>key</var> = 1*<var>schar</var><br/>
47   &emsp;<var>value</var> = *<var>schar</var><br/>
48   &emsp;<var>schar</var> = <var>unreserved</var> / <var>escaped</var> /
49   <code>"$"</code> / <code>"+"</code> / <code>","</code> / <code>":"</code> /
50   <code>";"</code> / <code>"@"</code> / <code>"["</code> /
51   <code>"]"</code><br/>
52   See <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC&nbsp;2396</a>,
53   <a href="http://www.ietf.org/rfc/rfc2732.txt">RFC&nbsp;2732</a>, and
54   <a href="http://www.ietf.org/rfc/rfc2234.txt">RFC&nbsp;2234</a> for
55   details.</p>
56
57   <p>The names, keys, and values are arbitrary Unicode strings (non-empty
58   Unicode strings in the case of names and keys), encoded as UTF-8 byte
59   sequences.  It is an error if any of them does not represent a valid UTF-8
60   byte sequence.  Keys are compared for equality character-by-character,
61   without considering case folding or normalization.  There may be multiple
62   parameters with equal keys.</p>
63
64   @since OOo 2.0
65 */
66published interface XVndSunStarScriptUrl: com::sun::star::uno::XInterface {
67    /**
68       returns the name part of this URL.
69
70       @returns
71       the non-escaped value of the name part.
72     */
73    string getName();
74
75    /**
76        sets the name part of this URL.
77
78        @param name
79        specifies the non-escaped new name part of the URL.
80
81        @throws ::com::sun::star::lang::IllegalArgumentException
82        if <arg>name</arg> is empty
83
84        @since OOo 3.0
85    */
86    void   setName([in] string name)
87        raises ( ::com::sun::star::lang::IllegalArgumentException );
88
89    /**
90       returns whether this URL has a parameter with a given key.
91
92       @param key
93       a non-escaped key.
94
95       @returns
96       <TRUE/> if this URL has at least one parameter with the given key.  In
97       particular, if <code>key</code> is an empty <atom>string</atom>, <FALSE/>
98       is returned.
99     */
100    boolean hasParameter([in] string key);
101
102    /**
103       returns the value of a parameter with a given key.
104
105       @param key
106       a non-escaped key.
107
108       @returns
109       the non-escaped value of the first parameter with the given key.  If
110       there is no parameter with the given key, or if <code>key</code> is an
111       empty <atom>string</atom>, an empty <atom>string</atom> is returned.
112     */
113    string getParameter([in] string key);
114
115    /**
116        sets the value of a parameter with a given key.
117
118        @param key
119        a non-escaped key
120
121        @param value
122        the non-escaped value to be set for the parameter. If there already is a
123        parameter with this key, the value of its first appearance will be replaced.
124        Otherwise, a parameter with the given key/value will be appended.
125
126        @throws ::com::sun::star::lang::IllegalArgumentException
127        if <arg>key</arg> is empty
128
129        @since OOo 3.0
130    */
131    void setParameter( [in] string key, [in] string value )
132        raises ( ::com::sun::star::lang::IllegalArgumentException );
133};
134
135}; }; }; };
136
137#endif
138