summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2002-02-27 08:40:21 +0000
committerMalte Timmermann <mt@openoffice.org>2002-02-27 08:40:21 +0000
commitc10d7a3642420e35ac3890becdae1cbf35d2cf75 (patch)
tree4b904afd6b12eb32aa9d553a6ee70b5dbe5bb18b
parent2c9b206a77c5326e5e0d4fa74780ce89f7c731b6 (diff)
#97034# VclEventListener
-rw-r--r--toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx9
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx37
2 files changed, 42 insertions, 4 deletions
diff --git a/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx b/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
index bc3aeffa896a..81e2ce76fa32 100644
--- a/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
+++ b/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: vclxaccessiblecomponent.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: pb $ $Date: 2002-02-21 08:55:19 $
+ * last change: $Author: mt $ $Date: 2002-02-27 09:40:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,9 +80,12 @@
#endif
#include <tools/gen.hxx> // Size
+#include <tools/link.hxx> // Size
class Window;
class VCLXWindow;
+class VclSimpleEvent;
+class VclWindowEvent;
namespace utl {
class AccessibleStateSetHelper;
@@ -118,7 +121,9 @@ private:
protected:
::osl::Mutex& GetMutex() { return maMutex; }
+ DECL_LINK( WindowEventListener, VclSimpleEvent* );
+ /* virtual */ void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
public:
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 75357bc667bf..61f9fa957b15 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: vclxaccessiblecomponent.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mt $ $Date: 2002-02-15 10:31:39 $
+ * last change: $Author: mt $ $Date: 2002-02-27 09:39:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,6 +71,7 @@
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/convert.hxx>
#include <vcl/window.hxx>
+#include <tools/debug.hxx>
#include <unotools/accessiblestatesethelper.hxx>
@@ -85,15 +86,47 @@ VCLXAccessibleComponent::VCLXAccessibleComponent( VCLXWindow* pVCLXindow )
{
mpVCLXindow = pVCLXindow;
mxWindow = pVCLXindow;
+
+ DBG_ASSERT( pVCLXindow->GetWindow(), "VCLXAccessibleComponent - no window!" );
+ if ( pVCLXindow->GetWindow() )
+ pVCLXindow->GetWindow()->AddEventListener( LINK( this, VCLXAccessibleComponent, WindowEventListener ) );
}
VCLXAccessibleComponent::~VCLXAccessibleComponent()
{
+ if ( mpVCLXindow && mpVCLXindow->GetWindow() )
+ mpVCLXindow->GetWindow()->RemoveEventListener( LINK( this, VCLXAccessibleComponent, WindowEventListener ) );
+}
+
+IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclSimpleEvent*, pEvent )
+{
+ DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+ if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ {
+ DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow() && GetWindow(), "Window???" );
+ ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+ }
+ return 0;
+}
+
+void VCLXAccessibleComponent::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
+{
+ switch ( rVclWindowEvent.GetId() )
+ {
+// case XXX:
+// {
+// }
+// break;
+ }
}
void VCLXAccessibleComponent::disposing()
{
+ if ( mpVCLXindow && mpVCLXindow->GetWindow() )
+ mpVCLXindow->GetWindow()->RemoveEventListener( LINK( this, VCLXAccessibleComponent, WindowEventListener ) );
+
mxWindow.clear();
+ mpVCLXindow = NULL;
}
Window* VCLXAccessibleComponent::GetWindow() const