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_EnumerableMap_idl__
21 #define __com_sun_star_container_EnumerableMap_idl__
23 #include
<com
/sun
/star
/beans
/IllegalTypeException.idl
>
24 #include
<com
/sun
/star
/beans
/Pair.idl
>
25 #include
<com
/sun
/star
/container
/XEnumerableMap.idl
>
28 module com
{ module sun
{ module star
{ module container
{
31 /** provides a default XEnumerableMap implementation
33 <p>For the keys put into the map using XMap::put() or createImmutable(),
34 the following rules apply:
35 <a name="keyrules"></a>
36 <ul><li>A `VOID` key is not allowed.</li>
37 <li>If the key type is <code>BOOLEAN</code>, <code>CHAR</code>, <code>FLOAT</code>, <code>DOUBLE</code>,
38 <code>STRING</code>, <code>TYPE</code>, or <code>UNSIGNED HYPER</code>, then only keys of exactly this
39 type are accepted.</li>
40 <li>If the key type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
41 <code>Float.NaN</code> is not accepted as key.</li>
42 <li>If the key type's class is com::sun::star::uno::TypeClass::ENUM, then only keys
43 of exactly this type are accepted.</li>
44 <li>If the key type is any of <code>BYTE</code>, <code>SHORT</code>, <code>UNSIGNED SHORT</code>,
45 <code>LONG</code>, <code>UNSIGNED LONG</code>, or <code>HYPER</code>, then all keys which can losslessly
46 be converted to this type (possibly using widening conversions) are accepted.</li>
47 <li>If the key type is an interface type, then all key values denoting objects which can be queried for
48 the given interface are accepted.</li>
49 <li>All other key types are rejected.</li>
52 <p>For the values put into the map using XMap::put() or createImmutable(),
53 the following rules apply:
54 <a name="valuerules"></a>
55 <ul><li>The `VOID` value will be accepted to be put into the map.</p>
56 <li>If the value type's class is com::sun::star::uno::TypeClass::ANY, any value
57 will be accepted.</li>
58 <li>If the value type is an interface type, then all values denoting objects which can be queried for
59 the given interface are accepted.</li>
60 <li>If the value type's class is com::sun::star::uno::TypeClass::EXCEPTION
61 or com::sun::star::uno::TypeClass::STRUCT, then values whose type equals the
62 value type, or is a sub class of the value type, are accepted.</li>
63 <li>For all other value types, only values whose type matches exactly are accepted.</li>
64 <li>If the value type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
65 <code>Float.NaN</code> is not accepted.</li>
68 <p>The factory methods of the <code>XEnumerableMap</code> interface support both <em>isolated</em>
69 and <em>non-isolated</em> enumerators. The latter one will be automatically disposed when the map changes
70 after enumerator creation, so every attempt to use them will result in a
71 com::sun::star::lang::DisposedException being thrown.</p>
73 @see http://udk.openoffice.org/common/man/typesystem.html
75 service EnumerableMap
: XEnumerableMap
77 /** creates an instance mapping from the given key type to the given value type
80 denotes the type of the keys in the to-be-created map
82 denotes the type of the values in the to-be-created map
84 @throws ::com::sun::star::beans::IllegalTypeException
85 if KeyType or ValueType are unsupported types.
86 For values, all type classes except com::sun::star::uno::TypeClass::VOID
87 and com::sun::star::uno::TypeClass::UNKNOWN are accepted.
88 For keys, scalar types, strings, com::sun::star::uno::Type itself, and interface
91 create
( [in] type KeyType
, [in] type ValueType
)
92 raises
( ::com
::sun
::star
::beans
::IllegalTypeException
);
94 /** creates an instance mapping from the given key type to the given value type
96 <p>The resulting map is immutable, so later alter operations on it will fail
97 with a com::sun::star::lang::NoSupportException.</p>
100 denotes the type of the keys in the to-be-created map
102 denotes the type of the values in the to-be-created map
104 denote the values contained in the to-be-created map
106 @throws ::com::sun::star::beans::IllegalTypeException
107 if KeyType or ValueType are unsupported types.
108 For values, all type classes except com::sun::star::uno::TypeClass::VOID
110 For keys, scalar types, strings, com::sun::star::uno::Type itself, and interface
112 @throws ::com::sun::star::lang::IllegalArgumentException
113 if any of the given values or keys violates the <a href="#keyrules">key rules</a> or
114 <a href="#valuerules">value rules</a>.
119 [in] sequence
< ::com
::sun
::star
::beans
::Pair
< any
, any
> > Values
121 raises
( ::com
::sun
::star
::beans
::IllegalTypeException
,
122 ::com
::sun
::star
::lang
::IllegalArgumentException
);
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */