summaryrefslogtreecommitdiff
path: root/sw/source/core/access/acccontext.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/access/acccontext.cxx')
-rw-r--r--sw/source/core/access/acccontext.cxx112
1 files changed, 101 insertions, 11 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index a4a0399747f7..df207e989350 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -60,6 +60,11 @@
#include <acccontext.hxx>
#include <svx/AccessibleShape.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _ACCPARA_HXX
+#include "accpara.hxx"
+#endif
+//-----IAccessibility2 Implementation 2009
#include <PostItMgr.hxx>
using namespace sw::access;
@@ -215,8 +220,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
const SwFrm* pLower( rLower.GetSwFrm() );
::vos::ORef< SwAccessibleContext > xAccImpl =
- GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
- SCROLLED_IN == eAction );
+ //IAccessibility2 Implementation 2009-----
+ //O is: GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
+ // SCROLLED_IN == eAction );
+ GetMap()->GetContextImpl( pLower, sal_True );
+ //-----IAccessibility2 Implementation 2009
if( xAccImpl.isValid() )
{
switch( eAction )
@@ -247,10 +255,15 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
ASSERT( !rLower.AlwaysIncludeAsChild(),
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ //IAccessibility2 Implementation 2009-----
+ //O is: GetMap()->GetContextImpl( rLower.GetSdrObject(),
+ // this,
+ // SCROLLED_OUT == eAction ||
+ // SCROLLED_IN == eAction );
GetMap()->GetContextImpl( rLower.GetDrawObject(),
this,
- SCROLLED_OUT == eAction ||
- SCROLLED_IN == eAction );
+ sal_True );
+ //-----IAccessibility2 Implementation 2009
if( xAccImpl.isValid() )
{
switch( eAction )
@@ -270,8 +283,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
xAccImpl->ViewForwarderChanged(
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
- DisposeShape( rLower.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ //IAccessibility2 Implementation 2009-----
+ //Remove
+ //DisposeShape( rLower.GetDrawObject(),
+ // xAccImpl.getBodyPtr() );
+ //-----IAccessibility2 Implementation 2009
}
break;
case NONE:
@@ -380,8 +396,11 @@ void SwAccessibleContext::ScrolledOut( const SwRect& rOldVisArea )
// the child event. In this case no listener will exist.
FireStateChangedEvent( AccessibleStateType::SHOWING, sal_False );
+ //IAccessibility2 Implementation 2009-----
+ //Remove Dispose When scrolledout
// We now dispose the frame
- Dispose( sal_True );
+ // Dispose( sal_True );
+ //-----IAccessibility2 Implementation 2009
}
// --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
@@ -517,8 +536,14 @@ void SwAccessibleContext::GetStates(
// EDITABLE
if( bIsEditableState )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Set editable state to graphic and other object when the document is editable
+ {
rStateSet.AddState( AccessibleStateType::EDITABLE );
-
+ rStateSet.AddState( AccessibleStateType::RESIZABLE );
+ rStateSet.AddState( AccessibleStateType::MOVEABLE );
+ }
+ //-----IAccessibility2 Implementation 2009
// ENABLED
rStateSet.AddState( AccessibleStateType::ENABLED );
@@ -554,6 +579,12 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
, nRole( nR )
, bDisposing( sal_False )
, bRegisteredAtAccessibleMap( true )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Initialize the begin document load and IfAsynLoad to true
+ , bBeginDocumentLoad( sal_True )
+ , isIfAsynLoad( sal_True )
+ , bIsSeletedInDoc( sal_False)
+ //-----IAccessibility2 Implementation 2009
{
InitStates();
DBG_MSG_CD( "constructed" )
@@ -581,6 +612,11 @@ sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleChildCount( void )
vos::OGuard aGuard(Application::GetSolarMutex());
CHECK_FOR_DEFUNC( XAccessibleContext )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Notify the frame is a document
+ if( nRole == AccessibleRole::DOCUMENT )
+ bIsAccDocUse = sal_True;
+ //-----IAccessibility2 Implementation 2009
return bDisposing ? 0 : GetChildCount( *(GetMap()) );
}
@@ -593,6 +629,12 @@ uno::Reference< XAccessible> SAL_CALL
CHECK_FOR_DEFUNC( XAccessibleContext )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Notify the frame is a document
+ if( nRole == AccessibleRole::DOCUMENT )
+ bIsAccDocUse = sal_True;
+ //-----IAccessibility2 Implementation 2009
+
const SwAccessibleChild aChild( GetChild( *(GetMap()), nIndex ) );
if( !aChild.IsValid() )
{
@@ -608,6 +650,26 @@ uno::Reference< XAccessible> SAL_CALL
{
::vos::ORef < SwAccessibleContext > xChildImpl(
GetMap()->GetContextImpl( aChild.GetSwFrm(), !bDisposing ) );
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Send out accessible event when begin load.
+ if( bBeginDocumentLoad && nRole == AccessibleRole::DOCUMENT )
+ {
+
+ FireStateChangedEvent( AccessibleStateType::FOCUSABLE,sal_True );
+ FireStateChangedEvent( AccessibleStateType::BUSY,sal_True );
+ if( !isIfAsynLoad )
+ {
+ FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
+ // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_True );
+ FireStateChangedEvent( AccessibleStateType::SHOWING,sal_True );
+ FireStateChangedEvent( AccessibleStateType::BUSY,sal_False );
+ // MT: OFFSCREEN again?
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_False );
+ }
+ bBeginDocumentLoad = sal_False;
+ }
+ //-----IAccessibility2 Implementation 2009
if( xChildImpl.isValid() )
{
xChildImpl->SetParent( this );
@@ -717,6 +779,11 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
::utl::AccessibleStateSetHelper *pStateSet =
new ::utl::AccessibleStateSetHelper;
+ //IAccessibility2 Implementation 2009-----
+ if( bIsSeletedInDoc )
+ pStateSet->AddState( AccessibleStateType::SELECTED );
+ //-----IAccessibility2 Implementation 2009
+
uno::Reference<XAccessibleStateSet> xStateSet( pStateSet );
GetStates( *pStateSet );
@@ -988,13 +1055,15 @@ uno::Any SAL_CALL SwAccessibleContext::getAccessibleKeyBinding()
sal_Int32 SAL_CALL SwAccessibleContext::getForeground()
throw (uno::RuntimeException)
{
- return 0;
+ //IAccessibility2 Implementation 2009-----
+ return COL_BLACK;
+ //-----IAccessibility2 Implementation 2009
}
sal_Int32 SAL_CALL SwAccessibleContext::getBackground()
throw (uno::RuntimeException)
{
- return 0xffffff;
+ return COL_WHITE;
}
@@ -1041,6 +1110,12 @@ void SwAccessibleContext::DisposeShape( const SdrObject *pObj,
void SwAccessibleContext::ScrolledInShape( const SdrObject* ,
::accessibility::AccessibleShape *pAccImpl )
{
+ //IAccessibility2 Implementation 2009-----
+ if(NULL == pAccImpl)
+ {
+ return ;
+ }
+ //-----IAccessibility2 Implementation 2009
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::CHILD;
uno::Reference< XAccessible > xAcc( pAccImpl );
@@ -1184,7 +1259,10 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
{
// The frame is now invisible -> dispose it
- Dispose( sal_True );
+ //IAccessibility2 Implementation 2009-----
+ //Remove
+ //Dispose( sal_True );
+ //-----IAccessibility2 Implementation 2009
}
else
{
@@ -1585,3 +1663,15 @@ void lcl_SwAccessibleContext_DbgMsg( SwAccessibleContext *pThisAcc,
aStrm.Flush();
}
#endif
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleContext::SetSelectedState(sal_Bool bSeleted)
+{
+ if(bIsSeletedInDoc != bSeleted)
+ {
+ bIsSeletedInDoc = bSeleted;
+ FireStateChangedEvent( AccessibleStateType::SELECTED, bSeleted );
+ return sal_True;
+ }
+ return sal_False;
+};
+//-----IAccessibility2 Implementation 2009