summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <od@openoffice.org>2010-01-19 08:55:31 +0100
committerOliver-Rainer Wittmann <od@openoffice.org>2010-01-19 08:55:31 +0100
commitfa9e08d540d9221d7b86c558016edf2e08381d9b (patch)
tree6087fa41bd96a947908d771ffe2300460f335f6f /sw/source/ui/docvw/SidebarTxtControlAcc.cxx
parent930e397d54b345bff69160d59bd5475702bc6bd2 (diff)
sw33a11y01: classes <SidebarTextEditSource> and <SidebarTxtControlAccessibleContext> - forward needed a11y information/events to <AccessibleTextHelper> instance
Diffstat (limited to 'sw/source/ui/docvw/SidebarTxtControlAcc.cxx')
-rw-r--r--sw/source/ui/docvw/SidebarTxtControlAcc.cxx46
1 files changed, 45 insertions, 1 deletions
diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
index 08a7c1b0083d..e01041d79fe6 100644
--- a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx
@@ -40,6 +40,7 @@
#include <svx/unoedsrc.hxx>
#include <svx/unoforou.hxx>
#include <svx/unoviwou.hxx>
+#include <svx/unoedhlp.hxx>
#include <svx/AccessibleTextHelper.hxx>
#include <svx/outliner.hxx>
@@ -52,7 +53,7 @@ namespace sw { namespace sidebarwindows {
// for <::accessibiliy::AccessibleTextHelper> instance
// =============================================================================
class SidebarTextEditSource : public SvxEditSource,
- public SfxBroadcaster
+ public SfxBroadcaster
{
public:
SidebarTextEditSource( SidebarTxtControl& rSidebarTxtControl );
@@ -67,6 +68,7 @@ class SidebarTextEditSource : public SvxEditSource,
virtual void UpdateData();
virtual SfxBroadcaster& GetBroadcaster() const;
+ DECL_LINK( NotifyHdl, EENotify* );
private:
SidebarTxtControl& mrSidebarTxtControl;
@@ -80,10 +82,12 @@ SidebarTextEditSource::SidebarTextEditSource( SidebarTxtControl& rSidebarTxtCont
, mTextForwarder( *(rSidebarTxtControl.GetTextView()->GetOutliner()), NULL )
, mViewForwarder( *(rSidebarTxtControl.GetTextView()) )
{
+ mrSidebarTxtControl.GetTextView()->GetOutliner()->SetNotifyHdl( LINK(this, SidebarTextEditSource, NotifyHdl) );
}
SidebarTextEditSource::~SidebarTextEditSource()
{
+ mrSidebarTxtControl.GetTextView()->GetOutliner()->SetNotifyHdl( Link() );
}
SvxEditSource* SidebarTextEditSource::Clone() const
@@ -116,6 +120,22 @@ SfxBroadcaster& SidebarTextEditSource::GetBroadcaster() const
return *( const_cast< SidebarTextEditSource* > (this) );
}
+IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify*, pNotify)
+{
+ if ( pNotify )
+ {
+ ::std::auto_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) );
+
+ if( aHint.get() )
+ {
+ Broadcast( *aHint.get() );
+ }
+ }
+
+ return 0;
+}
+
+
// =============================================================================
// declaration and implementation of accessible context for <SidebarTxtControl> instance
// =============================================================================
@@ -146,6 +166,9 @@ class SidebarTxtControlAccessibleContext : public VCLXAccessibleComponent
::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
throw (::com::sun::star::uno::RuntimeException);
+ protected:
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+
private:
SidebarTxtControl& mrSidebarTxtControl;
::accessibility::AccessibleTextHelper* mpAccessibleTextHelper;
@@ -193,6 +216,27 @@ void SAL_CALL SidebarTxtControlAccessibleContext::removeEventListener (
mpAccessibleTextHelper->RemoveEventListener(xListener);
}
+void SidebarTxtControlAccessibleContext::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
+{
+ switch ( rVclWindowEvent.GetId() )
+ {
+ case VCLEVENT_WINDOW_GETFOCUS:
+ case VCLEVENT_CONTROL_GETFOCUS:
+ {
+ mpAccessibleTextHelper->SetFocus( sal_True );
+ }
+ break;
+ case VCLEVENT_WINDOW_LOSEFOCUS:
+ case VCLEVENT_CONTROL_LOSEFOCUS:
+ {
+ mpAccessibleTextHelper->SetFocus( sal_False );
+ }
+ break;
+ }
+
+ VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
+}
+
// =============================================================================
// implementaion of accessible for <SidebarTxtControl> instance
// =============================================================================