summaryrefslogtreecommitdiff
path: root/toolkit/inc/toolkit/controls
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2001-02-21 16:24:14 +0000
committerAndreas Bregas <ab@openoffice.org>2001-02-21 16:24:14 +0000
commitbf7ac85f586198441fb92e61d446b9866747e134 (patch)
tree72333008055b6b47e90b9948d258a3e9d46e1763 /toolkit/inc/toolkit/controls
parent00e5f2add5944a0c7483e3e214e09834afcdb115 (diff)
Container for event descriptions
Diffstat (limited to 'toolkit/inc/toolkit/controls')
-rw-r--r--toolkit/inc/toolkit/controls/eventcontainer.hxx165
1 files changed, 165 insertions, 0 deletions
diff --git a/toolkit/inc/toolkit/controls/eventcontainer.hxx b/toolkit/inc/toolkit/controls/eventcontainer.hxx
new file mode 100644
index 000000000000..91b54473d4e4
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/eventcontainer.hxx
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: eventcontainer.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: ab $ $Date: 2001-02-21 17:24:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _COM_SUN_STAR_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XCONTAINER_HPP_
+#include <com/sun/star/container/XContainer.hpp>
+#endif
+
+
+#include <cppuhelper/implbase1.hxx>
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XNameContainer > NameContainerHelper;
+
+
+//namespace toolkit
+//{
+
+// Hashtable to optimize
+struct hashName_Impl
+{
+ size_t operator()(const ::rtl::OUString Str) const
+ {
+ return (size_t)Str.hashCode();
+ }
+};
+
+struct eqName_Impl
+{
+ sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const
+ {
+ return ( Str1 == Str2 );
+ }
+};
+
+typedef std::hash_map
+<
+ ::rtl::OUString,
+ sal_Int32,
+ hashName_Impl,
+ eqName_Impl
+>
+NameContainerNameMap;
+
+
+class NameContainer_Impl : public NameContainerHelper
+{
+ //OInterfaceContainerHelper maListenerContainer;
+ NameContainerNameMap mHashMap;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > mNames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > mValues;
+ sal_Int32 mnElementCount;
+ ::com::sun::star::uno::Type mType;
+
+
+public:
+ NameContainer_Impl( ::com::sun::star::uno::Type aType )
+ : mType( aType )
+ , mnElementCount( 0 )
+ //, maListenerContainer( *Mutex::getGlobalMutex() )
+ {}
+
+ // Methods XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ throw(::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameReplace
+ virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ throw(::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // Methods XNameContainer
+ virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ throw(::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::ElementExistException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ throw(::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+};
+
+class ScriptEventContainer : public NameContainer_Impl
+{
+public:
+ ScriptEventContainer( void );
+};
+
+
+//} // namespace toolkit_namecontainer
+