/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
*
* for a copy of the LGPLv3 License.
*
***********************************************************************/
#ifndef __com_sun_star_container_Map_idl__
#define __com_sun_star_container_Map_idl__
#include
#include
#include
//=============================================================================
module com { module sun { module star { module container {
//=============================================================================
/** provides a default XEnumerableMap implementation
For the keys put into the map using XMap::put or createImmutable,
the following rules apply:
- A key is not allowed.
- If the key type is
BOOLEAN, CHAR, FLOAT, DOUBLE,
STRING, TYPE, or UNSIGNED HYPER, then only keys of exactly this
type are accepted.
- If the key type is
DOUBLE or FLOAT, then Double.NaN respectively
Float.NaN is not accepted as key.
- If the key type's class is TypeClass::ENUM, then only keys
of exactly this type are accepted.
- If the key type is any of
BYTE, SHORT, UNSIGNED SHORT,
LONG, UNSIGNED LONG, or HYPER, then all keys which can losslessly
be converted to this type (possibly using widening conversions) are accepted.
- If the key type is an interface type, then all key values denoting objects which can be queried for
the given interface are accepted.
- All other key types are rejected.
For the values put into the map using XMap::put or createImmutable,
the following rules apply:
- The value will be accepted to be put into the map.
- If the value type's class is TypeClass::ANY, any value
will be accepted.
- If the value type is an interface type, then all values denoting objects which can be queried for
the given interface are accepted.
- If the value type's class is TypeClass::EXCEPTION
or TypeClass::STRUCT, then values whose type equals the
value type, or is a sub class of the value type, are accepted.
- For all other value types, only values whose type matches exactly are accepted.
- If the value type is
DOUBLE or FLOAT, then Double.NaN respectively
Float.NaN is not accepted.
The factory methods of the XEnumerableMap interface support both isolated
and non-isolated enumerators. The latter one will be automatically disposed when the map changes
after enumerator creation, so every attempt to use them will result in a
DisposedException being thrown.
@see http://udk.openoffice.org/common/man/typesystem.html
*/
service EnumerableMap : XEnumerableMap
{
/** creates an instance mapping from the given key type to the given value type
@param KeyType
denotes the type of the keys in the to-be-created map
@param ValueType
denotes the type of the values in the to-be-created map
@throws ::com::sun::star::beans::IllegalTypeException
if KeyType or ValueType are unsupported types.
For values, all type classes except TypeClass::VOID
and TypeClass::UNKNOWN are accepted.
For keys, scalar types, strings, Type itself, and interface
types are accepted.
*/
create( [in] type KeyType, [in] type ValueType )
raises( ::com::sun::star::beans::IllegalTypeException );
/** creates an instance mapping from the given key type to the given value type
The resulting map is immutable, so later alter operations on it will fail
with a NoSupportException.
@param KeyType
denotes the type of the keys in the to-be-created map
@param ValueType
denotes the type of the values in the to-be-created map
@param Values
denote the values contained in the to-be-created map
@throws ::com::sun::star::beans::IllegalTypeException
if KeyType or ValueType are unsupported types.
For values, all type classes except TypeClass::VOID
are accepted.
For keys, scalar types, strings, Type itself, and interface
types are accepted.
@throws ::com::sun::star::lang::IllegalArgumentException
if any of the given values or keys violates the key rules or
value rules.
*/
createImmutable(
[in] type KeyType,
[in] type ValueType,
[in] sequence< ::com::sun::star::beans::Pair< any, any > > Values
)
raises( ::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException );
};
//=============================================================================
}; }; }; };
//=============================================================================
#endif