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_container_XEnumerableMap_idl__ 25*b1cdbd2cSJim Jagielski#define __com_sun_star_container_XEnumerableMap_idl__ 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski#include <com/sun/star/container/XMap.idl> 28*b1cdbd2cSJim Jagielski#include <com/sun/star/container/XEnumeration.idl> 29*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/NoSupportException.idl> 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski//============================================================================= 32*b1cdbd2cSJim Jagielski 33*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module container { 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski//============================================================================= 36*b1cdbd2cSJim Jagielski 37*b1cdbd2cSJim Jagielski/** extends <type>XMap</type> with enumeration capabilities. 38*b1cdbd2cSJim Jagielski 39*b1cdbd2cSJim Jagielski <p>No assumption should be made about the ordering of the elements returned by the various enumerators. 40*b1cdbd2cSJim Jagielski In particular, you cannot assume the elements are returned in the same order as they were inserted. Also, 41*b1cdbd2cSJim Jagielski you should not expect the <code>XMap</code> implementation to make use of a possibly existing strict ordering 42*b1cdbd2cSJim Jagielski defined on the domain of all possible key values.</p> 43*b1cdbd2cSJim Jagielski 44*b1cdbd2cSJim Jagielski <p>You can create enumerators for the keys of the map, its values, and its key-value pairs.</p> 45*b1cdbd2cSJim Jagielski 46*b1cdbd2cSJim Jagielski <p>In all cases, you can create an <em>isolated</em> enumerator, which works on a copy of the 47*b1cdbd2cSJim Jagielski map's content. Such an iterator is not affected by changes done to the map after creation of 48*b1cdbd2cSJim Jagielski the enumerator.</p> 49*b1cdbd2cSJim Jagielski 50*b1cdbd2cSJim Jagielski <p>On the contrary, an enumerator which is <em>non-isolated</em> works directly on the map data. 51*b1cdbd2cSJim Jagielski This is less expensive than an <em>isolated</em> enumerator, but means that changes to the map while 52*b1cdbd2cSJim Jagielski an enumeration is running potentially invalidate your enumerator. The concrete behavior in this 53*b1cdbd2cSJim Jagielski case is undefined, it's up to the service implementing the <code>XEnumerableMap</code> interface 54*b1cdbd2cSJim Jagielski to specify it in more detail.</p> 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski <p>Implementations of this interface might decide to support only <em>isolated</em> enumerators, or 57*b1cdbd2cSJim Jagielski only <em>non-isolated</em> enumerators. Again, it's up to the service to specify this. Requesting an 58*b1cdbd2cSJim Jagielski enumerator type which is not supported will generally result in an <type scope="com::sun::star::lang">NoSupportException</type> 59*b1cdbd2cSJim Jagielski being thrown.</p> 60*b1cdbd2cSJim Jagielski */ 61*b1cdbd2cSJim Jagielskiinterface XEnumerableMap : XMap 62*b1cdbd2cSJim Jagielski{ 63*b1cdbd2cSJim Jagielski /** creates a enumerator for the keys of the map 64*b1cdbd2cSJim Jagielski 65*b1cdbd2cSJim Jagielski @param Isolated 66*b1cdbd2cSJim Jagielski controls whether the newly create enumerator should be isolated from the map. 67*b1cdbd2cSJim Jagielski 68*b1cdbd2cSJim Jagielski @throws ::com::sun::star::lang::NoSupportException 69*b1cdbd2cSJim Jagielski if the specified enumerator method is not supported by the implementation. 70*b1cdbd2cSJim Jagielski */ 71*b1cdbd2cSJim Jagielski XEnumeration createKeyEnumeration( [in] boolean Isolated ) 72*b1cdbd2cSJim Jagielski raises ( ::com::sun::star::lang::NoSupportException ); 73*b1cdbd2cSJim Jagielski 74*b1cdbd2cSJim Jagielski /** creates a enumerator for the values of the map 75*b1cdbd2cSJim Jagielski 76*b1cdbd2cSJim Jagielski @param Isolated 77*b1cdbd2cSJim Jagielski controls whether the newly create enumerator should be isolated from the map. 78*b1cdbd2cSJim Jagielski 79*b1cdbd2cSJim Jagielski @throws ::com::sun::star::lang::NoSupportException 80*b1cdbd2cSJim Jagielski if the specified enumerator method is not supported by the implementation. 81*b1cdbd2cSJim Jagielski */ 82*b1cdbd2cSJim Jagielski XEnumeration createValueEnumeration( [in] boolean Isolated ) 83*b1cdbd2cSJim Jagielski raises ( ::com::sun::star::lang::NoSupportException ); 84*b1cdbd2cSJim Jagielski 85*b1cdbd2cSJim Jagielski /** creates a enumerator for the key-value pairs of the map 86*b1cdbd2cSJim Jagielski 87*b1cdbd2cSJim Jagielski <p>The elements returned by the enumerator are instances of <type scope="com::sun::star::beans">Pair</type>, 88*b1cdbd2cSJim Jagielski holding the key-value-pairs which are part of the map.</p> 89*b1cdbd2cSJim Jagielski 90*b1cdbd2cSJim Jagielski @param Isolated 91*b1cdbd2cSJim Jagielski controls whether the newly create enumerator should be isolated from the map. 92*b1cdbd2cSJim Jagielski 93*b1cdbd2cSJim Jagielski @throws ::com::sun::star::lang::NoSupportException 94*b1cdbd2cSJim Jagielski if the specified enumerator method is not supported by the implementation. 95*b1cdbd2cSJim Jagielski */ 96*b1cdbd2cSJim Jagielski XEnumeration createElementEnumeration( [in] boolean Isolated ) 97*b1cdbd2cSJim Jagielski raises ( ::com::sun::star::lang::NoSupportException ); 98*b1cdbd2cSJim Jagielski}; 99*b1cdbd2cSJim Jagielski 100*b1cdbd2cSJim Jagielski//============================================================================= 101*b1cdbd2cSJim Jagielski 102*b1cdbd2cSJim Jagielski}; }; }; }; 103*b1cdbd2cSJim Jagielski 104*b1cdbd2cSJim Jagielski//============================================================================= 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski#endif 107