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