summaryrefslogtreecommitdiff
path: root/accessibility/source/extended
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-06-27 14:34:31 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-06-27 14:34:31 +0000
commit72a56a298adcb4522ff55d5dfb8bd03ae6d06296 (patch)
treefd5a413c7a717318bdff9db21ff49cfa0e2af281 /accessibility/source/extended
parent9cab2502d597bbb42744da8b8731d50e003262d6 (diff)
INTEGRATION: CWS a11ysep (1.1.2); FILE ADDED
2007/02/28 07:26:19 fs 1.1.2.3: #i10000# 2005/09/28 11:36:45 fs 1.1.2.2: manual resync (files have been moved herein from another location): licence change 2005/03/07 08:29:22 fs 1.1.2.1: #i44293# moved implementations herein from svtools module
Diffstat (limited to 'accessibility/source/extended')
-rw-r--r--accessibility/source/extended/listboxaccessible.cxx116
1 files changed, 116 insertions, 0 deletions
diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx
new file mode 100644
index 000000000000..fd4f4ab76314
--- /dev/null
+++ b/accessibility/source/extended/listboxaccessible.cxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: listboxaccessible.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2007-06-27 15:34:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_accessibility.hxx"
+
+#ifndef ACCESSIBILITY_EXT_LISTBOX_ACCESSIBLE
+#include <accessibility/extended/listboxaccessible.hxx>
+#endif
+#ifndef _SVTREEBOX_HXX
+#include <svtools/svtreebx.hxx>
+#endif
+
+//........................................................................
+namespace accessibility
+{
+//........................................................................
+
+ //====================================================================
+ //= ListBoxAccessibleBase
+ //====================================================================
+ //--------------------------------------------------------------------
+ ListBoxAccessibleBase::ListBoxAccessibleBase( SvTreeListBox& _rWindow )
+ :m_pWindow( &_rWindow )
+ {
+ m_pWindow->AddEventListener( LINK( this, ListBoxAccessibleBase, WindowEventListener ) );
+ }
+
+ //--------------------------------------------------------------------
+ ListBoxAccessibleBase::~ListBoxAccessibleBase( )
+ {
+ if ( m_pWindow )
+ {
+ // cannot call "dispose" here, as it is abstract, so the VTABLE of the derived class
+ // is not intact anymore
+ // so we call our "disposing" only
+ disposing();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( ListBoxAccessibleBase, WindowEventListener, VclSimpleEvent*, pEvent )
+ {
+ DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "ListBoxAccessibleBase::WindowEventListener: unexpected WindowEvent!" );
+ if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ {
+ DBG_ASSERT( static_cast< VclWindowEvent* >( pEvent )->GetWindow() , "ListBoxAccessibleBase::WindowEventListener: no event window!" );
+ DBG_ASSERT( static_cast< VclWindowEvent* >( pEvent )->GetWindow() == m_pWindow, "ListBoxAccessibleBase::WindowEventListener: where did this come from?" );
+
+ ProcessWindowEvent( *static_cast< VclWindowEvent* >( pEvent ) );
+ }
+ return 0;
+ }
+
+ // -----------------------------------------------------------------------------
+ void ListBoxAccessibleBase::disposing()
+ {
+ if ( m_pWindow )
+ m_pWindow->RemoveEventListener( LINK( this, ListBoxAccessibleBase, WindowEventListener ) );
+ m_pWindow = NULL;
+ }
+
+ // -----------------------------------------------------------------------------
+ void ListBoxAccessibleBase::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
+ {
+ if ( isAlive() )
+ {
+ switch ( _rVclWindowEvent.GetId() )
+ {
+ case VCLEVENT_OBJECT_DYING :
+ {
+ if ( m_pWindow )
+ m_pWindow->RemoveEventListener( LINK( this, ListBoxAccessibleBase, WindowEventListener ) );
+ m_pWindow = NULL;
+ dispose();
+ break;
+ }
+ }
+ }
+ }
+
+//........................................................................
+} // namespace accessibility
+//........................................................................