summaryrefslogtreecommitdiff
path: root/udkapi
diff options
context:
space:
mode:
Diffstat (limited to 'udkapi')
-rw-r--r--udkapi/com/sun/star/container/EnumerableMap.idl139
-rw-r--r--udkapi/com/sun/star/container/XEnumerableMap.idl108
-rw-r--r--udkapi/com/sun/star/container/XMap.idl201
-rw-r--r--udkapi/com/sun/star/container/makefile.mk3
4 files changed, 451 insertions, 0 deletions
diff --git a/udkapi/com/sun/star/container/EnumerableMap.idl b/udkapi/com/sun/star/container/EnumerableMap.idl
new file mode 100644
index 000000000..77183a6f7
--- /dev/null
+++ b/udkapi/com/sun/star/container/EnumerableMap.idl
@@ -0,0 +1,139 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* 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
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef __com_sun_star_container_Map_idl__
+#define __com_sun_star_container_Map_idl__
+
+#include <com/sun/star/beans/IllegalTypeException.idl>
+#include <com/sun/star/beans/Pair.idl>
+#include <com/sun/star/container/XEnumerableMap.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module container {
+
+//=============================================================================
+
+/** provides a default <type>XEnumerableMap</type> implementation
+
+ <p>For the keys put into the map using <member>XMap::put</member> or <member>createImmutable</member>,
+ the following rules apply:
+ <a name="keyrules"></a>
+ <ul><li>A <VOID/> key is not allowed.</li>
+ <li>If the key type is <code>BOOLEAN</code>, <code>CHAR</code>, <code>FLOAT</code>, <code>DOUBLE</code>,
+ <code>STRING</code>, <code>TYPE</code>, or <code>UNSIGNED HYPER</code>, then only keys of exactly this
+ type are accepted.</li>
+ <li>If the key type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
+ <code>Float.NaN</code> is not accepted as key.</li>
+ <li>If the key type's class is <member scope="com::sun::star::uno">TypeClass::ENUM</member>, then only keys
+ of exactly this type are accepted.</li>
+ <li>If the key type is any of <code>BYTE</code>, <code>SHORT</code>, <code>UNSIGNED SHORT</code>,
+ <code>LONG</code>, <code>UNSIGNED LONG</code>, or <code>HYPER</code>, then all keys which can losslessly
+ be converted to this type (possibly using widening conversions) are accepted.</li>
+ <li>If the key type is an interface type, then all key values denoting objects which can be queried for
+ the given interface are accepted.</li>
+ <li>All other key types are rejected.</li>
+ </ul></p>
+
+ <p>For the values put into the map using <member>XMap::put</member> or <member>createImmutable</member>,
+ the following rules apply:
+ <a name="valuerules"></a>
+ <ul><li>The <VOID/> value will be accepted to be put into the map.</p>
+ <li>If the value type's class is <member scope="com::sun::star::uno">TypeClass::ANY</member>, any value
+ will be accepted.</li>
+ <li>If the value type is an interface type, then all values denoting objects which can be queried for
+ the given interface are accepted.</li>
+ <li>If the value type's class is <member scope="com::sun::star::uno">TypeClass::EXCEPTION</member>
+ or <member scope="com::sun::star::uno">TypeClass::STRUCT</member>, then values whose type equals the
+ value type, or is a sub class of the value type, are accepted.</li>
+ <li>For all other value types, only values whose type matches exactly are accepted.</li>
+ <li>If the value type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
+ <code>Float.NaN</code> is not accepted.</li>
+ </ul></p>
+
+ <p>The factory methods of the <code>XEnumerableMap</code> interface support both <em>isolated</em>
+ and <em>non-isolated</em> 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
+ <type scope="com::sun::star::lang">DisposedException</type> being thrown.</p>
+
+ @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 <arg>KeyType</arg> or <arg>ValueType</arg> are unsupported types.
+ For values, all type classes except <member scope="com::sun::star::uno">TypeClass::VOID</member>
+ and <member scope="com::sun::star::uno">TypeClass::UNKNOWN</member> are accepted.
+ For keys, scalar types, strings, <type scope="com::sun::star::uno">Type</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
+
+ <p>The resulting map is immutable, so later alter operations on it will fail
+ with a <type scope="com::sun::star::lang">NoSupportException</type>.</p>
+
+ @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 <arg>KeyType</arg> or <arg>ValueType</arg> are unsupported types.
+ For values, all type classes except <member scope="com::sun::star::uno">TypeClass::VOID</member>
+ are accepted.<br/>
+ For keys, scalar types, strings, <type scope="com::sun::star::uno">Type</type> itself, and interface
+ types are accepted.
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if any of the given values or keys violates the <a href="#keyrules">key rules</a> or
+ <a href="#valuerules">value rules</a>.
+ */
+ 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
diff --git a/udkapi/com/sun/star/container/XEnumerableMap.idl b/udkapi/com/sun/star/container/XEnumerableMap.idl
new file mode 100644
index 000000000..23b420df8
--- /dev/null
+++ b/udkapi/com/sun/star/container/XEnumerableMap.idl
@@ -0,0 +1,108 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* 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
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef __com_sun_star_container_XEnumerableMap_idl__
+#define __com_sun_star_container_XEnumerableMap_idl__
+
+#include <com/sun/star/container/XMap.idl>
+#include <com/sun/star/container/XEnumeration.idl>
+#include <com/sun/star/lang/NoSupportException.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module container {
+
+//=============================================================================
+
+/** extends <type>XMap</type> with enumeration capabilities.
+
+ <p>No assumption should be made about the ordering of the elements returned by the various enumerators.
+ In particular, you cannot assume the elements are returned in the same order as they were inserted. Also,
+ you should not expect the <code>XMap</code> implementation to make use of a possibly existing strict ordering
+ defined on the domain of all possible key values.</p>
+
+ <p>You can create enumerators for the keys of the map, its values, and its key-value pairs.</p>
+
+ <p>In all cases, you can create an <em>isolated</em> enumerator, which works on a copy of the
+ map's content. Such an iterator is not affected by changes done to the map after creation of
+ the enumerator.</p>
+
+ <p>On the contrary, an enumerator which is <em>non-isolated</em> works directly on the map data.
+ This is less expensive than an <em>isolated</em> enumerator, but means that changes to the map while
+ an enumeration is running potentially invalidate your enumerator. The concrete behavior in this
+ case is undefined, it's up to the service implementing the <code>XEnumerableMap</code> interface
+ to specify it in more detail.</p>
+
+ <p>Implementations of this interface might decide to support only <em>isolated</em> enumerators, or
+ only <em>non-isolated</em> enumerators. Again, it's up to the service to specify this. Requesting an
+ enumerator type which is not supported will generally result in an <type scope="com::sun::star::lang">NoSupportException</type>
+ being thrown.</p>
+ */
+interface XEnumerableMap : XMap
+{
+ /** creates a enumerator for the keys of the map
+
+ @param Isolated
+ controls whether the newly create enumerator should be isolated from the map.
+
+ @throws ::com::sun::star::lang::NoSupportException
+ if the specified enumerator method is not supported by the implementation.
+ */
+ XEnumeration createKeyEnumeration( [in] boolean Isolated )
+ raises ( ::com::sun::star::lang::NoSupportException );
+
+ /** creates a enumerator for the values of the map
+
+ @param Isolated
+ controls whether the newly create enumerator should be isolated from the map.
+
+ @throws ::com::sun::star::lang::NoSupportException
+ if the specified enumerator method is not supported by the implementation.
+ */
+ XEnumeration createValueEnumeration( [in] boolean Isolated )
+ raises ( ::com::sun::star::lang::NoSupportException );
+
+ /** creates a enumerator for the key-value pairs of the map
+
+ <p>The elements returned by the enumerator are instances of <type scope="com::sun::star::beans">Pair</type>,
+ holding the key-value-pairs which are part of the map.</p>
+
+ @param Isolated
+ controls whether the newly create enumerator should be isolated from the map.
+
+ @throws ::com::sun::star::lang::NoSupportException
+ if the specified enumerator method is not supported by the implementation.
+ */
+ XEnumeration createElementEnumeration( [in] boolean Isolated )
+ raises ( ::com::sun::star::lang::NoSupportException );
+};
+
+//=============================================================================
+
+}; }; }; };
+
+//=============================================================================
+
+#endif
diff --git a/udkapi/com/sun/star/container/XMap.idl b/udkapi/com/sun/star/container/XMap.idl
new file mode 100644
index 000000000..8cb3fa645
--- /dev/null
+++ b/udkapi/com/sun/star/container/XMap.idl
@@ -0,0 +1,201 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* 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
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef __com_sun_star_container_XMap_idl__
+#define __com_sun_star_container_XMap_idl__
+
+#include <com/sun/star/beans/IllegalTypeException.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#include <com/sun/star/container/NoSuchElementException.idl>
+#include <com/sun/star/lang/NoSupportException.idl>
+#include <com/sun/star/container/XElementAccess.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module container {
+
+//=============================================================================
+
+/** describes a map between keys and values.
+
+ <p>Keys in the map are unique, and each key maps to exactly one value.</p>
+
+ <p>Locating elements in the map, both values and keys, requires a notion of equality of two objects.
+ In conformance with the <a href="http://udk.openoffice.org/common/man/typesystem.html">UNO type system</a>,
+ two values are said to be equal if and only if they have the same type, and both denote the same element of this
+ type's value set.</p>
+
+ @see <type>Map</type> for a default implementation of this interface
+*/
+interface XMap
+{
+ interface XElementAccess;
+
+ /** denotes the type of the keys in the map.
+
+ <p>Implementations are free to accept any supertype of <code>KeyType</code> as keys.</p>
+ */
+ [attribute, readonly] type KeyType;
+
+ /** denotes the type of the values in the map.
+
+ <p>Implementations are free to accept any supertype of the <code>ValueType</code> as values.</p>
+ */
+ [attribute, readonly] type ValueType;
+
+ /** clears the map, removing all key-value pairs from it.
+
+ @throws ::com::sun::star::beans::NoSupportException
+ if the map is not mutable.
+ */
+ void clear()
+ raises( ::com::sun::star::lang::NoSupportException );
+
+ /** determines whether a mapping for he given key exists in the map
+
+ @param Key
+ is the key whose presence in the map is to be tested.
+ @return
+ <TRUE/> if and only if the map contains a mapping for the given key.
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the given key is not of a type which is accepted by the map
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given key is not supported to be put into the map. It's up to the service
+ implementing the <code>XMap</code> interface to specify which special values are not
+ supported. For instances, implementations might decide to not allow <VOID/> keys, or
+ to reject <code>Double.NaN</code> (<em>not a number</em>) to due its problematic
+ behavior with respect to equality.
+ */
+ boolean containsKey( [in] any Key )
+ raises( ::com::sun::star::beans::IllegalTypeException,
+ ::com::sun::star::lang::IllegalArgumentException );
+
+ /** determines whether the map contains a mapping to a given value.
+
+ @param Value
+ is the value whose presence in the map is to be tested.
+ @return
+ <TRUE/> if and only one or more keys map to the given value.
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the given value is not of a type which is accepted by the map. It's up to the service
+ implementing the <code>XMap</code> interface to specify which special values are not
+ supported. For instances, implementations might decide to not allow <code>Double.NaN</code>
+ (<em>not a number</em>) to due its problematic behavior with respect to equality.
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given value is not supported to be put into the map.
+ */
+ boolean containsValue( [in] any Value )
+ raises( ::com::sun::star::beans::IllegalTypeException,
+ ::com::sun::star::lang::IllegalArgumentException );
+
+ /** gets the value to which a given key maps.
+
+ @param Key
+ they key whose associated value is to be returned.
+ @return
+ the value which is associated with the given key.
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the given key is not of a type which is accepted by the map
+ @throws ::com::sun::star::beans::IllegalArgumentException
+ if the given key is not supported to be put into the map. It's up to the service
+ implementing the <code>XMap</code> interface to specify which special values are not
+ supported. For instances, implementations might decide to not allow <VOID/> keys, or
+ to reject <code>Double.NaN</code> (<em>not a number</em>) to due its problematic
+ behavior with respect to equality.
+ @throws ::com::sun::star::container::NoSuchElementException
+ if there is no value associated with the given key
+ */
+ any get( [in] any Key )
+ raises( ::com::sun::star::beans::IllegalTypeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException );
+
+ /** associates a given key with a given value
+
+ <p>If the map already contains a mapping for the given key, then the old value is replaced by the
+ given new value.</p>
+
+ @param Key
+ is the key which the given value should be associated with
+ @param Value
+ is the value which should be associated with the given key
+ @return
+ the value which was previously associated with the given key, or <VOID/>
+ if there was no such previous association.
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the given key is not of a type which is accepted by the map
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given key, or the given value, is not supported to be put into the map. It's up to
+ the service implementing the <code>XMap</code> interface to specify which special values
+ are not supported.<br/>
+ For instances, implementations might decide to not allow <VOID/> keys or values, or to
+ reject <code>Double.NaN</code> (<em>not a number</em>) to due its problematic behavior
+ with respect to equality.
+ @throws ::com::sun::star::beans::NoSupportException
+ if the map does not support putting new mappings into it
+ */
+ any put( [in] any Key, [in] any Value )
+ raises( ::com::sun::star::lang::NoSupportException,
+ ::com::sun::star::beans::IllegalTypeException,
+ ::com::sun::star::lang::IllegalArgumentException );
+
+ /** removes a key-value mapping, given by key, from the map.
+
+ @param Key
+ is the key whose mapping should be removed from the map
+ @return
+ the value which was associated with the given key before the removal
+
+ @throws ::com::sun::star::beans::IllegalTypeException
+ if the given key is not of a type which is accepted by the map
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given key is not supported to be put into the map. It's up to the service
+ implementing the <code>XMap</code> interface to specify which special values are not
+ supported. For instances, implementations might decide to not allow <VOID/> keys, or
+ to reject <code>Double.NaN</code> (<em>not a number</em>) to due its problematic
+ behavior with respect to equality.
+ @throws ::com::sun::star::beans::NoSupportException
+ if the map does not support removing mappings
+ @throws ::com::sun::star::container::NoSuchElementException
+ if there is no value associated with the given key
+ */
+ any remove( [in] any Key )
+ raises( ::com::sun::star::lang::NoSupportException,
+ ::com::sun::star::beans::IllegalTypeException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException );
+};
+
+//=============================================================================
+
+}; }; }; };
+
+//=============================================================================
+
+#endif
diff --git a/udkapi/com/sun/star/container/makefile.mk b/udkapi/com/sun/star/container/makefile.mk
index f78f33856..07b43627a 100644
--- a/udkapi/com/sun/star/container/makefile.mk
+++ b/udkapi/com/sun/star/container/makefile.mk
@@ -47,6 +47,7 @@ IDLFILES=\
XIdentifierContainer.idl\
ContainerEvent.idl\
ElementExistException.idl\
+ EnumerableMap.idl\
NoSuchElementException.idl\
XChild.idl\
XUniqueIDAccess.idl\
@@ -59,6 +60,7 @@ IDLFILES=\
XContainerQuery.idl\
XContentEnumerationAccess.idl\
XElementAccess.idl\
+ XEnumerableMap.idl\
XEnumeration.idl\
XEnumerationAccess.idl\
XHierarchicalName.idl\
@@ -71,6 +73,7 @@ IDLFILES=\
XIndexAccess.idl\
XIndexContainer.idl\
XIndexReplace.idl\
+ XMap.idl\
XNameAccess.idl\
XNameContainer.idl\
XNamed.idl\