From f4210b48ec23153e252de6734fad1d362bede926 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Fri, 25 Jul 2008 08:05:19 +0000 Subject: INTEGRATION: CWS aqua11y02 (1.2.30); FILE MERGED 2008/05/15 11:33:02 fne 1.2.30.1: #i88044# notifications for BOUNDRECT_CHANGED and CHILD --- vcl/aqua/source/a11y/aqua11ylistener.cxx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'vcl/aqua/source/a11y') diff --git a/vcl/aqua/source/a11y/aqua11ylistener.cxx b/vcl/aqua/source/a11y/aqua11ylistener.cxx index 418da09f09a2..0bca467d9aa5 100644 --- a/vcl/aqua/source/a11y/aqua11ylistener.cxx +++ b/vcl/aqua/source/a11y/aqua11ylistener.cxx @@ -8,7 +8,7 @@ * * $RCSfile: aqua11ylistener.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -42,6 +42,7 @@ #include using namespace ::com::sun::star::accessibility; +using namespace ::com::sun::star::awt; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -89,6 +90,7 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw( { NSString * notification = nil; id element = m_wrapperObject; + Rectangle bounds; // TODO: NSAccessibilityValueChanged, NSAccessibilitySelectedRowsChangedNotification switch( aEvent.EventId ) @@ -106,13 +108,14 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw( break; case AccessibleEventId::CHILD: - // TODO: map to NSAccessibilityCreatedNotification/NSAccessibilityUIElementDestroyedNotification - // once we found out which object to pass to it. - if(aEvent.NewValue.hasValue()) { - //notification = NSAccessibilityCreatedNotification; - } else if(aEvent.OldValue.hasValue()) { - //notification = NSAccessibilityUIElementDestroyedNotification - } + // only needed for tooltips (says Apple) + if ( m_role == AccessibleRole::TOOL_TIP ) { + if(aEvent.NewValue.hasValue()) { + notification = NSAccessibilityCreatedNotification; + } else if(aEvent.OldValue.hasValue()) { + notification = NSAccessibilityUIElementDestroyedNotification; + } + } break; case AccessibleEventId::INVALIDATE_ALL_CHILDREN: @@ -120,8 +123,14 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw( break; case AccessibleEventId::BOUNDRECT_CHANGED: - // TODO: check against remembered size/position and send - // NSAccessibilityMovedNotification or NSAccessibilityResized Notification + bounds = [ element accessibleComponent ] -> getBounds(); + if ( m_oldBounds.X != 0 && ( bounds.X != m_oldBounds.X || bounds.Y != m_oldBounds.Y ) ) { + NSAccessibilityPostNotification(element, NSAccessibilityMovedNotification); // post directly since both cases can happen simultaneously + } + if ( m_oldBounds.X != 0 && ( bounds.Width != m_oldBounds.Width || bounds.Height != m_oldBounds.Height ) ) { + NSAccessibilityPostNotification(element, NSAccessibilityResizedNotification); // post directly since both cases can happen simultaneously + } + m_oldBounds = bounds; break; case AccessibleEventId::SELECTION_CHANGED: -- cgit