1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_container_XStringKeyMap_idl__
25#define __com_sun_star_container_XStringKeyMap_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
32#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
33#endif
34
35#ifndef __com_sun_star_container_ElementExistException_idl__
36#include <com/sun/star/container/ElementExistException.idl>
37#endif
38
39#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
40#include <com/sun/star/lang/IllegalArgumentException.idl>
41#endif
42
43#ifndef __com_sun_star_container_NoSuchElementException_idl__
44#include <com/sun/star/container/NoSuchElementException.idl>
45#endif
46
47//=============================================================================
48
49module com {  module sun {  module star {  module container {
50
51//=============================================================================
52
53/** maps strings to anys.
54
55    @since OOo 2.3
56 */
57
58interface XStringKeyMap
59{
60    //-------------------------------------------------------------------------
61    /** reads data from the map.
62
63        @param aKey
64                The key string which should be searched for.
65
66        @return
67                the value matching aKey.
68
69        @throws com::sun::star::container::NoSuchElementException
70                if an element under aKey does not exist.
71     */
72    any getValue( [in] string aKey )
73        raises( com::sun::star::container::NoSuchElementException );
74
75
76    //-------------------------------------------------------------------------
77    /** checks for element existence.
78
79        @param aKey
80                The key string which should be searched for.
81
82        @return
83                true if an element with key aKey exists.
84     */
85    boolean hasValue( [in] string aKey );
86
87
88    //-------------------------------------------------------------------------
89    /** writes data to the map.
90
91        @param aKey
92                The key string which should be used to store the value.
93
94        @param aValue
95                The value that should be stored.
96
97        @throws com::sun::star::lang::IllegalArgumentException
98                if the element could not be inserted.
99
100        @throws com::sun::star::container::ElementExistException
101                if there is already a value stored under the key aKey.
102     */
103    void insertValue( [in] string aKey, [in] any aValue )
104        raises( com::sun::star::lang::IllegalArgumentException,
105                com::sun::star::container::ElementExistException );
106
107
108    //-------------------------------------------------------------------------
109    /** the number of elements in the map.
110     */
111    [attribute, readonly] long Count;
112
113
114    //-------------------------------------------------------------------------
115    /** obtains the key of an element by index.
116
117        @param nIndex
118                is the index of the element.
119
120        @return
121                the key string matching the given index.
122
123        @throws com::sun::star::lang::IndexOutOfBoundsException
124                if the specified index is greater than the number of
125                elements
126     */
127    string getKeyByIndex( [in] long nIndex )
128        raises( com::sun::star::lang::IndexOutOfBoundsException );
129
130
131    //-------------------------------------------------------------------------
132    /** obtains the value of an element by index.
133
134        @param nIndex
135                is the index of the key.
136
137        @return
138                the value matching the given index.
139
140        @throws com::sun::star::lang::IndexOutOfBoundsException
141                if the specified index is greater than the number of
142                elements
143     */
144    any getValueByIndex( [in] long nIndex )
145        raises( com::sun::star::lang::IndexOutOfBoundsException );
146};
147
148}; }; }; };
149
150#endif
151