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_container_XStringKeyMap_idl__
21 #define __com_sun_star_container_XStringKeyMap_idl__
23 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
25 #include
<com
/sun
/star
/container
/ElementExistException.idl
>
26 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
27 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
30 module com
{ module sun
{ module star
{ module container
{
33 /** maps strings to anys.
38 interface XStringKeyMap
40 /** reads data from the map.
43 The key string which should be searched for.
46 the value matching aKey.
48 @throws com::sun::star::container::NoSuchElementException
49 if an element under aKey does not exist.
51 any getValue
( [in] string aKey
)
52 raises
( com
::sun
::star
::container
::NoSuchElementException
);
55 /** checks for element existence.
58 The key string which should be searched for.
61 true if an element with key aKey exists.
63 boolean hasValue
( [in] string aKey
);
66 /** writes data to the map.
69 The key string which should be used to store the value.
72 The value that should be stored.
74 @throws com::sun::star::lang::IllegalArgumentException
75 if the element could not be inserted.
77 @throws com::sun::star::container::ElementExistException
78 if there is already a value stored under the key aKey.
80 void insertValue
( [in] string aKey
, [in] any aValue
)
81 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
82 com
::sun
::star
::container
::ElementExistException
);
85 /** the number of elements in the map.
87 [attribute
, readonly] long Count
;
90 /** obtains the key of an element by index.
93 is the index of the element.
96 the key string matching the given index.
98 @throws com::sun::star::lang::IndexOutOfBoundsException
99 if the specified index is greater than the number of
102 string getKeyByIndex
( [in] long nIndex
)
103 raises
( com
::sun
::star
::lang
::IndexOutOfBoundsException
);
106 /** obtains the value of an element by index.
109 is the index of the key.
112 the value matching the given index.
114 @throws com::sun::star::lang::IndexOutOfBoundsException
115 if the specified index is greater than the number of
118 any getValueByIndex
( [in] long nIndex
)
119 raises
( com
::sun
::star
::lang
::IndexOutOfBoundsException
);
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */