diff options
Diffstat (limited to 'sd/source/ui')
54 files changed, 2482 insertions, 67 deletions
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index 404cd0c723fd..17afa37455ca 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -37,7 +37,10 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <rtl/ustring.h> #include<sfx2/viewfrm.hxx> - +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <sfx2/objsh.hxx> +//-----IAccessibility2 Implementation 2009 #include <svx/AccessibleShape.hxx> #include <svx/svdobj.hxx> @@ -46,8 +49,16 @@ #include <toolkit/helper/vclunohelper.hxx> #include "Window.hxx" #include <vcl/svapp.hxx> +//IAccessibility2 Implementation 2009----- +#include "OutlineViewShell.hxx" +#include "SlideViewShell.hxx" +#include <svx/svdlayer.hxx> +#include <editeng/editobj.hxx> +#include "LayerTabBar.hxx" +#include <svtools/colorcfg.hxx> +//-----IAccessibility2 Implementation 2009 #include "ViewShell.hxx" #include "View.hxx" #include <memory> @@ -88,6 +99,9 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase ( maShapeTreeInfo.SetViewForwarder (&maViewForwarder); mxWindow = ::VCLUnoHelper::GetInterface (pSdWindow); +//IAccessibility2 Implementation 2009----- + mpViewShell = pViewShell; +//-----IAccessibility2 Implementation 2009 } @@ -159,6 +173,11 @@ void AccessibleDocumentViewBase::Init (void) } } } +//IAccessibility2 Implementation 2009----- + SfxObjectShell* pObjShell = mpViewShell->GetViewFrame()->GetObjectShell(); + if(!pObjShell->IsReadOnly()) + SetState(AccessibleStateType::EDITABLE); +//-----IAccessibility2 Implementation 2009 } @@ -434,6 +453,10 @@ uno::Any SAL_CALL static_cast<beans::XPropertyChangeListener*>(this), static_cast<awt::XWindowListener*>(this), static_cast<awt::XFocusListener*>(this) +//IAccessibility2 Implementation 2009----- + ,static_cast<XAccessibleExtendedAttributes*>(this) + ,static_cast<XAccessibleGetAccFlowTo*>(this) +//-----IAccessibility2 Implementation 2009 ); return aReturn; } @@ -835,4 +858,156 @@ void { } +//IAccessibility2 Implementation 2009----- +uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) +{ + uno::Any anyAtrribute; + rtl::OUString sValue; + ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >(mpViewShell); + + if(pDrViewSh) + { + rtl::OUString sName; + String sDisplay; + sName = rtl::OUString::createFromAscii("page-name:"); + // MT IA2: Not used... + // SdPage* pCurrPge = pDrViewSh->getCurrentPage(); + SdDrawDocument* pDoc = pDrViewSh->GetDoc(); + sDisplay = pDrViewSh->getCurrentPage()->GetName(); + sDisplay.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" )); + sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) ); + sValue = sName + sDisplay ; + sName = rtl::OUString::createFromAscii(";page-number:"); + sValue += sName; + sValue += String::CreateFromInt32((sal_Int16)((sal_uInt16)((pDrViewSh->getCurrentPage()->GetPageNumber()-1)>>1) + 1)) ; + sName = rtl::OUString::createFromAscii(";total-pages:"); + sValue += sName; + sValue += String::CreateFromInt32(pDrViewSh->GetPageTabControl()->GetPageCount()) ; + sValue += rtl::OUString::createFromAscii(";"); + if(pDrViewSh->IsLayerModeActive() ) + { + sName = rtl::OUString::createFromAscii("page-name:"); + sValue = sName; + sDisplay = pDrViewSh->GetLayerTabControl()->GetPageText(pDrViewSh->GetLayerTabControl()->GetCurPageId()); + if( pDoc ) + { + SdrLayerAdmin& rLayerAdmin = pDoc->GetModelLayerAdmin(); + SdrLayer* aSdrLayer = rLayerAdmin.GetLayer(sDisplay, sal_False); + if( aSdrLayer ) + { + String layerAltText = aSdrLayer->GetTitle(); + if( layerAltText.Len() > 0) + { + sName = rtl::OUString::createFromAscii(" "); + sDisplay = sDisplay + sName; + sDisplay += layerAltText; + } + } + } + sDisplay.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" )); + sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" )); + sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" )); + sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," )); + sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" )); + sValue += sDisplay; + sName = rtl::OUString::createFromAscii(";page-number:"); + sValue += sName; + sValue += String::CreateFromInt32(pDrViewSh->GetActiveTabLayerIndex()+1) ; + sName = rtl::OUString::createFromAscii(";total-pages:"); + sValue += sName; + sValue += String::CreateFromInt32(pDrViewSh->GetLayerTabControl()->GetPageCount()) ; + sValue += rtl::OUString::createFromAscii(";"); + } + } + + ::sd::PresentationViewShell* pPresViewSh = dynamic_cast< ::sd::PresentationViewShell* >(mpViewShell); + + if(pPresViewSh) + { + SdPage* pCurrPge = pPresViewSh->getCurrentPage(); + SdDrawDocument* pDoc = pPresViewSh->GetDoc(); + SdPage* pNotesPge = (SdPage*)pDoc->GetSdPage((pCurrPge->GetPageNumber()-1)>>1, PK_NOTES); + if (pNotesPge) + { + SdrObject* pNotesObj = pNotesPge->GetPresObj(PRESOBJ_NOTES); + if (pNotesObj) + { + OutlinerParaObject* pPara = pNotesObj->GetOutlinerParaObject(); + if (pPara) + { + sValue += rtl::OUString::createFromAscii("note:"); + const EditTextObject& rEdit = pPara->GetTextObject(); + for (sal_uInt16 i=0;i<rEdit.GetParagraphCount();i++) + { + String strNote = rEdit.GetText(i); + strNote.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" )); + strNote.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" )); + strNote.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" )); + strNote.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," )); + strNote.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" )); + sValue += rtl::OUString( strNote ); + sValue += rtl::OUString::createFromAscii(";");//to divide each paragraph + } + } + } + } + } + + ::sd::OutlineViewShell* pOutlineViewSh = dynamic_cast< ::sd::OutlineViewShell* >(mpViewShell); + + if(pOutlineViewSh) + { + rtl::OUString sName; + String sDisplay; + SdPage* pCurrPge = mpViewShell->GetActualPage(); + SdDrawDocument* pDoc = mpViewShell->GetDoc(); + if(pCurrPge && pDoc) + { + sName = rtl::OUString::createFromAscii("page-name:"); + sDisplay = pCurrPge->GetName(); + sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) ); + sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) ); + sValue = sName + sDisplay ; + sName = rtl::OUString::createFromAscii(";page-number:"); + sValue += sName; + sValue += String::CreateFromInt32((sal_Int16)((sal_uInt16)((pCurrPge->GetPageNumber()-1)>>1) + 1)) ; + sName = rtl::OUString::createFromAscii(";total-pages:"); + sValue += sName; + sValue += String::CreateFromInt32(pDoc->GetSdPageCount(PK_STANDARD)) ; + sValue += rtl::OUString::createFromAscii(";"); + } + } + if (sValue.getLength()) + anyAtrribute <<= sValue; + return anyAtrribute; +} +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL AccessibleDocumentViewBase::get_AccFlowTo(const ::com::sun::star::uno::Any&, sal_Int32 ) + throw ( ::com::sun::star::uno::RuntimeException ) +{ + ::com::sun::star::uno::Sequence< uno::Any> aRet; + + return aRet; +} + +sal_Int32 SAL_CALL AccessibleDocumentViewBase::getForeground( ) + throw (uno::RuntimeException) +{ + return COL_BLACK; +} + +sal_Int32 SAL_CALL AccessibleDocumentViewBase::getBackground( ) + throw (uno::RuntimeException) +{ + ThrowIfDisposed (); + ::osl::MutexGuard aGuard (maMutex); + return mpViewShell->GetView()->getColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor; +} +//-----IAccessibility2 Implementation 2009 } // end of namespace accessibility diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index 00d42fa3a7db..4484d69eb7e8 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -52,6 +52,14 @@ #include "ViewShell.hxx" #include "View.hxx" +//IAccessibility2 Implementation 2009----- +#include "DrawDocShell.hxx" +#include <drawdoc.hxx> +#include <algorithm> +#include "sdpage.hxx" +#include "slideshow.hxx" +#include "anminfo.hxx" +//-----IAccessibility2 Implementation 2009 #include <memory> #include "accessibility.hrc" @@ -70,6 +78,22 @@ class SfxViewFrame; namespace accessibility { +//IAccessibility2 Implementation 2009----- +struct XShapePosCompareHelper +{ + bool operator() ( const uno::Reference<drawing::XShape>& xshape1, + const uno::Reference<drawing::XShape>& xshape2 ) const + { + // modify the compare method to return the Z-Order, not layout order + SdrObject* pObj1 = GetSdrObjectFromXShape(xshape1); + SdrObject* pObj2 = GetSdrObjectFromXShape(xshape2); + if(pObj1 && pObj2) + return pObj1->GetNavigationPosition() < pObj2->GetNavigationPosition(); + else + return 0; + } +}; +//-----IAccessibility2 Implementation 2009 //===== internal ============================================================ AccessibleDrawDocumentView::AccessibleDrawDocumentView ( @@ -78,6 +102,7 @@ AccessibleDrawDocumentView::AccessibleDrawDocumentView ( const uno::Reference<frame::XController>& rxController, const uno::Reference<XAccessible>& rxParent) : AccessibleDocumentViewBase (pSdWindow, pViewShell, rxController, rxParent), + mpSdViewSh( pViewShell ), mpChildrenManager (NULL) { OSL_TRACE ("AccessibleDrawDocumentView"); @@ -260,9 +285,44 @@ uno::Reference<XAccessible> SAL_CALL static_cast<uno::XWeak*>(this)); } +//IAccessibility2 Implementation 2009----- +OUString SAL_CALL + AccessibleDrawDocumentView::getAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException) +{ + OUString sName = String( SdResId(SID_SD_A11Y_D_PRESENTATION) ); + ::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() ); + if ( pSdView ) + { + SdDrawDocument* pDoc = pSdView->GetDoc(); + if ( pDoc ) + { + rtl::OUString sFileName = pDoc->getDocAccTitle(); + if ( !sFileName.getLength() ) + { + ::sd::DrawDocShell* pDocSh = pSdView->GetDocSh(); + if ( pDocSh ) + { + sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME ); + } + } + OUString sReadOnly; + if(pDoc->getDocReadOnly()) + { + sReadOnly = String(SdResId(SID_SD_A11Y_D_PRESENTATION_READONLY)); + } + if ( sFileName.getLength() ) + { + sName = sFileName + sReadOnly + OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sName; + } + } + } + return sName; +} +//-----IAccessibility2 Implementation 2009 //===== XEventListener ====================================================== void SAL_CALL @@ -295,7 +355,9 @@ void SAL_CALL AccessibleDocumentViewBase::propertyChange (rEventObject); OSL_TRACE ("AccessibleDrawDocumentView::propertyChange"); - if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage"))) + // add page switch event for slide show mode + if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")) || + rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("PageChange")) ) { OSL_TRACE (" current page changed"); @@ -329,6 +391,9 @@ void SAL_CALL } else OSL_TRACE ("View invalid"); +//IAccessibility2 Implementation 2009----- + CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue); +//-----IAccessibility2 Implementation 2009 } else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("VisibleArea"))) { @@ -338,6 +403,59 @@ void SAL_CALL IAccessibleViewForwarderListener::VISIBLE_AREA, &maViewForwarder); } +//IAccessibility2 Implementation 2009----- + else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("ActiveLayer"))) + { + CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue); + } + else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("UpdateAcc"))) + { + OSL_TRACE (" acc on current page should be updated"); + + // The current page changed. Update the children manager accordingly. + uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY); + if (xView.is() && mpChildrenManager!=NULL) + { + // Inform the children manager to forget all children and give + // him the new ones. + mpChildrenManager->ClearAccessibleShapeList (); + // update the slide show page's accessible info + //mpChildrenManager->SetShapeList (uno::Reference<drawing::XShapes> ( + // xView->getCurrentPage(), uno::UNO_QUERY)); + rtl::Reference< sd::SlideShow > xSlideshow( sd::SlideShow::GetSlideShow( mpSdViewSh->GetViewShellBase() ) ); + if( xSlideshow.is() && xSlideshow->isRunning() && xSlideshow->isFullScreen() ) + { + ::com::sun::star::uno::Reference< drawing::XDrawPage > xSlide; + // MT IA2: Not used... + // sal_Int32 currentPageIndex = xSlideshow->getCurrentPageIndex(); + ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XSlideShowController > mpSlideController = xSlideshow->getController(); + if( mpSlideController.is() ) + { + xSlide = mpSlideController->getCurrentSlide(); + if (xSlide.is()) + { + mpChildrenManager->SetShapeList (uno::Reference<drawing::XShapes> ( + xSlide, uno::UNO_QUERY)); + } + } + } + // Create the page shape and initialize it. The shape is + // acquired before initialization and released after + // transferring ownership to the children manager to prevent + // premature disposing of the shape. + AccessiblePageShape* pPage = CreateDrawPageShape (); + if (pPage != NULL) + { + pPage->acquire(); + pPage->Init(); + mpChildrenManager->AddAccessibleShape ( + std::auto_ptr<AccessibleShape>(pPage)); + mpChildrenManager->Update (false); + pPage->release(); + } + } + } +//-----IAccessibility2 Implementation 2009 else { OSL_TRACE (" unhandled"); @@ -379,9 +497,135 @@ void SAL_CALL return aServiceNames; } +//IAccessibility2 Implementation 2009----- +//===== XInterface ========================================================== +uno::Any SAL_CALL + AccessibleDrawDocumentView::queryInterface (const uno::Type & rType) + throw (uno::RuntimeException) +{ + uno::Any aReturn = AccessibleDocumentViewBase::queryInterface (rType); + if ( ! aReturn.hasValue()) + aReturn = ::cppu::queryInterface (rType, + static_cast<XAccessibleGroupPosition*>(this) + ); + return aReturn; +} - +void SAL_CALL + AccessibleDrawDocumentView::acquire (void) + throw () +{ + AccessibleDocumentViewBase::acquire (); +} +void SAL_CALL + AccessibleDrawDocumentView::release (void) + throw () +{ + AccessibleDocumentViewBase::release (); +} +//===== XAccessibleGroupPosition ========================================= +uno::Sequence< sal_Int32 > SAL_CALL + AccessibleDrawDocumentView::getGroupPosition( const uno::Any& rAny ) + throw (uno::RuntimeException) +{ + // we will return the: + // [0] group level(always be 0 now) + // [1] similar items counts in the group + // [2] the position of the object in the group + uno::Sequence< sal_Int32 > aRet( 3 ); + //get the xShape of the current selected drawing object + uno::Reference<XAccessibleContext> xAccContent; + rAny >>= xAccContent; + if ( !xAccContent.is() ) + { + return aRet; + } + AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent ); + if ( !pAcc ) + { + return aRet; + } + uno::Reference< drawing::XShape > xCurShape = pAcc->GetXShape(); + if ( !xCurShape.is() ) + { + return aRet; + } + //find all the child in the page, insert them into a vector and sort + if ( mpChildrenManager == NULL ) + { + return aRet; + } + std::vector< uno::Reference<drawing::XShape> > vXShapes; + sal_Int32 nCount = mpChildrenManager->GetChildCount(); + //get pointer of SdView & SdrPageView for further use. + ::sd::View* pSdView = NULL; + if ( mpSdViewSh ) + { + pSdView = mpSdViewSh->GetView(); + } + for ( sal_Int32 i = 0; i < nCount; i++ ) + { + uno::Reference< drawing::XShape > xShape = mpChildrenManager->GetChildShape(i); + if ( xShape.is() ) + { + //if the object is visable in the page, we add it into the group list. + SdrObject* pObj = GetSdrObjectFromXShape(xShape); + if(pObj && pSdView && pSdView->IsObjMarkable(*pObj)) + { + vXShapes.push_back( xShape ); + } + } + } + std::sort( vXShapes.begin(), vXShapes.end(), XShapePosCompareHelper() ); + //get the the index of the selected object in the group + std::vector< uno::Reference<drawing::XShape> >::iterator aIter; + //we start counting position from 1 + sal_Int32 nPos = 1; + for ( aIter = vXShapes.begin(); aIter != vXShapes.end(); aIter++, nPos++ ) + { + if ( (*aIter).get() == xCurShape.get() ) + { + sal_Int32* pArray = aRet.getArray(); + pArray[0] = 1; //it should be 1 based, not 0 based. + pArray[1] = vXShapes.size(); + pArray[2] = nPos; + break; + } + } + return aRet; +} +::rtl::OUString AccessibleDrawDocumentView::getObjectLink( const uno::Any& rAny ) + throw (uno::RuntimeException) +{ + ::rtl::OUString aRet; + //get the xShape of the current selected drawing object + uno::Reference<XAccessibleContext> xAccContent; + rAny >>= xAccContent; + if ( !xAccContent.is() ) + { + return aRet; + } + AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent ); + if ( !pAcc ) + { + return aRet; + } + uno::Reference< drawing::XShape > xCurShape = pAcc->GetXShape(); + if ( !xCurShape.is() ) + { + return aRet; + } + SdrObject* pObj = GetSdrObjectFromXShape(xCurShape); + if (pObj) + { + SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj); + if( pInfo && (pInfo->meClickAction == presentation::ClickAction_DOCUMENT) ) + aRet = (::rtl::OUString)pInfo->GetBookmark(); + } + return aRet; +} +//-----IAccessibility2 Implementation 2009 /// Create a name for this view. ::rtl::OUString AccessibleDrawDocumentView::CreateAccessibleName (void) @@ -637,13 +881,25 @@ void AccessibleDrawDocumentView::Activated (void) { if (mpChildrenManager != NULL) { - mpChildrenManager->UpdateSelection(); +//IAccessibility2 Implementation 2009----- + //mpChildrenManager->UpdateSelection(); + sal_Bool bChange = sal_False; +//-----IAccessibility2 Implementation 2009 // When none of the children has the focus then claim it for the // view. if ( ! mpChildrenManager->HasFocus()) + { SetState (AccessibleStateType::FOCUSED); + bChange = sal_True; + } else ResetState (AccessibleStateType::FOCUSED); +//IAccessibility2 Implementation 2009----- + mpChildrenManager->UpdateSelection(); + // if the child gets focus in UpdateSelection(), needs to reset the focus on document. + if (mpChildrenManager->HasFocus() && bChange) + ResetState (AccessibleStateType::FOCUSED); +//-----IAccessibility2 Implementation 2009 } } @@ -690,8 +946,158 @@ void SAL_CALL AccessibleDrawDocumentView::disposing (void) AccessibleDocumentViewBase::disposing (); } +//IAccessibility2 Implementation 2009----- +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL AccessibleDrawDocumentView::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType) + throw ( ::com::sun::star::uno::RuntimeException ) +{ + const sal_Int32 SPELLCHECKFLOWTO = 1; + const sal_Int32 FINDREPLACEFLOWTO = 2; + if ( nType == SPELLCHECKFLOWTO ) + { + uno::Reference< ::com::sun::star::drawing::XShape > xShape; + rAny >>= xShape; + if ( mpChildrenManager && xShape.is() ) + { + uno::Reference < XAccessible > xAcc = mpChildrenManager->GetChild(xShape); + uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY ); + if ( xAccSelection.is() ) + { + if ( xAccSelection->getSelectedAccessibleChildCount() ) + { + uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 ); + if ( xSel.is() ) + { + uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); + if ( xSelContext.is() ) + { + //if in sw we find the selected paragraph here + if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) + { + uno::Sequence<uno::Any> aRet( 1 ); + aRet[0] = uno::makeAny( xSel ); + return aRet; + } + } + } + } + } + uno::Reference<XAccessible> xPara = GetSelAccContextInTable(); + if ( xPara.is() ) + { + uno::Sequence<uno::Any> aRet( 1 ); + aRet[0] = uno::makeAny( xPara ); + return aRet; + } + } + else + { + goto Rt; + } + } + else if ( nType == FINDREPLACEFLOWTO ) + { + sal_Int32 nChildCount = getSelectedAccessibleChildCount(); + if ( nChildCount ) + { + uno::Reference < XAccessible > xSel = getSelectedAccessibleChild( 0 ); + if ( xSel.is() ) + { + uno::Reference < XAccessibleSelection > xAccChildSelection( xSel, uno::UNO_QUERY ); + if ( xAccChildSelection.is() ) + { + if ( xAccChildSelection->getSelectedAccessibleChildCount() ) + { + uno::Reference < XAccessible > xChildSel = xAccChildSelection->getSelectedAccessibleChild( 0 ); + if ( xChildSel.is() ) + { + uno::Reference < XAccessibleContext > xChildSelContext( xChildSel->getAccessibleContext() ); + if ( xChildSelContext.is() && + xChildSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) + { + uno::Sequence<uno::Any> aRet( 1 ); + aRet[0] = uno::makeAny( xChildSel ); + return aRet; + } + } + } + } + } + } + else + { + uno::Reference<XAccessible> xPara = GetSelAccContextInTable(); + if ( xPara.is() ) + { + uno::Sequence<uno::Any> aRet( 1 ); + aRet[0] = uno::makeAny( xPara ); + return aRet; + } + } + } +Rt: + ::com::sun::star::uno::Sequence< uno::Any> aRet; + return aRet; +} +uno::Reference<XAccessible> AccessibleDrawDocumentView::GetSelAccContextInTable() +{ + uno::Reference<XAccessible> xRet; + sal_Int32 nCount = mpChildrenManager ? mpChildrenManager->GetChildCount() : 0; + if ( nCount ) + { + for ( sal_Int32 i = 0; i < nCount; i++ ) + { + try + { + uno::Reference<XAccessible> xObj = mpChildrenManager->GetChild(i); + if ( xObj.is() ) + { + uno::Reference<XAccessibleContext> xObjContext( xObj, uno::UNO_QUERY ); + if ( xObjContext.is() && xObjContext->getAccessibleRole() == AccessibleRole::TABLE ) + { + uno::Reference<XAccessibleSelection> xObjSelection( xObj, uno::UNO_QUERY ); + if ( xObjSelection.is() && xObjSelection->getSelectedAccessibleChildCount() ) + { + uno::Reference<XAccessible> xCell = xObjSelection->getSelectedAccessibleChild(0); + if ( xCell.is() ) + { + uno::Reference<XAccessibleSelection> xCellSel( xCell, uno::UNO_QUERY ); + if ( xCellSel.is() && xCellSel->getSelectedAccessibleChildCount() ) + { + uno::Reference<XAccessible> xPara = xCellSel->getSelectedAccessibleChild( 0 ); + if ( xPara.is() ) + { + uno::Reference<XAccessibleContext> xParaContext( xPara, uno::UNO_QUERY ); + if ( xParaContext.is() && + xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) + { + xRet = xPara; + return xRet; + } + } + } + } + } + } + } + } + catch ( lang::IndexOutOfBoundsException ) + { + uno::Reference<XAccessible> xEmpty; + return xEmpty; + } + catch ( uno::RuntimeException ) + { + uno::Reference<XAccessible> xEmpty; + return xEmpty; + } + } + } + return xRet; +} +//-----IAccessibility2 Implementation 2009 void AccessibleDrawDocumentView::UpdateAccessibleName (void) { diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx index 2eee9155a864..2bd2a285729e 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx @@ -48,7 +48,8 @@ namespace accessibility mViewForwarder( rOutlView ) { // register as listener - need to broadcast state change messages - rOutliner.SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) ); + // Moved to ::GetTextForwarder() + //rOutliner.SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) ); StartListening(rOutliner); } @@ -61,14 +62,22 @@ namespace accessibility SvxEditSource* AccessibleOutlineEditSource::Clone() const { - return NULL; + //IAccessibility2 Implementation 2009----- + /*return NULL;*/ + return new AccessibleOutlineEditSource(*mpOutliner, mrView, *mpOutlinerView, mrWindow); + //-----IAccessibility2 Implementation 2009 } SvxTextForwarder* AccessibleOutlineEditSource::GetTextForwarder() { // TODO: maybe suboptimal if( IsValid() ) + { + // Moved here to make sure that + // the NotifyHandler was set on the current object. + mpOutliner->SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) ); return &mTextForwarder; + } else return NULL; } diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx index 1308c78f6f2f..aa1847e9b630 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx @@ -148,6 +148,37 @@ uno::Reference<XAccessible> SAL_CALL return maTextHelper.GetChild(nIndex); } +//IAccessibility2 Implementation 2009----- +#include <drawdoc.hxx> +::rtl::OUString SAL_CALL + AccessibleOutlineView::getAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException) +{ + ::rtl::OUString sName = String( SdResId(SID_SD_A11Y_D_PRESENTATION) ); + ::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() ); + if ( pSdView ) + { + SdDrawDocument* pDoc = pSdView->GetDoc(); + if ( pDoc ) + { + rtl::OUString sFileName = pDoc->getDocAccTitle(); + if ( !sFileName.getLength() ) + { + ::sd::DrawDocShell* pDocSh = pSdView->GetDocSh(); + if ( pDocSh ) + { + sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME ); + } + } + if ( sFileName.getLength() ) + { + sName = sFileName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sName; + } + } + } + return sName; +} +//-----IAccessibility2 Implementation 2009 //===== XAccessibleEventBroadcaster ======================================== void SAL_CALL AccessibleOutlineView::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException) @@ -155,6 +186,9 @@ void SAL_CALL AccessibleOutlineView::addEventListener( const uno::Reference< XAc // delegate listener handling to children manager. if ( ! IsDisposed()) maTextHelper.AddEventListener(xListener); +//IAccessibility2 Implementation 2009----- + AccessibleContextBase::addEventListener(xListener); +//-----IAccessibility2 Implementation 2009 } void SAL_CALL AccessibleOutlineView::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException) @@ -162,6 +196,9 @@ void SAL_CALL AccessibleOutlineView::removeEventListener( const uno::Reference< // forward if ( ! IsDisposed()) maTextHelper.RemoveEventListener(xListener); +//IAccessibility2 Implementation 2009----- + AccessibleContextBase::removeEventListener(xListener); +//-----IAccessibility2 Implementation 2009 } //===== XServiceInfo ======================================================== @@ -226,12 +263,17 @@ void SAL_CALL AccessibleDocumentViewBase::propertyChange (rEventObject); OSL_TRACE ("AccessibleOutlineView::propertyChange"); - if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage"))) + //add page switch event for slide show mode + if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")) || + rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("PageChange")) ) { OSL_TRACE (" current page changed"); // The current page changed. Update the children accordingly. UpdateChildren(); +//IAccessibility2 Implementation 2009----- + CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue); +//-----IAccessibility2 Implementation 2009 } else if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("VisibleArea"))) { diff --git a/sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx b/sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx index 384146f6b0d8..bec31f035e12 100644 --- a/sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx +++ b/sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx @@ -119,5 +119,12 @@ AccessiblePresentationGraphicShape::~AccessiblePresentationGraphicShape (void) return aDG(); } +//IAccessibility2 Implementation 2009----- +sal_Int16 SAL_CALL AccessiblePresentationGraphicShape::getAccessibleRole () + throw (::com::sun::star::uno::RuntimeException) +{ + return AccessibleRole::GRAPHIC ; +} +//-----IAccessibility2 Implementation 2009 } // end of namespace accessibility diff --git a/sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx b/sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx index 5769d83ed195..41c853e2a052 100644 --- a/sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx +++ b/sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx @@ -140,5 +140,13 @@ AccessiblePresentationOLEShape::~AccessiblePresentationOLEShape (void) return aDG(); } +//IAccessibility2 Implementation 2009----- +// Return this object's role. +sal_Int16 SAL_CALL AccessiblePresentationOLEShape::getAccessibleRole () + throw (::com::sun::star::uno::RuntimeException) +{ + return AccessibleRole::EMBEDDED_OBJECT ; +} +//-----IAccessibility2 Implementation 2009 } // end of namespace accessibility diff --git a/sd/source/ui/accessibility/AccessiblePresentationShape.cxx b/sd/source/ui/accessibility/AccessiblePresentationShape.cxx index 7e2cfa7f3cc9..57ce9fe30b36 100644 --- a/sd/source/ui/accessibility/AccessiblePresentationShape.cxx +++ b/sd/source/ui/accessibility/AccessiblePresentationShape.cxx @@ -27,6 +27,11 @@ #include "SdShapeTypes.hxx" +//IAccessibility2 Implementation 2009----- +#include "accessibility.hrc" +#include "sdresid.hxx" +#include <tools/string.hxx> +//-----IAccessibility2 Implementation 2009 #include <svx/DescriptionGenerator.hxx> #include <rtl/ustring.h> @@ -77,38 +82,51 @@ AccessiblePresentationShape::~AccessiblePresentationShape (void) ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape); switch (nShapeType) { + //IAccessibility2 Implementation 2009----- case PRESENTATION_TITLE: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTitle")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTitle")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_TITLE_N))); break; case PRESENTATION_OUTLINER: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOutliner")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOutliner")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_OUTLINER_N))); break; case PRESENTATION_SUBTITLE: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressSubtitle")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressSubtitle")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_SUBTITLE_N))); break; case PRESENTATION_PAGE: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPage")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPage")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_PAGE_N))); break; case PRESENTATION_NOTES: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressNotes")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressNotes")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_NOTES_N))); break; case PRESENTATION_HANDOUT: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHandout")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHandout")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_HANDOUT_N))); break; case PRESENTATION_HEADER: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHeader")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHeader")); + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_N)) ); break; case PRESENTATION_FOOTER: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressFooter")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressFooter")); + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_N)) ); break; case PRESENTATION_DATETIME: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressDateAndTime")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressDateAndTime")); + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_N)) ); break; case PRESENTATION_PAGENUMBER: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPageNumber")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPageNumber")); + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_N)) ); break; default: - sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape")); + //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape")); + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_UNKNOWN_N))); + //-----IAccessibility2 Implementation 2009 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY); if (xDescriptor.is()) sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": ")) @@ -126,42 +144,67 @@ AccessiblePresentationShape::~AccessiblePresentationShape (void) throw (::com::sun::star::uno::RuntimeException) { // return createAccessibleName (); + ::rtl::OUString sDescription; DescriptionGenerator aDG (mxShape); ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape); switch (nShapeType) { + //IAccessibility2 Implementation 2009----- case PRESENTATION_TITLE: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationTitleShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationTitleShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_TITLE_D)) ); + aDG.Initialize (sDescription); break; case PRESENTATION_OUTLINER: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationOutlinerShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationOutlinerShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_OUTLINER_D)) ); + aDG.Initialize (sDescription); //PresentationOutlinerShape break; case PRESENTATION_SUBTITLE: aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationSubtitleShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_SUBTITLE_D)) ); + aDG.Initialize (sDescription); //PresentationSubtitleShape break; case PRESENTATION_PAGE: aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_PAGE_D)) ); + aDG.Initialize (sDescription); //PresentationPageShape break; case PRESENTATION_NOTES: aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationNotesShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NOTES_D)) ); + aDG.Initialize (sDescription); //PresentationNotesShape break; case PRESENTATION_HANDOUT: aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHandoutShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HANDOUT_D)) ); + aDG.Initialize (sDescription); //PresentationHandoutShape break; case PRESENTATION_HEADER: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHeaderShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHeaderShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_D)) ); + aDG.Initialize (sDescription); //PresentationHeaderShape break; case PRESENTATION_FOOTER: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationFooterShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationFooterShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_D)) ); + aDG.Initialize (sDescription); //PresentationFooterShape break; case PRESENTATION_DATETIME: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationDateAndTimeShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationDateAndTimeShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_D)) ); + aDG.Initialize (sDescription); //PresentationDateShape break; case PRESENTATION_PAGENUMBER: - aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageNumberShape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageNumberShape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_D)) ); + aDG.Initialize (sDescription); //PresentationNumberShape break; default: - aDG.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation shape")); + //aDG.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation shape")); + sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_UNKNOWN_D)) ); + aDG.Initialize (sDescription); //Unknown accessible presentation shape + //-----IAccessibility2 Implementation 2009 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY); if (xDescriptor.is()) { @@ -172,5 +215,54 @@ AccessiblePresentationShape::~AccessiblePresentationShape (void) return aDG(); } +//IAccessibility2 Implementation 2009----- +::rtl::OUString AccessiblePresentationShape::GetStyle() +{ + ::rtl::OUString sName; + + ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape); + switch (nShapeType) + { + case PRESENTATION_TITLE: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_TITLE_N_STYLE))); + break; + case PRESENTATION_OUTLINER: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE))); + break; + case PRESENTATION_SUBTITLE: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE))); + break; + case PRESENTATION_PAGE: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_PAGE_N_STYLE))); + break; + case PRESENTATION_NOTES: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_NOTES_N_STYLE))); + break; + case PRESENTATION_HANDOUT: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE))); + break; + case PRESENTATION_FOOTER: + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE)) ); + break; + case PRESENTATION_HEADER: + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_N_STYLE)) ); + break; + case PRESENTATION_DATETIME: + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_N_STYLE)) ); + break; + case PRESENTATION_PAGENUMBER: + sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE)) ); + break; + default: + sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE))); + uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY); + if (xDescriptor.is()) + sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": ")) + + xDescriptor->getShapeType(); + } + + return sName; +} +//-----IAccessibility2 Implementation 2009 } // end of namespace accessibility diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index 1a34101bb8a8..5c78b76ebd71 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -199,7 +199,9 @@ sal_Int16 SAL_CALL AccessibleSlideSorterObject::getAccessibleRole (void) throw (uno::RuntimeException) { ThrowIfDisposed(); - static sal_Int16 nRole = AccessibleRole::LIST_ITEM; + //set Role = Shape + //static sal_Int16 nRole = AccessibleRole::LIST_ITEM; + static sal_Int16 nRole = AccessibleRole::SHAPE; return nRole; } diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 9b3cf9af5fad..efa4f69c8356 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -91,6 +91,7 @@ public: DECL_LINK(FocusChangeListener, void*); DECL_LINK(UpdateChildrenCallback, void*); + void Activated(void); private: AccessibleSlideSorterView& mrAccessibleSlideSorter; ::sd::slidesorter::SlideSorter& mrSlideSorter; @@ -832,6 +833,11 @@ void AccessibleSlideSorterView::Implementation::RequestUpdateChildren (void) void AccessibleSlideSorterView::Implementation::UpdateChildren (void) { + //By default, all children should be accessable. So here workaround is to make all children visible. + // MT: THis was in UpdateVisibility, which has some similarity, and hg merge automatically has put it here. Correct?! + // In the IA2 CWS, also setting mnFirst/LastVisibleChild was commented out! + mnLastVisibleChild = maPageObjects.size(); + if (mbModelChangeLocked) { // Do nothing right now. When the flag is reset, this method is @@ -1023,6 +1029,22 @@ void AccessibleSlideSorterView::Implementation::Notify ( } +void AccessibleSlideSorterView::SwitchViewActivated (void) +{ + // Firstly, set focus to view + this->FireAccessibleEvent(AccessibleEventId::STATE_CHANGED, + Any(), + Any(AccessibleStateType::FOCUSED)); + + mpImpl->Activated(); +} + +void AccessibleSlideSorterView::Implementation::Activated() +{ + mrSlideSorter.GetController().GetFocusManager().ShowFocus(); + +} + IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWindowEvent*, pEvent) @@ -1079,27 +1101,40 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, FocusChangeListener, void*, sal_Int32 nNewFocusedIndex ( mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex()); + sal_Bool bHasFocus = mrSlideSorter.GetController().GetFocusManager().IsFocusShowing(); + if (!bHasFocus) + nNewFocusedIndex = -1; + + // add a checker whether the focus event is sent out. Only after sent, the mnFocusedIndex should be updated. + sal_Bool bSentFocus = sal_False; if (nNewFocusedIndex != mnFocusedIndex) { if (mnFocusedIndex >= 0) { AccessibleSlideSorterObject* pObject = GetAccessibleChild(mnFocusedIndex); if (pObject != NULL) + { pObject->FireAccessibleEvent( AccessibleEventId::STATE_CHANGED, Any(AccessibleStateType::FOCUSED), Any()); + bSentFocus = sal_True; + } } if (nNewFocusedIndex >= 0) { AccessibleSlideSorterObject* pObject = GetAccessibleChild(nNewFocusedIndex); if (pObject != NULL) + { pObject->FireAccessibleEvent( AccessibleEventId::STATE_CHANGED, Any(), Any(AccessibleStateType::FOCUSED)); + bSentFocus = sal_True; + } } - mnFocusedIndex = nNewFocusedIndex; + if (bSentFocus == sal_True) + mnFocusedIndex = nNewFocusedIndex; } return 1; } diff --git a/sd/source/ui/accessibility/accessibility.hrc b/sd/source/ui/accessibility/accessibility.hrc index 5578b323da69..b408de19710d 100644 --- a/sd/source/ui/accessibility/accessibility.hrc +++ b/sd/source/ui/accessibility/accessibility.hrc @@ -44,6 +44,46 @@ #define SID_SD_A11Y_I_HANDOUTVIEW_N (SID_SD_A11Y_START + 10) #define SID_SD_A11Y_I_HANDOUTVIEW_D (SID_SD_A11Y_START + 11) +//IAccessibility2 Implementation 2009----- +#define SID_SD_A11Y_P_TITLE_N (SID_SD_A11Y_START + 12) +#define SID_SD_A11Y_P_TITLE_D (SID_SD_A11Y_START + 13) +#define SID_SD_A11Y_P_OUTLINER_N (SID_SD_A11Y_START + 14) +#define SID_SD_A11Y_P_OUTLINER_D (SID_SD_A11Y_START + 15) +#define SID_SD_A11Y_P_SUBTITLE_N (SID_SD_A11Y_START + 16) +#define SID_SD_A11Y_P_SUBTITLE_D (SID_SD_A11Y_START + 17) +#define SID_SD_A11Y_P_PAGE_N (SID_SD_A11Y_START + 18) +#define SID_SD_A11Y_P_PAGE_D (SID_SD_A11Y_START + 19) +#define SID_SD_A11Y_P_NOTES_N (SID_SD_A11Y_START + 20) +#define SID_SD_A11Y_P_NOTES_D (SID_SD_A11Y_START + 21) +#define SID_SD_A11Y_P_HANDOUT_N (SID_SD_A11Y_START + 22) +#define SID_SD_A11Y_P_HANDOUT_D (SID_SD_A11Y_START + 23) +#define SID_SD_A11Y_P_UNKNOWN_N (SID_SD_A11Y_START + 24) +#define SID_SD_A11Y_P_UNKNOWN_D (SID_SD_A11Y_START + 25) +#define SID_SD_A11Y_P_FOOTER_N (SID_SD_A11Y_START + 26) +#define SID_SD_A11Y_P_FOOTER_D (SID_SD_A11Y_START + 27) +#define SID_SD_A11Y_P_HEADER_N (SID_SD_A11Y_START + 28) +#define SID_SD_A11Y_P_HEADER_D (SID_SD_A11Y_START + 29) +#define SID_SD_A11Y_P_DATE_N (SID_SD_A11Y_START + 30) +#define SID_SD_A11Y_P_DATE_D (SID_SD_A11Y_START + 31) +#define SID_SD_A11Y_P_NUMBER_N (SID_SD_A11Y_START + 32) +#define SID_SD_A11Y_P_NUMBER_D (SID_SD_A11Y_START + 33) +#define SID_SD_A11Y_D_PRESENTATION (SID_SD_A11Y_START + 34) +#define SID_SD_A11Y_P_TITLE_N_STYLE (SID_SD_A11Y_START + 35) +#define SID_SD_A11Y_P_OUTLINER_N_STYLE (SID_SD_A11Y_START + 36) +#define SID_SD_A11Y_P_SUBTITLE_N_STYLE (SID_SD_A11Y_START + 37) +#define SID_SD_A11Y_P_PAGE_N_STYLE (SID_SD_A11Y_START + 38) +#define SID_SD_A11Y_P_NOTES_N_STYLE (SID_SD_A11Y_START + 39) +#define SID_SD_A11Y_P_HANDOUT_N_STYLE (SID_SD_A11Y_START + 40) +#define SID_SD_A11Y_P_UNKNOWN_N_STYLE (SID_SD_A11Y_START + 41) +#define SID_SD_A11Y_P_FOOTER_N_STYLE (SID_SD_A11Y_START + 42) +#define SID_SD_A11Y_P_HEADER_N_STYLE (SID_SD_A11Y_START + 43) +#define SID_SD_A11Y_P_DATE_N_STYLE (SID_SD_A11Y_START + 44) +#define SID_SD_A11Y_P_NUMBER_N_STYLE (SID_SD_A11Y_START + 45) +#define SID_SD_A11Y_I_PREVIEW_N (SID_SD_A11Y_START + 46) +#define SID_SD_A11Y_I_PREVIEW_D (SID_SD_A11Y_START + 47) +#define SID_SD_A11Y_I_PREVIEW_SUFFIX (SID_SD_A11Y_START + 48) +#define SID_SD_A11Y_D_PRESENTATION_READONLY (SID_SD_A11Y_START + 49) +//-----IAccessibility2 Implementation 2009 #endif /* _SD_ACCESSIBILITY_HRC */ diff --git a/sd/source/ui/accessibility/accessibility.src b/sd/source/ui/accessibility/accessibility.src index 39d3e5e3aa0b..43bc07e470c6 100644 --- a/sd/source/ui/accessibility/accessibility.src +++ b/sd/source/ui/accessibility/accessibility.src @@ -87,25 +87,174 @@ String SID_SD_A11Y_I_HANDOUTVIEW_D Text [ en-US ] = "This is where you decide on the layout for handouts."; }; +//IAccessibility2 Implementation 2009----- +String SID_SD_A11Y_P_TITLE_N +{ + Text [ en-US ] = "PresentationTitle"; +}; +String SID_SD_A11Y_P_OUTLINER_N +{ + Text [ en-US ] = "PresentationOutliner"; +}; +String SID_SD_A11Y_P_SUBTITLE_N +{ + Text [ en-US ] = "PresentationSubtitle"; +}; +String SID_SD_A11Y_P_PAGE_N +{ + Text [ en-US ] = "PresentationPage"; +}; +String SID_SD_A11Y_P_NOTES_N +{ + Text [ en-US ] = "PresentationNotes"; +}; +String SID_SD_A11Y_P_HANDOUT_N +{ + Text [ en-US ] = "Handout"; +}; +String SID_SD_A11Y_P_UNKNOWN_N +{ + Text [ en-US ] = "UnknownAccessiblePresentationShape"; +}; +String SID_SD_A11Y_P_TITLE_D +{ + Text [ en-US ] = "PresentationTitleShape"; +}; +String SID_SD_A11Y_P_OUTLINER_D +{ + Text [ en-US ] = "PresentationOutlinerShape"; +}; +String SID_SD_A11Y_P_SUBTITLE_D +{ + Text [ en-US ] = "PresentationSubtitleShape"; +}; +String SID_SD_A11Y_P_PAGE_D +{ + Text [ en-US ] = "PresentationPageShape"; +}; +String SID_SD_A11Y_P_NOTES_D +{ + Text [ en-US ] = "PresentationNotesShape"; +}; +String SID_SD_A11Y_P_HANDOUT_D +{ + Text [ en-US ] = "PresentationHandoutShape"; +}; +String SID_SD_A11Y_P_UNKNOWN_D +{ + Text [ en-US ] = "Unknown accessible presentation shape"; +}; +String SID_SD_A11Y_P_FOOTER_N +{ + Text [ en-US ] = "PresentationFooter"; +}; +String SID_SD_A11Y_P_FOOTER_D +{ + Text [ en-US ] = "PresentationFooterShape"; +}; +String SID_SD_A11Y_P_HEADER_N +{ + Text [ en-US ] = "PresentationHeader"; +}; +String SID_SD_A11Y_P_HEADER_D +{ + Text [ en-US ] = "PresentationHeaderShape"; +}; +String SID_SD_A11Y_P_DATE_N +{ + Text [ en-US ] = "PresentationDateAndTime"; +}; +String SID_SD_A11Y_P_DATE_D +{ + Text [ en-US ] = "PresentationDateAndTimeShape"; +}; +String SID_SD_A11Y_P_NUMBER_N +{ + Text [ en-US ] = "PresentationPageNumber"; +}; +String SID_SD_A11Y_P_NUMBER_D +{ + Text [ en-US ] = "PresentationPageNumberShape"; +}; +String SID_SD_A11Y_D_PRESENTATION +{ + Text [ en-US ] = "%PRODUCTNAME Presentation"; +}; +String SID_SD_A11Y_P_TITLE_N_STYLE +{ + Text [ en-US ] = "Title"; +}; +String SID_SD_A11Y_P_OUTLINER_N_STYLE +{ + Text [ en-US ] = "Outliner"; +}; +String SID_SD_A11Y_P_SUBTITLE_N_STYLE +{ + Text [ en-US ] = "Sub Title"; +}; +String SID_SD_A11Y_P_PAGE_N_STYLE +{ + Text [ en-US ] = "Page"; +}; +String SID_SD_A11Y_P_NOTES_N_STYLE +{ + Text [ en-US ] = "Notes"; +}; +String SID_SD_A11Y_P_HANDOUT_N_STYLE +{ + Text [ en-US ] = "Handout"; +}; +String SID_SD_A11Y_P_UNKNOWN_N_STYLE +{ + Text [ en-US ] = "Unknown Accessible Presentation Shape"; +}; +String SID_SD_A11Y_P_FOOTER_N_STYLE +{ + Text [ en-US ] = "Footer"; +}; +String SID_SD_A11Y_P_HEADER_N_STYLE +{ + Text [ en-US ] = "Header"; +}; +String SID_SD_A11Y_P_DATE_N_STYLE +{ + Text [ en-US ] = "Date"; +}; +String SID_SD_A11Y_P_NUMBER_N_STYLE +{ + Text [ en-US ] = "Number"; +}; +String SID_SD_A11Y_I_PREVIEW_N +{ + Text [ en-US ] = "Preview View"; +}; +String SID_SD_A11Y_I_PREVIEW_D +{ + Text [ en-US ] = "This is where you print preview pages."; +}; +String SID_SD_A11Y_I_PREVIEW_SUFFIX +{ + Text [ en-US ] = "(Preview mode)"; +}; - - - - - +String SID_SD_A11Y_D_PRESENTATION_READONLY +{ + Text [ en-US ] = "(read-only)"; +}; +//-----IAccessibility2 Implementation 2009 diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index aec9d61a63d1..f0138525df43 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -119,6 +119,9 @@ SdNavigatorWin::SdNavigatorWin( // set focus to listbox, otherwise it is in the toolbox which is only useful // for keyboard navigation maTlbObjects.GrabFocus(); +//IAccessibility2 Implementation 2009----- + maTlbObjects.SetSdNavigatorWinFlag(sal_True); +//-----IAccessibility2 Implementation 2009 // DragTypeListBox maLbDocs.SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) ); @@ -175,6 +178,28 @@ SdNavigatorWin::~SdNavigatorWin() // ----------------------------------------------------------------------- +//IAccessibility2 Implementation 2009----- +//Solution: when object is marked , fresh the corresponding entry tree . +//================================================== +void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) +{ + SdDrawDocument* pNonConstDoc = (SdDrawDocument*) pDoc; // const as const can... + sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh(); + String aDocShName( pDocShell->GetName() ); + String aDocName = pDocShell->GetMedium()->GetName(); + maTlbObjects.SetSaveTreeItemStateFlag(sal_True); //Added by yanjun for sym2_6385 + maTlbObjects.Clear(); + maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten + maTlbObjects.SetSaveTreeItemStateFlag(sal_False); //Added by yanjun for sym2_6385 + RefreshDocumentLB(); + maLbDocs.SelectEntry( aDocShName ); +} +void SdNavigatorWin::FreshEntry( ) +{ + maTlbObjects.FreshCurEntry(); +} +//================================================== +//-----IAccessibility2 Implementation 2009 void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) { SdDrawDocument* pNonConstDoc = (SdDrawDocument*) pDoc; // const as const can... @@ -245,7 +270,16 @@ NavigatorDragType SdNavigatorWin::GetNavigatorDragType() } // ----------------------------------------------------------------------- - +//IAccessibility2 Implementation 2009----- +//Solution: Get SdDrawDocShell +sd::DrawDocShell* SdNavigatorWin::GetDrawDocShell( const SdDrawDocument* pDoc ) +{ + if( !pDoc ) + return NULL; // const as const can... + sd::DrawDocShell* pDocShell = pDoc->GetDocSh(); + return pDocShell; +} +//-----IAccessibility2 Implementation 2009 IMPL_LINK( SdNavigatorWin, SelectToolboxHdl, void *, EMPTYARG ) { @@ -403,6 +437,10 @@ IMPL_LINK( SdNavigatorWin, ClickObjectHdl, void *, EMPTYARG ) SfxStringItem aItem( SID_NAVIGATOR_OBJECT, aStr ); mpBindings->GetDispatcher()->Execute( SID_NAVIGATOR_OBJECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L ); +//IAccessibility2 Implementation 2009----- + //Solution: set sign variable + maTlbObjects.MarkCurEntry(aStr); +//-----IAccessibility2 Implementation 2009 // #98821# moved here from SetGetFocusHdl. Reset the // focus only if something has been selected in the diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index e49181d35717..b57a860126de 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -252,6 +252,7 @@ sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId (void) SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId ) : SvTreeListBox ( pParentWin, rSdResId ) +, bisInSdNavigatorWin ( sal_False ) , mpParent ( pParentWin ) , mpDoc ( NULL ) , mpBookmarkDoc ( NULL ) @@ -265,7 +266,6 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId ) , mpDropNavWin ( NULL ) , mbShowAllShapes ( false ) , mbShowAllPages ( false ) - { // Tree-ListBox mit Linien versehen SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES | @@ -300,6 +300,184 @@ SdPageObjsTLB::~SdPageObjsTLB() delete mpMedium; } +//IAccessibility2 Implementation 2009----- +// helper function for GetEntryAltText and GetEntryLongDescription +String SdPageObjsTLB::getAltLongDescText( SvLBoxEntry* pEntry , sal_Bool isAltText) const +{ + sal_uInt16 maxPages = mpDoc->GetPageCount(); + sal_uInt16 pageNo; + SdrObject* pObj = NULL; + SdPage* pPage = NULL; + + + String ParentName = GetEntryText( GetRootLevelParent( pEntry ) ); + + for( pageNo = 0; pageNo < maxPages; pageNo++ ) + { + pPage = (SdPage*) mpDoc->GetPage( pageNo ); + if( pPage->GetPageKind() != PK_STANDARD ) continue; + if( pPage->GetName() != ParentName ) continue; + SdrObjListIter aIter( *pPage, IM_FLAT ); + while( aIter.IsMore() ) + { + pObj = aIter.Next(); + if( GetEntryText(pEntry) == GetObjectName( pObj ) ) + { + if( isAltText ) + return pObj->GetTitle(); + else + return pObj->GetDescription(); + } + } + } + return String(); + +} + +String SdPageObjsTLB::GetEntryAltText( SvLBoxEntry* pEntry ) const +{ + return getAltLongDescText( pEntry, sal_True ); +} + +String SdPageObjsTLB::GetEntryLongDescription( SvLBoxEntry* pEntry ) const +{ + return getAltLongDescText( pEntry, sal_False); +} + +void SdPageObjsTLB::MarkCurEntry( const String& rName ) +{ + + if( rName.Len() ) + { + SvLBoxEntry* pCurEntry =GetCurEntry(); + SvLBoxEntry* pEntry =NULL; + String aTmp1; + String aTmp2; + + if( GetParent(pCurEntry)==NULL ) + { + aTmp1 = GetEntryText( pCurEntry ); + for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) + { + if(GetParent( pEntry )==NULL) + continue; + aTmp2 = GetEntryText( GetParent( pEntry )); + if( aTmp1 != aTmp2) + { + // IA2 CWS. MT: Removed in SvLBoxEntry for now - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this + pEntry->SetMarked(sal_False); + } + } + + } + else + { + for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) + { + aTmp2 = GetEntryText( pEntry ); + if( aTmp2 == rName) + { + pEntry->SetMarked(sal_True); + } + else + { + pEntry->SetMarked(sal_False); + } + } + } + } + Invalidate(); +} + +void SdPageObjsTLB:: FreshCurEntry() +{ + SvLBoxEntry* pEntry =NULL; + for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) + { + pEntry->SetMarked(sal_False); + } + Invalidate(); +} + +class SdContentLBoxString : public SvLBoxString +{ +public: + SdContentLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, + const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} + + virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, + SvLBoxEntry* pEntry); +}; + +void SdPageObjsTLB::InitEntry(SvLBoxEntry* pEntry, + const XubString& rStr ,const Image& rImg1,const Image& rImg2,SvLBoxButtonKind eButtonKind) +{ + sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + SdContentLBoxString* pStr = new SdContentLBoxString( pEntry, 0, pCol->GetText() ); + pEntry->ReplaceItem( pStr, nColToHilite ); +} + +void SdContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, + SvLBoxEntry* pEntry ) +{ + // IA2 CWS. MT: Removed for now (also in SvLBoxEntry) - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this + /* + if (pEntry->IsMarked()) + { + rDev.DrawText( rPos, GetText() ); + XubString str; + str = XubString::CreateFromAscii("*"); + Point rPosStar(rPos.X()-6,rPos.Y()); + Font aOldFont( rDev.GetFont()); + Font aFont(aOldFont); + Color aCol( aOldFont.GetColor() ); + aCol.DecreaseLuminance( 200 ); + aFont.SetColor( aCol ); + rDev.SetFont( aFont ); + rDev.DrawText( rPosStar, str); + rDev.SetFont( aOldFont ); + } + else + */ + SvLBoxString::Paint( rPos, rDev, nFlags, pEntry); + +} + +void SdPageObjsTLB::SaveExpandedTreeItemState(SvLBoxEntry* pEntry, vector<String>& vectTreeItem) +{ + if (pEntry) + { + SvLBoxEntry* pListEntry = pEntry; + while (pListEntry) + { + if (pListEntry->HasChilds()) + { + if (IsExpanded(pListEntry)) + vectTreeItem.push_back(GetEntryText(pListEntry)); + SvLBoxEntry* pChildEntry = FirstChild(pListEntry); + SaveExpandedTreeItemState(pChildEntry, vectTreeItem); + } + pListEntry = NextSibling(pListEntry); + } + } +} +void SdPageObjsTLB::Clear() +{ + //Save the expanded tree item + if (mbSaveTreeItemState) + { + maSelectionEntryText = String(); + maTreeItem.clear(); + if (GetCurEntry()) + maSelectionEntryText = GetSelectEntry(); + SvLBoxEntry* pEntry = FirstChild(NULL); + SaveExpandedTreeItemState(pEntry, maTreeItem); + } + return SvTreeListBox::Clear(); +} +//-----IAccessibility2 Implementation 2009 /************************************************************************* |* |* return name of object @@ -458,6 +636,10 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, const St } if( aSelection.Len() ) SelectEntry( aSelection ); + else if (mbSaveTreeItemState && maSelectionEntryText.Len()) + { + SelectEntry(maSelectionEntryText); + } } /************************************************************************* @@ -537,6 +719,30 @@ void SdPageObjsTLB::AddShapeList ( IM_FLAT, false /*not reverse*/); + //IAccessibility2 Implementation 2009----- + sal_Bool bMarked=sal_False; + if(bisInSdNavigatorWin) + { + Window* pWindow=NULL; + SdNavigatorWin* pSdNavigatorWin=NULL; + sd::DrawDocShell* pSdDrawDocShell = NULL; + if(pEntry) + pWindow=(Window*)GetParent(pEntry); + if(pWindow) + pSdNavigatorWin = (SdNavigatorWin*)pWindow; + if( pSdNavigatorWin ) + pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if(pSdDrawDocShell) + bMarked=pSdDrawDocShell->IsMarked(pShape); + if(pEntry) + { + if(bMarked) + pEntry->SetMarked(sal_True); + else + pEntry->SetMarked( sal_False ); + } + } + //-----IAccessibility2 Implementation 2009 while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); @@ -551,7 +757,29 @@ void SdPageObjsTLB::AddShapeList ( { SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry, false, LIST_APPEND, pObj); - + //IAccessibility2 Implementation 2009----- + if(bisInSdNavigatorWin) + { + Window* pWindow=NULL; + SdNavigatorWin* pSdNavigatorWin=NULL; + sd::DrawDocShell* pSdDrawDocShell = NULL; + if(pNewEntry) + pWindow=(Window*)GetParent(pNewEntry); + if(pWindow) + pSdNavigatorWin = (SdNavigatorWin*)pWindow; + if( pSdNavigatorWin ) + pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if(pSdDrawDocShell) + bMarked=pSdDrawDocShell->IsMarked((SdrObject*)pObj); + if(pNewEntry) + { + if(bMarked) + pNewEntry->SetMarked(sal_True); + else + pNewEntry->SetMarked( sal_False ); + } + } + //-----IAccessibility2 Implementation 2009 SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST ); } @@ -559,7 +787,33 @@ void SdPageObjsTLB::AddShapeList ( { SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry, false, LIST_APPEND, pObj ); - + //IAccessibility2 Implementation 2009----- + if(bisInSdNavigatorWin) + { + Window* pWindow=NULL; + SdNavigatorWin* pSdNavigatorWin=NULL; + sd::DrawDocShell* pSdDrawDocShell = NULL; + if(pNewEntry) + pWindow=(Window*)GetParent(pNewEntry); + if(pWindow) + pSdNavigatorWin = (SdNavigatorWin*)pWindow; + if( pSdNavigatorWin ) + pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if(pSdDrawDocShell) + bMarked=pSdDrawDocShell->IsMarked((SdrObject*)pObj); + if(pNewEntry) + { + if(bMarked) + { + pNewEntry->SetMarked(sal_True); + } + else + { + pNewEntry->SetMarked( sal_False ); + } + } + } + //-----IAccessibility2 Implementation 2009 SetExpandedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST ); } @@ -577,7 +831,33 @@ void SdPageObjsTLB::AddShapeList ( { SvLBoxEntry* pNewEntry = InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, pEntry, false, LIST_APPEND, pObj ); - + //IAccessibility2 Implementation 2009----- + if(bisInSdNavigatorWin) + { + Window* pWindow=NULL; + SdNavigatorWin* pSdNavigatorWin=NULL; + sd::DrawDocShell* pSdDrawDocShell = NULL; + if(pNewEntry) + pWindow=(Window*)GetParent(pNewEntry); + if(pWindow) + pSdNavigatorWin = (SdNavigatorWin*)pWindow; + if( pSdNavigatorWin ) + pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if(pSdDrawDocShell) + bMarked=pSdDrawDocShell->IsMarked((SdrObject*)pObj); + if(pNewEntry) + { + if(bMarked) + { + pNewEntry->SetMarked(sal_True); + } + else + { + pNewEntry->SetMarked( sal_False ); + } + } + } + //-----IAccessibility2 Implementation 2009 SetExpandedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST ); SetCollapsedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST ); } @@ -600,6 +880,24 @@ void SdPageObjsTLB::AddShapeList ( pEntry, bIsExcluded ? rIconProvider.maImgPageObjsExclH : rIconProvider.maImgPageObjsH, BMP_COLOR_HIGHCONTRAST); + //IAccessibility2 Implementation 2009----- + if (mbSaveTreeItemState) + { + vector<String>:: iterator iteStart = maTreeItem.begin(); + while (iteStart != maTreeItem.end()) + { + String strEntry = GetEntryText(pEntry); + if (*iteStart == strEntry) + { + Expand( pEntry ); + break; + } + ++iteStart; + } + } + else + Expand( pEntry ); + //-----IAccessibility2 Implementation 2009 } } @@ -976,6 +1274,62 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt ) DoubleClickHdl(); } +//IAccessibility2 Implementation 2009----- + else if (rKEvt.GetKeyCode().GetCode() == KEY_SPACE) + { + if(bisInSdNavigatorWin) + { + sal_Bool bMarked=sal_False; + SvLBoxEntry* pNewEntry = GetCurEntry(); + if( GetParent(pNewEntry) == NULL ) + return; + String aStr=GetSelectEntry(); + Window* pWindow=NULL; + SdNavigatorWin* pSdNavigatorWin=NULL; + sd::DrawDocShell* pSdDrawDocShell = NULL; + if(pNewEntry) + pWindow=(Window*)GetParent(pNewEntry); + if(pWindow) + pSdNavigatorWin = (SdNavigatorWin*)pWindow; + if( pSdNavigatorWin ) + pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if(pSdDrawDocShell) + { + pSdDrawDocShell->GotoTreeBookmark(aStr); + bMarked=pSdDrawDocShell->GetObjectIsmarked(aStr); + } + //Removed by yanjun for sym2_6385 + //The symphony2.0 can support morn than one level tree list, also support to select tow or more items in different level. + /* + SvLBoxEntry* pBeginEntry = First(); + if( pBeginEntry ) + { + if( GetParent(pBeginEntry) != GetParent(pNewEntry) ) + pBeginEntry->SetMarked( sal_False ); + SvLBoxEntry* pNextEntry = Next( pBeginEntry ); + while( pNextEntry ) + { + if( GetParent(pNextEntry) != GetParent(pNewEntry) ) + pNextEntry->SetMarked( sal_False ); + pNextEntry = Next( pNextEntry ); + } + } + End*/ + if(pNewEntry) + { + if(bMarked) + { + pNewEntry->SetMarked(sal_True); + } + else + { + pNewEntry->SetMarked( sal_False ); + } + } + Invalidate(); + } + } +//-----IAccessibility2 Implementation 2009 else SvTreeListBox::KeyInput( rKEvt ); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 022573ca85c4..97f49ff3cd07 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -95,6 +95,10 @@ #include "framework/FrameworkHelper.hxx" #include <tools/urlobj.hxx> +//IAccessibility2 Implementation 2009----- +#include <sfx2/viewfrm.hxx> +#include "SdUnoDrawView.hxx" +//-----IAccessibility2 Implementation 2009 using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::sd::framework::FrameworkHelper; @@ -578,6 +582,22 @@ sal_Bool DrawDocShell::Save() sal_Bool DrawDocShell::SaveAs( SfxMedium& rMedium ) { +//IAccessibility2 Implementation 2009----- + mpDoc->setDocAccTitle(String()); + SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this ); + if (pFrame1) + { + ::Window* pWindow = &pFrame1->GetWindow(); + if ( pWindow ) + { + ::Window* pSysWin = pWindow->GetSystemWindow(); + if ( pSysWin ) + { + pSysWin->SetAccessibleName(String()); + } + } + } +//-----IAccessibility2 Implementation 2009 mpDoc->StopWorkStartupDelay(); //TODO/LATER: why this?! @@ -915,6 +935,236 @@ bool DrawDocShell::GotoBookmark(const String& rBookmark) return (bFound); } +//IAccessibility2 Implementation 2009----- +//Solution: If object is marked , return true , else return false . +sal_Bool DrawDocShell::IsMarked( SdrObject* pObject ) +{ + sal_Bool bisMarked =sal_False; + DrawViewShell* pDrViewSh = dynamic_cast< DrawViewShell* >(mpViewShell); + + if(pDrViewSh && pObject) + { + bisMarked = pDrViewSh->GetView()->isSdrObjectSelected(*pObject); + } + + return bisMarked; +} +//Solution: If object is marked , return true , else return false . +sal_Bool DrawDocShell::GetObjectIsmarked(const String& rBookmark) +{ + OSL_TRACE("GotoBookmark %s", ::rtl::OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr()); + sal_Bool bUnMark = sal_False; + DrawViewShell* pDrViewSh = dynamic_cast< DrawViewShell* >(mpViewShell); + + if(pDrViewSh) + { + String aBookmark( rBookmark ); + + if( rBookmark.Len() && rBookmark.GetChar( 0 ) == sal_Unicode('#') ) + aBookmark = rBookmark.Copy( 1 ); + + // Ist das Bookmark eine Seite? + bool bIsMasterPage; + sal_uInt32 nPgNum(mpDoc->GetPageByName(aBookmark, bIsMasterPage)); + SdrObject* pObj = NULL; + + if (nPgNum == SDRPAGE_NOTFOUND) + { + // Ist das Bookmark ein Objekt? + pObj = mpDoc->GetObj(aBookmark); + + if (pObj) + { + nPgNum = pObj->getSdrPageFromSdrObject()->GetPageNumber(); + } + } + + if (nPgNum != SDRPAGE_NOTFOUND) + { + /********************************************************** + * Zur Seite springen + **********************************************************/ + + SdPage* pPage = (SdPage*) mpDoc->GetPage(nPgNum); + + PageKind eNewPageKind = pPage->GetPageKind(); + + if (eNewPageKind != pDrViewSh->GetPageKind()) + { + // Arbeitsbereich wechseln + GetFrameView()->SetPageKind(eNewPageKind); + ( ( mpViewShell && mpViewShell->GetViewFrame() ) ? + mpViewShell->GetViewFrame() : SfxViewFrame::Current() )-> + GetDispatcher()->Execute( SID_VIEWSHELL0, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD ); + + // Die aktuelle ViewShell hat sich geaendert! + pDrViewSh = (DrawViewShell*) mpViewShell; + } + + EditMode eNewEditMode = EM_PAGE; + + if( bIsMasterPage ) + { + eNewEditMode = EM_MASTERPAGE; + } + + if (eNewEditMode != pDrViewSh->GetEditMode()) + { + // EditMode setzen + pDrViewSh->ChangeEditMode(eNewEditMode, sal_False); + } + + // Jump to the page. This is done by using the API because this + // takes care of all the little things to be done. Especially + // writing the view data to the frame view (see bug #107803#). + sal_uInt16 nSdPgNum = (nPgNum - 1) / 2; + SdUnoDrawView* pUnoDrawView = new SdUnoDrawView ( + pDrViewSh->GetViewShellBase().GetDrawController(), + *pDrViewSh, + *pDrViewSh->GetView()); + if (pUnoDrawView != NULL) + { + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage> xDrawPage ( + pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); + pUnoDrawView->setCurrentPage (xDrawPage); + } + else + { + // As a fall back switch to the page via the core. + DBG_ASSERT (pUnoDrawView!=NULL, + "SdDrawDocShell::GotoBookmark: can't switch page via API"); + pDrViewSh->SwitchPage(nSdPgNum); + } + delete pUnoDrawView; + + + if(pObj) + { + // Objekt einblenden und selektieren + pDrViewSh->MakeVisibleAtView( + pObj->getObjectRange(pDrViewSh->GetView()), + *pDrViewSh->GetActiveWindow()); + + bUnMark = pDrViewSh->GetView()->isSdrObjectSelected(*pObj); + } + } + } + + return ( bUnMark); +} +//Solution: realize multi-selection of objects +sal_Bool DrawDocShell::GotoTreeBookmark(const String& rBookmark) +{ + OSL_TRACE("GotoBookmark %s", ::rtl::OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr()); + sal_Bool bFound = sal_False; + DrawViewShell* pDrViewSh = dynamic_cast< DrawViewShell* >(mpViewShell); + + if(pDrViewSh) + { + String aBookmark( rBookmark ); + + if( rBookmark.Len() && rBookmark.GetChar( 0 ) == sal_Unicode('#') ) + aBookmark = rBookmark.Copy( 1 ); + + // Ist das Bookmark eine Seite? + bool bIsMasterPage; + sal_uInt32 nPgNum(mpDoc->GetPageByName(aBookmark, bIsMasterPage)); + SdrObject* pObj = NULL; + + if (nPgNum == SDRPAGE_NOTFOUND) + { + // Ist das Bookmark ein Objekt? + pObj = mpDoc->GetObj(aBookmark); + + if (pObj) + { + nPgNum = pObj->getSdrPageFromSdrObject()->GetPageNumber(); + } + } + + if (nPgNum != SDRPAGE_NOTFOUND) + { + /********************************************************** + * Zur Seite springen + **********************************************************/ + bFound = sal_True; + SdPage* pPage = (SdPage*) mpDoc->GetPage(nPgNum); + + PageKind eNewPageKind = pPage->GetPageKind(); + + if (eNewPageKind != pDrViewSh->GetPageKind()) + { + // Arbeitsbereich wechseln + GetFrameView()->SetPageKind(eNewPageKind); + ( ( mpViewShell && mpViewShell->GetViewFrame() ) ? + mpViewShell->GetViewFrame() : SfxViewFrame::Current() )-> + GetDispatcher()->Execute( SID_VIEWSHELL0, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD ); + + // Die aktuelle ViewShell hat sich geaendert! + pDrViewSh = (DrawViewShell*) mpViewShell; + } + + EditMode eNewEditMode = EM_PAGE; + + if( bIsMasterPage ) + { + eNewEditMode = EM_MASTERPAGE; + } + + if (eNewEditMode != pDrViewSh->GetEditMode()) + { + // EditMode setzen + pDrViewSh->ChangeEditMode(eNewEditMode, sal_False); + } + + // Jump to the page. This is done by using the API because this + // takes care of all the little things to be done. Especially + // writing the view data to the frame view (see bug #107803#). + sal_uInt16 nSdPgNum = (nPgNum - 1) / 2; + SdUnoDrawView* pUnoDrawView = new SdUnoDrawView ( + pDrViewSh->GetViewShellBase().GetDrawController(), + *pDrViewSh, + *pDrViewSh->GetView()); + if (pUnoDrawView != NULL) + { + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage> xDrawPage ( + pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); + pUnoDrawView->setCurrentPage (xDrawPage); + } + else + { + // As a fall back switch to the page via the core. + DBG_ASSERT (pUnoDrawView!=NULL, + "SdDrawDocShell::GotoBookmark: can't switch page via API"); + pDrViewSh->SwitchPage(nSdPgNum); + } + delete pUnoDrawView; + + + if (pObj) + { + // Objekt einblenden und selektieren + pDrViewSh->MakeVisibleAtView( + pObj->getObjectRange(pDrViewSh->GetView()), + *pDrViewSh->GetActiveWindow()); + const bool bUnMark(pDrViewSh->GetView()->isSdrObjectSelected(*pObj)); + + pDrViewSh->GetView()->MarkObj(*pObj, bUnMark); + } + } + + SfxBindings& rBindings = ( ( mpViewShell && mpViewShell->GetViewFrame() ) ? + mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings(); + + rBindings.Invalidate(SID_NAVIGATOR_STATE, sal_True, sal_False); + rBindings.Invalidate(SID_NAVIGATOR_PAGENAME); + } + + return (bFound); +} +//-----IAccessibility2 Implementation 2009 /************************************************************************* |* |* SaveAsOwnFormat: wenn es eine Dokumentvorlage werden soll, @@ -1037,4 +1287,39 @@ void DrawDocShell::OpenBookmark( const String& rBookmarkURL ) ( mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs ); } +//IAccessibility2 Implementation 2009----- +void DrawDocShell::setDocAccTitle( const String& rTitle ) +{ + if (mpDoc ) + { + mpDoc->setDocAccTitle( rTitle ); + } +} +const String DrawDocShell::getDocAccTitle() const +{ + String sRet; + if (mpDoc) + { + sRet = mpDoc->getDocAccTitle(); + } + + return sRet; +} +void DrawDocShell::setDocReadOnly( sal_Bool bReadOnly) +{ + if (mpDoc ) + { + mpDoc->setDocReadOnly( bReadOnly ); + } +} +sal_Bool DrawDocShell::getDocReadOnly() const +{ + if (mpDoc) + { + return mpDoc->getDocReadOnly(); + } + + return sal_False; +} +//-----IAccessibility2 Implementation 2009 } // end of namespace sd diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 56b10cf8e707..3351da18056a 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -456,10 +456,16 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) // changeover to the next object if(!mpView->MarkNextObj( !aCode.IsShift() )) { - // #97016# No next object: go over open end and - // get first from the other side - mpView->UnmarkAllObj(); - mpView->MarkNextObj(!aCode.IsShift()); + //IAccessibility2 Implementation 2009----- + //If there is only one object, don't do the UnmarkAlllObj() & MarkNextObj(). + if ( mpView->getSelectedSdrObjectCount() > 1 ) + { + // #97016# No next object: go over open end and + // get first from the other side + mpView->UnmarkAllObj(); + mpView->MarkNextObj(!aCode.IsShift()); + } + //-----IAccessibility2 Implementation 2009 } // #97016# II diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index 5bf8dd9eb21a..665ac4d1bb5f 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -58,8 +58,14 @@ FuEditGluePoints::FuEditGluePoints ( ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq) - : FuDraw(pViewSh, pWin, pView, pDoc, rReq), - meLastSdrViewEditMode(SDREDITMODE_EDIT) +: FuDraw(pViewSh, pWin, pView, pDoc, rReq), + meLastSdrViewEditMode(SDREDITMODE_EDIT), +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point + maOldPoint(0, 0), + mbBeginInsertPoint(false) +//-----IAccessibility2 Implementation 2009 { } @@ -315,11 +321,113 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt) { mpView->SetActualOutDev( mpWindow ); +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point + //sal_Bool bReturn = FuDraw::KeyInput(rKEvt); + bool bReturn = FuDraw::KeyInput(rKEvt); + switch (rKEvt.GetKeyCode().GetCode()) + { + case KEY_UP: + case KEY_DOWN: + case KEY_LEFT: + case KEY_RIGHT: + { + if(rKEvt.GetKeyCode().IsShift()&& mpView->IsInsGluePointMode() ){ + long nX = 0; + long nY = 0; + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); + if (nCode == KEY_UP) + { + // Scroll nach oben + nX = 0; + nY =-1; + } + else if (nCode == KEY_DOWN) + { + // Scroll nach unten + nX = 0; + nY = 1; + } + else if (nCode == KEY_LEFT) + { + // Scroll nach links + nX =-1; + nY = 0; + } + else if (nCode == KEY_RIGHT) + { + // Scroll nach rechts + nX = 1; + nY = 0; + } + + const basegfx::B2DPoint aSelectCenterPixel( + mpWindow->GetViewTransformation() * mpView->getMarkedObjectSnapRange().getCenter()); + const Point aPoint(mbBeginInsertPoint + ? maOldPoint + : Point(basegfx::fround(aSelectCenterPixel.getX()), basegfx::fround(aSelectCenterPixel.getY()))); + const Point ePoint(aPoint + Point(nX, nY)); + + mpWindow->SetPointerPosPixel(ePoint); + + //simulate mouse move action + MouseEvent eMevt(ePoint, 1, 2, MOUSE_LEFT, 0); + MouseMove(eMevt); + + // ??? Point aPix(eMevt.GetPosPixel()); + maOldPoint = ePoint; + mbBeginInsertPoint = true; + bReturn = true; + } + } + break; + case KEY_RETURN: + if(rKEvt.GetKeyCode().IsShift() && mpView->IsInsGluePointMode() ) + { + if(mbBeginInsertPoint) + { + mpWindow->SetPointerPosPixel(maOldPoint); + //simulate mouse button down action + MouseEvent aMevt(maOldPoint, 1, 3, MOUSE_LEFT, KEY_SHIFT); + // MT IA2: Not used? + // sal_uInt16 ubuttons = aMevt.GetButtons(); + // sal_uInt16 uMod = aMevt.GetModifier(); + MouseButtonDown(aMevt); + mpWindow->CaptureMouse(); + //simulate mouse button up action + MouseEvent rMEvt(maOldPoint, 1, 17, MOUSE_LEFT, KEY_SHIFT); + MouseButtonUp(rMEvt); + bReturn= sal_True; + } + } + break; + } + if(!bReturn) + bReturn = FuDraw::KeyInput(rKEvt); +//-----IAccessibility2 Implementation 2009 return bReturn; } +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point +void FuEditGluePoints::ForcePointer(const MouseEvent* pMEvt) +{ + if(mbBeginInsertPoint && pMEvt) + { + MouseEvent aMEvt(pMEvt->GetPosPixel(), pMEvt->GetClicks(), + pMEvt->GetMode(), pMEvt->GetButtons(), pMEvt->GetModifier() & ~KEY_SHIFT); + FuDraw::ForcePointer(&aMEvt); + } + else + { + FuDraw::ForcePointer(pMEvt); + } +} +//-----IAccessibility2 Implementation 2009 /************************************************************************* |* |* Command-event diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 9c5da26e695c..a77827f95928 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -96,15 +96,22 @@ FuSelection::FuSelection ( ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq) - : FuDraw(pViewSh, pWin, pView, pDoc, rReq), - bTempRotation(false), - bSelectionChanged(false), - bHideAndAnimate(false), - pHdl(NULL), - bSuppressChangesOfSelection(false), - bMirrorSide0(false), - nEditMode(SID_BEZIER_MOVE), - pWaterCanCandidate(NULL) +: FuDraw(pViewSh, pWin, pView, pDoc, rReq), + bTempRotation(false), + bSelectionChanged(false), + bHideAndAnimate(false), + pHdl(NULL), + bSuppressChangesOfSelection(false), + bMirrorSide0(false), + nEditMode(SID_BEZIER_MOVE), + pWaterCanCandidate(NULL), +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point + maOldPoint(0, 0), + mbBeginInsertPoint(false), + mbMovedToCenterPoint(false) +//-----IAccessibility2 Implementation 2009 { } @@ -965,8 +972,85 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) bReturn = FuSelection::cancel(); } break; +//IAccessibility2 Implementation 2009----- + //Solution: add keyboard operation for insert points in drawing curve + case KEY_UP: + case KEY_DOWN: + case KEY_LEFT: + case KEY_RIGHT: + { + if(rKEvt.GetKeyCode().IsShift()&&(nEditMode == SID_BEZIER_INSERT)) + { + long nX = 0; + long nY = 0; + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); + if (nCode == KEY_UP) + { + // Scroll nach oben + nX = 0; + nY =-1; } + else if (nCode == KEY_DOWN) + { + // Scroll nach unten + nX = 0; + nY = 1; + } + else if (nCode == KEY_LEFT) + { + // Scroll nach links + nX =-1; + nY = 0; + } + else if (nCode == KEY_RIGHT) + { + // Scroll nach rechts + nX = 1; + nY = 0; + } + + const basegfx::B2DPoint aSelectCenterPixel( + mpWindow->GetViewTransformation() * mpView->getMarkedObjectSnapRange().getCenter()); + const Point aPoint(mbMovedToCenterPoint + ? maOldPoint + : Point(basegfx::fround(aSelectCenterPixel.getX()), basegfx::fround(aSelectCenterPixel.getY()))); + const Point ePoint(aPoint + Point(nX, nY)); + + mpWindow->SetPointerPosPixel(ePoint); + + //simulate mouse move action + MouseEvent eMevt(ePoint, 1, 2, MOUSE_LEFT, 0); + MouseMove(eMevt); + maOldPoint = ePoint; + mbMovedToCenterPoint = true; + bReturn = true; + } + } + break; + case KEY_RETURN: + if(rKEvt.GetKeyCode().IsShift()&&(nEditMode == SID_BEZIER_INSERT)) + { + if(!mbBeginInsertPoint) + { + //simulate mouse button down action + MouseEvent aMevt(maOldPoint, 1, 3, MOUSE_LEFT, KEY_SHIFT); + MouseButtonDown(aMevt); + mpWindow->CaptureMouse(); + mbBeginInsertPoint = true; + } + else + { + //simulate mouse button up action + MouseEvent rMEvt(maOldPoint, 1, 17, MOUSE_LEFT, KEY_SHIFT); + MouseButtonUp(rMEvt); + mbBeginInsertPoint = false; + } + bReturn= sal_True; + } + break; + } +//-----IAccessibility2 Implementation 2009 if (!bReturn) { bReturn = FuDraw::KeyInput(rKEvt); @@ -984,6 +1068,21 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) } +//IAccessibility2 Implementation 2009----- +void FuSelection::ForcePointer(const MouseEvent* pMEvt) +{ + if(mbMovedToCenterPoint && !mbBeginInsertPoint && pMEvt) + { + MouseEvent aMEvt(pMEvt->GetPosPixel(), pMEvt->GetClicks(), + pMEvt->GetMode(), pMEvt->GetButtons(), pMEvt->GetModifier() & ~KEY_SHIFT); + FuDraw::ForcePointer(&aMEvt); + } + else + { + FuDraw::ForcePointer(pMEvt); + } +} +//-----IAccessibility2 Implementation 2009 /************************************************************************* |* |* Function aktivieren diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx index b356ea2f31f2..7000c4dce24e 100644 --- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx +++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx @@ -38,6 +38,17 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <tools/link.hxx> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> +#include "DrawViewShell.hxx" +#include "sdpage.hxx" +#include "drawdoc.hxx" +#include "FrameView.hxx" +#include "PresentationViewShell.hxx" +#include <editeng/outlobj.hxx> +#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp> +class SdViewShell; +//-----IAccessibility2 Implementation 2009 namespace sd { class ViewShell; class Window; @@ -86,6 +97,10 @@ class AccessibleDocumentViewBase public ::com::sun::star::beans::XPropertyChangeListener, public ::com::sun::star::awt::XWindowListener, public ::com::sun::star::awt::XFocusListener +//IAccessibility2 Implementation 2009----- + ,public ::com::sun::star::accessibility::XAccessibleExtendedAttributes + ,public com::sun::star::accessibility::XAccessibleGetAccFlowTo +//-----IAccessibility2 Implementation 2009 { public: //===== internal ======================================================== @@ -250,7 +265,12 @@ public: throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL focusLost (const ::com::sun::star::awt::FocusEvent& e) throw (::com::sun::star::uno::RuntimeException); - +//IAccessibility2 Implementation 2009----- + //----------------------------xAttribute---------------------------- + virtual com::sun::star::uno::Any SAL_CALL getExtendedAttributes() + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; + ::sd::ViewShell* mpViewShell; +//-----IAccessibility2 Implementation 2009 private: // return the member maMutex; @@ -359,7 +379,20 @@ protected: virtual void SetAccessibleOLEObject ( const ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible>& xOLEObject); +//IAccessibility2 Implementation 2009----- + //===== XAccessibleGetAccFromXShape ============================================ + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType) + throw ( ::com::sun::star::uno::RuntimeException ); + +public: + virtual void SwitchViewActivated (void) { Activated(); } + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 virtual void impl_dispose (void); }; diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx index 2b683e47d3ae..0354243a350f 100644 --- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx +++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx @@ -26,6 +26,10 @@ #include "AccessibleDocumentViewBase.hxx" +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp> +//-----IAccessibility2 Implementation 2009 + namespace accessibility { @@ -39,6 +43,9 @@ namespace accessibility { */ class AccessibleDrawDocumentView : public AccessibleDocumentViewBase +//IAccessibility2 Implementation 2009----- + ,public ::com::sun::star::accessibility::XAccessibleGroupPosition +//-----IAccessibility2 Implementation 2009 { public: //===== internal ======================================================== @@ -73,6 +80,11 @@ public: throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); +//IAccessibility2 Implementation 2009----- + virtual ::rtl::OUString SAL_CALL + getAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 //===== lang::XEventListener ============================================ @@ -86,6 +98,28 @@ public: virtual void SAL_CALL propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject) throw (::com::sun::star::uno::RuntimeException); +//IAccessibility2 Implementation 2009----- + //===== XInterface ====================================================== + + virtual com::sun::star::uno::Any SAL_CALL + queryInterface (const com::sun::star::uno::Type & rType) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + acquire (void) + throw (); + + virtual void SAL_CALL + release (void) + throw (); + + //===== XAccessibleGroupPosition ========================================= + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getGroupPosition( const ::com::sun::star::uno::Any& rAny ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject ) + throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 protected: @@ -120,6 +154,10 @@ protected: virtual void implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); +//IAccessibility2 Implementation 2009----- +private: + ::sd::ViewShell* mpSdViewSh; +//-----IAccessibility2 Implementation 2009 protected: /** This object manages the shapes of the represented draw page. It is @@ -160,6 +198,15 @@ protected: virtual void impl_dispose (void); +//IAccessibility2 Implementation 2009----- + //===== XAccessibleGetAccFromXShape ============================================ + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType) + throw ( ::com::sun::star::uno::RuntimeException ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + GetSelAccContextInTable(); +//-----IAccessibility2 Implementation 2009 + private: void UpdateAccessibleName (void); }; diff --git a/sd/source/ui/inc/AccessibleOutlineView.hxx b/sd/source/ui/inc/AccessibleOutlineView.hxx index d1188e37cbd4..f265deb7add2 100644 --- a/sd/source/ui/inc/AccessibleOutlineView.hxx +++ b/sd/source/ui/inc/AccessibleOutlineView.hxx @@ -75,7 +75,11 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild (sal_Int32 nIndex) throw (::com::sun::star::uno::RuntimeException); - +//IAccessibility2 Implementation 2009----- + virtual ::rtl::OUString SAL_CALL + getAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 //===== XAccessibleEventBroadcaster ======================================== virtual void SAL_CALL diff --git a/sd/source/ui/inc/AccessiblePresentationGraphicShape.hxx b/sd/source/ui/inc/AccessiblePresentationGraphicShape.hxx index 457e1ed4348f..53a6eb570d5b 100644 --- a/sd/source/ui/inc/AccessiblePresentationGraphicShape.hxx +++ b/sd/source/ui/inc/AccessiblePresentationGraphicShape.hxx @@ -27,6 +27,9 @@ #include <svx/AccessibleGraphicShape.hxx> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/AccessibleRole.hpp> +//-----IAccessibility2 Implementation 2009 namespace accessibility { /** This class makes Impress shapes accessible. @@ -60,6 +63,10 @@ public: virtual ::rtl::OUString CreateAccessibleDescription () throw (::com::sun::star::uno::RuntimeException); +//IAccessibility2 Implementation 2009----- + /// Return this object's role. + virtual sal_Int16 SAL_CALL getAccessibleRole () throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 }; } // end of namespace accessibility diff --git a/sd/source/ui/inc/AccessiblePresentationOLEShape.hxx b/sd/source/ui/inc/AccessiblePresentationOLEShape.hxx index 0339c4f9aeb2..9445f03ab191 100644 --- a/sd/source/ui/inc/AccessiblePresentationOLEShape.hxx +++ b/sd/source/ui/inc/AccessiblePresentationOLEShape.hxx @@ -27,6 +27,9 @@ #include <svx/AccessibleOLEShape.hxx> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/AccessibleRole.hpp> +//-----IAccessibility2 Implementation 2009 namespace accessibility { /** This class makes Impress shapes accessible. @@ -60,6 +63,10 @@ public: virtual ::rtl::OUString CreateAccessibleDescription () throw (::com::sun::star::uno::RuntimeException); +//IAccessibility2 Implementation 2009----- + /// Return this object's role. + virtual sal_Int16 SAL_CALL getAccessibleRole () throw (::com::sun::star::uno::RuntimeException); +//-----IAccessibility2 Implementation 2009 }; } // end of namespace accessibility diff --git a/sd/source/ui/inc/AccessiblePresentationShape.hxx b/sd/source/ui/inc/AccessiblePresentationShape.hxx index cbad99926a19..68ef10925883 100644 --- a/sd/source/ui/inc/AccessiblePresentationShape.hxx +++ b/sd/source/ui/inc/AccessiblePresentationShape.hxx @@ -59,6 +59,9 @@ public: virtual ::rtl::OUString CreateAccessibleDescription () throw (::com::sun::star::uno::RuntimeException); +//IAccessibility2 Implementation 2009----- + ::rtl::OUString GetStyle(); +//-----IAccessibility2 Implementation 2009 private: /** Don't use the default constructor. Use the public constructor that diff --git a/sd/source/ui/inc/AccessibleSlideSorterView.hxx b/sd/source/ui/inc/AccessibleSlideSorterView.hxx index 7839e911be57..8637472c2dbe 100644 --- a/sd/source/ui/inc/AccessibleSlideSorterView.hxx +++ b/sd/source/ui/inc/AccessibleSlideSorterView.hxx @@ -286,7 +286,8 @@ public: getSupportedServiceNames (void) throw (::com::sun::star::uno::RuntimeException); - + // IAccessibility2 Implementation 2009 + virtual void SwitchViewActivated (void); private: class Implementation; ::std::auto_ptr<Implementation> mpImpl; diff --git a/sd/source/ui/inc/AccessibleSlideView.hxx b/sd/source/ui/inc/AccessibleSlideView.hxx index 4ff94d19c223..e6fe1ed02f14 100644 --- a/sd/source/ui/inc/AccessibleSlideView.hxx +++ b/sd/source/ui/inc/AccessibleSlideView.hxx @@ -25,7 +25,10 @@ #define SD_ACCESSIBILITY_ACCESSIBLE_SLIDE_VIEW_HXX #include <cppuhelper/implbase6.hxx> -#include <cppuhelper/implbase7.hxx> +//IAccessibility2 Implementation 2009----- +#include <cppuhelper/implbase9.hxx> +//#include <cppuhelper/implbase7.hxx> +//-----IAccessibility2 Implementation 2009 #include "SlideView.hxx" #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> @@ -35,6 +38,9 @@ #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> +//-----IAccessibility2 Implementation 2009 #include <vector> class SdDrawDocument; @@ -156,14 +162,18 @@ public: // - AccessibleSlideView - // ----------------------- -class AccessibleSlideView : public ::cppu::WeakImplHelper7< +class AccessibleSlideView : public ::cppu::WeakImplHelper9< ::com::sun::star::lang::XUnoTunnel, ::com::sun::star::accessibility::XAccessible, ::com::sun::star::accessibility::XAccessibleEventBroadcaster, ::com::sun::star::accessibility::XAccessibleContext, ::com::sun::star::accessibility::XAccessibleComponent, ::com::sun::star::accessibility::XAccessibleSelection, - ::com::sun::star::lang::XServiceInfo > + ::com::sun::star::lang::XServiceInfo +//IAccessibility2 Implementation 2009----- + ,::com::sun::star::accessibility::XAccessibleExtendedAttributes + ,::com::sun::star::awt::XFocusListener > +//-----IAccessibility2 Implementation 2009 { public: @@ -189,8 +199,18 @@ public: void SetPageVisible( sal_uInt16 nPage, sal_Bool bVisible ); void Reset(); void FocusHasChanged( sal_uInt16 nOldFocusPage, sal_uInt16 nNewFocusPage ); - - +//IAccessibility2 Implementation 2009----- + void SelectionHasChanged (sal_uInt16 nPage, sal_Bool bSelect ); + //===== XFocusListener ================================================= + virtual void SAL_CALL focusGained (const ::com::sun::star::awt::FocusEvent& e) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL focusLost (const ::com::sun::star::awt::FocusEvent& e) + throw (::com::sun::star::uno::RuntimeException); + //===== lang::XEventListener ============================================ + virtual void SAL_CALL disposing (const struct com::sun::star::lang::EventObject &) throw (::com::sun::star::uno::RuntimeException); + // This method is called from the component helper base class while disposing. + virtual void SAL_CALL disposing (void); +//-----IAccessibility2 Implementation 2009 private: ::osl::Mutex maMutex; ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maSlidePageObjects; @@ -199,6 +219,10 @@ private: ::sd::Window* mpParentWindow; /// client id in the AccessibleEventNotifier queue sal_uInt32 mnClientId; +//IAccessibility2 Implementation 2009----- + sal_uInt32 nFocusPageIndex; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> mxWindow; +//-----IAccessibility2 Implementation 2009 // internal static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); @@ -253,6 +277,11 @@ private: //===== XServiceInfo ==================================================== +//IAccessibility2 Implementation 2009----- + //----------------------------xAttribute---------------------------- + virtual com::sun::star::uno::Any SAL_CALL getExtendedAttributes() + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; +//-----IAccessibility2 Implementation 2009 /** Returns an identifier for the implementation of this object. */ virtual ::rtl::OUString SAL_CALL diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index 2e52299d4153..10de941da6b0 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -44,6 +44,9 @@ #include <memory> #include <vector> #include <boost/scoped_ptr.hpp> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/drawing/XLayer.hpp> +//-----IAccessibility2 Implementation 2009 class SfxViewShell; class SdXImpressDocument; @@ -102,6 +105,10 @@ public: PROPERTY_ZOOMVALUE = 7, PROPERTY_VIEWOFFSET = 8, PROPERTY_DRAWVIEWMODE = 9 + //IAccessibility2 Implementation 2009----- + ,PROPERTY_UPDATEACC = 10 + ,PROPERTY_PAGE_CHANGE = 11 + //-----IAccessibility2 Implementation 2009 }; /** Create a new DrawController object for the given ViewShellBase. @@ -147,6 +154,14 @@ public: switch. */ void BroadcastContextChange (void) const; +//IAccessibility2 Implementation 2009----- + void NotifyAccUpdate(); + void fireChangeLayer( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>* pCurrentLayer ) throw(); + // change the parameter to int + //void fireSwitchCurrentPage( String pageName) throw(); + void fireSwitchCurrentPage( sal_Int32 pageIndex) throw(); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>* mpCurrentLayer; +//-----IAccessibility2 Implementation 2009 /** Return a pointer to the ViewShellBase object that the DrawController is connected to. diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index 3082d7f262bc..476b15b5a3cf 100644 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -135,6 +135,12 @@ public: bool GotoBookmark(const String& rBookmark); +//IAccessibility2 Implementation 2009----- + //Solution: realize multi-selection of objects + sal_Bool GotoTreeBookmark(const String& rBookmark); + sal_Bool IsMarked( SdrObject* pObject ); + sal_Bool GetObjectIsmarked(const String& rBookmark); +//-----IAccessibility2 Implementation 2009 Bitmap GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixel); /** checks, if the given name is a valid new name for a slide @@ -224,6 +230,13 @@ protected: bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor void Construct(bool bClipboard); virtual void InPlaceActivate( sal_Bool bActive ); +//IAccessibility2 Implementation 2009----- +public: + virtual void setDocAccTitle( const String& rTitle ); + virtual const String getDocAccTitle() const; + virtual void setDocReadOnly( sal_Bool bReadOnly); + virtual sal_Bool getDocReadOnly() const; +//-----IAccessibility2 Implementation 2009 }; #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index ad01d51d54cb..4073f476c999 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -250,6 +250,13 @@ public: bool GotoBookmark(const String& rBookmark); void MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window& rWin); +//IAccessibility2 Implementation 2009----- + //Solution: realize multi-selection of objects ,If object is marked , + //the corresponding entry is set true ,else the corresponding entry is set false . + void FreshNavigatrEntry(); + void FreshNavigatrTree(); +//-----IAccessibility2 Implementation 2009 + virtual void ReadFrameViewData(FrameView* pView); virtual void WriteFrameViewData(); @@ -368,6 +375,10 @@ public: ::rtl::OUString GetSidebarContextName (void) const; +//IAccessibility2 Implementation 2009----- + //move this method to ViewShell. + //void NotifyAccUpdate(); +//-----IAccessibility2 Implementation 2009 protected: DrawView* mpDrawView; SdPage* mpActualPage; @@ -494,6 +505,10 @@ private: using ViewShell::Notify; +//IAccessibility2 Implementation 2009----- + //const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & GetForms() const; +//-----IAccessibility2 Implementation 2009 + ::std::auto_ptr< AnnotationManager > mpAnnotationManager; ::std::auto_ptr< ViewOverlayManager > mpViewOverlayManager; }; diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx index 2ab4f28101d2..2a2bc934f5d7 100644 --- a/sd/source/ui/inc/OutlineViewShell.hxx +++ b/sd/source/ui/inc/OutlineViewShell.hxx @@ -137,6 +137,9 @@ public: ::com::sun::star::accessibility::XAccessible> CreateAccessibleDocumentView (::sd::Window* pWindow); +//IAccessibility2 Implementation 2009----- + String m_StrOldPageName; +//-----IAccessibility2 Implementation 2009 /** Update the preview to show the specified page. */ virtual void UpdatePreview (SdPage* pPage, bool bInit = false); diff --git a/sd/source/ui/inc/SdUnoDrawView.hxx b/sd/source/ui/inc/SdUnoDrawView.hxx index 12975e07f521..0be24403003c 100644 --- a/sd/source/ui/inc/SdUnoDrawView.hxx +++ b/sd/source/ui/inc/SdUnoDrawView.hxx @@ -112,14 +112,14 @@ protected: void setMasterPageMode(sal_Bool MasterPageMode_) throw(); sal_Bool getLayerMode(void) const throw(); void setLayerMode(sal_Bool LayerMode_) throw(); - +public: /** Return a reference to the active layer object. @return The returned value may be empty when the internal state of this view is not valid (like during destruction.) */ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> getActiveLayer (void) throw (); - +protected: /** Make the specified object the active layer. @param rxLayer The new layer object. diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index e360097dc17f..6898d895c09d 100644 --- a/sd/source/ui/inc/SlideSorterViewShell.hxx +++ b/sd/source/ui/inc/SlideSorterViewShell.hxx @@ -173,6 +173,10 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> CreateAccessibleDocumentView (::sd::Window* pWindow); + //IAccessibility2 Implementation 2009----- + // handle SlideSorterView specially because AccessibleSlideSorterView doesn't inherit from AccessibleDocumentViewBase + virtual void SwitchViewFireFocus( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc ); + //-----IAccessibility2 Implementation 2009 SlideSorter& GetSlideSorter (void) const; diff --git a/sd/source/ui/inc/SlideViewShell.hxx b/sd/source/ui/inc/SlideViewShell.hxx index bdfda8df19e1..c94ef13ee8b8 100644 --- a/sd/source/ui/inc/SlideViewShell.hxx +++ b/sd/source/ui/inc/SlideViewShell.hxx @@ -138,6 +138,10 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> CreateAccessibleDocumentView( ::sd::Window* pWindow ); void SelectionHasChanged(); +//IAccessibility2 Implementation 2009----- + //Notify the SELECTION_CHANGE, SELECTION_ADD, SELECTION_REMOVE events + void SelectionHasChanged(sal_uInt16 nPage, sal_Bool bSelect); +//-----IAccessibility2 Implementation 2009 void PageLayoutHasChanged(); void FocusHasChanged( sal_uInt16 nOldFocusPage, sal_uInt16 nNewFocusPage ); void PageVisibilityHasChanged( sal_uInt16 nPage, bool bVisible ); @@ -146,6 +150,9 @@ public: */ virtual void Activate (sal_Bool IsMDIActivate); +//IAccessibility2 Implementation 2009----- + void SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc ); +//-----IAccessibility2 Implementation 2009 protected: virtual Size GetOptimalSizePixel() const; virtual long VirtHScrollHdl(ScrollBar* pHScroll); diff --git a/sd/source/ui/inc/TabControl.hxx b/sd/source/ui/inc/TabControl.hxx index 0d27f5511218..f64434f17bbd 100644 --- a/sd/source/ui/inc/TabControl.hxx +++ b/sd/source/ui/inc/TabControl.hxx @@ -42,6 +42,10 @@ class TabControl public DragSourceHelper, public DropTargetHelper { +//IAccessibility2 Implementation 2009----- + //Solution: declare bIsMarked variable + sal_uInt16 RrePageID; +//-----IAccessibility2 Implementation 2009 public: TabControl (DrawViewShell* pDrViewSh, ::Window* pParent); virtual ~TabControl (void); diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 0fb63d5c008a..64de86829a87 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -304,6 +304,14 @@ public: basegfx::B2DPoint GetWinViewPos() const; basegfx::B2DPoint GetViewOrigin() const; +//IAccessibility2 Implementation 2009----- + virtual void SwitchViewFireFocus( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc ); + virtual void SwitchActiveViewFireFocus( ); + // Move these two methods from DrawViewShell to enable slide show view + void NotifyAccUpdate(); + void fireSwitchCurrentPage(sal_Int32 pageIndex); +//-----IAccessibility2 Implementation 2009 + /** Return the window updater of this view shell. @return In rare circumstances the returned pointer may be <null/>, diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx index 30c8f6937846..8d2e38655aa7 100644 --- a/sd/source/ui/inc/Window.hxx +++ b/sd/source/ui/inc/Window.hxx @@ -202,6 +202,9 @@ protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> CreateAccessible (void); +//IAccessibility2 Implementation 2009----- + virtual void SwitchView(); +//-----IAccessibility2 Implementation 2009 XubString GetSurroundingText() const; Selection GetSurroundingTextSelection() const; diff --git a/sd/source/ui/inc/fuediglu.hxx b/sd/source/ui/inc/fuediglu.hxx index 03302a068389..17b3ae9b419b 100644 --- a/sd/source/ui/inc/fuediglu.hxx +++ b/sd/source/ui/inc/fuediglu.hxx @@ -53,6 +53,16 @@ public: virtual void Activate(); // Function aktivieren virtual void Deactivate(); // Function deaktivieren +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point + virtual void ForcePointer(const MouseEvent* pMEvt = NULL); +private: + Point maOldPoint; + + /// bitfield + bool mbBeginInsertPoint : 1; +//-----IAccessibility2 Implementation 2009 protected: FuEditGluePoints ( ViewShell* pViewSh, diff --git a/sd/source/ui/inc/fusel.hxx b/sd/source/ui/inc/fusel.hxx index 3106a71e1cb6..053d7d8c9878 100644 --- a/sd/source/ui/inc/fusel.hxx +++ b/sd/source/ui/inc/fusel.hxx @@ -66,6 +66,10 @@ public: */ virtual bool cancel(); +//IAccessibility2 Implementation 2009----- + //Solution: let mouse cursor move + virtual void ForcePointer(const MouseEvent* pMEvt = NULL); +//-----IAccessibility2 Implementation 2009 protected: FuSelection (ViewShell* pViewSh, ::sd::Window* pWin, @@ -98,6 +102,15 @@ private: position then NULL is returned. */ SdrObject* pickObject (const basegfx::B2DPoint& rTestPoint); +//IAccessibility2 Implementation 2009----- + //Solution: Add Shift+UP/DOWN/LEFT/RIGHT key to move the position of insert point, + //and SHIFT+ENTER key to decide the postion and draw the new insert point + Point maOldPoint; + + /// bitfield + bool mbBeginInsertPoint : 1; + bool mbMovedToCenterPoint : 1; +//-----IAccessibility2 Implementation 2009 }; } // end of namespace sd diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index f00c9791bf0c..ffeaf8ac8e71 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -165,6 +165,13 @@ private: virtual void DataChanged( const DataChangedEvent& rDCEvt ); void SetDragImage(); void ApplyImageList(); +//IAccessibility2 Implementation 2009----- +public: + //Solution: when object is marked , fresh the corresponding entry tree . + sd::DrawDocShell* GetDrawDocShell(const SdDrawDocument*); + void FreshTree ( const SdDrawDocument* pDoc ); + void FreshEntry( ); +//-----IAccessibility2 Implementation 2009 }; diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index f321dedee24a..dc4150cec16d 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -36,6 +36,10 @@ #include <svl/urlbmk.hxx> #include <tools/ref.hxx> #include "sdxfer.hxx" +//IAccessibility2 Implementation 2009----- +#include <vector> +using namespace std; +//-----IAccessibility2 Implementation 2009 #include <boost/scoped_ptr.hpp> #include <boost/function.hpp> @@ -69,6 +73,10 @@ class SD_DLLPUBLIC SdPageObjsTLB : public SvTreeListBox private: static bool SD_DLLPRIVATE bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird +//IAccessibility2 Implementation 2009----- + //Solution: set contenttree in SdNavigatorWin + sal_Bool bisInSdNavigatorWin; +//-----IAccessibility2 Implementation 2009 public: // nested class to implement the TransferableHelper @@ -143,6 +151,11 @@ protected: ::sd::DrawDocShell* mpDropDocSh; SdNavigatorWin* mpDropNavWin; SfxViewFrame* mpFrame; + //IAccessibility2 Implementation 2009----- + vector<String> maTreeItem; + sal_Bool mbSaveTreeItemState; + String maSelectionEntryText; + //-----IAccessibility2 Implementation 2009 // DragSourceHelper virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); @@ -187,12 +200,20 @@ protected: using Window::GetDropTarget; virtual SvLBoxEntry* GetDropTarget (const Point& rLocation); +//IAccessibility2 Implementation 2009----- + virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind ); +//-----IAccessibility2 Implementation 2009 public: SdPageObjsTLB( Window* pParent, const SdResId& rSdResId ); ~SdPageObjsTLB(); - +//IAccessibility2 Implementation 2009----- + // helper function for GetEntryAltText and GetEntryLongDescription + String getAltLongDescText( SvLBoxEntry* pEntry , sal_Bool isAltText) const; + String GetEntryAltText( SvLBoxEntry* pEntry ) const; + String GetEntryLongDescription( SvLBoxEntry* pEntry ) const; +//-----IAccessibility2 Implementation 2009 virtual void SelectHdl(); virtual void KeyInput( const KeyEvent& rKEvt ); @@ -207,6 +228,16 @@ public: bool HasSelectedChilds( const String& rName ); bool SelectEntry( const String& rName ); String GetSelectEntry(); +//IAccessibility2 Implementation 2009----- + //Solution: Mark Current Entry + void MarkCurEntry( const String& rName ); + void SetSdNavigatorWinFlag(sal_Bool isInSdNavigatorWin){bisInSdNavigatorWin =isInSdNavigatorWin;}; + void FreshCurEntry(); + + void Clear(); + void SetSaveTreeItemStateFlag(sal_Bool bState){mbSaveTreeItemState = bState;} + void SaveExpandedTreeItemState(SvLBoxEntry* pEntry, vector<String>& vectTreeItem); +//-----IAccessibility2 Implementation 2009 List* GetSelectEntryList( sal_uInt16 nDepth ); SdDrawDocument* GetBookmarkDoc(SfxMedium* pMedium = NULL); ::sd::DrawDocShell* GetDropDocSh() { return(mpDropDocSh); } diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index aa1d7c36d9cb..853162b612ab 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -727,4 +727,28 @@ void ShowWindow::AddWindowToPaintView() GetChild( nChild )->Show( true ); } +//IAccessibility2 Implementation 2009----- +// Overload the sd::Window's CreateAccessible to create a different accessible object +::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible> + ShowWindow::CreateAccessible (void) +{ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible(sal_False); + if (xAcc.get()) + { + return xAcc; + } + if (mpViewShell != NULL) + { + xAcc = mpViewShell->CreateAccessibleDocumentView (this); + SetAccessible(xAcc); + return xAcc; + } + else + { + OSL_TRACE ("::sd::Window::CreateAccessible: no view shell"); + return ::Window::CreateAccessible (); + } +} +//-----IAccessibility2 Implementation 2009 } // end of namespace sd diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx index 2db511087035..0d62e62d9816 100644 --- a/sd/source/ui/slideshow/showwindow.hxx +++ b/sd/source/ui/slideshow/showwindow.hxx @@ -102,6 +102,11 @@ public: virtual void MouseButtonDown(const MouseEvent& rMEvt); virtual void Paint(const Rectangle& rRect); virtual long Notify(NotifyEvent& rNEvt); + //IAccessibility2 Implementation 2009----- + //Overload the sd::Window's CreateAccessible to create a different accessible object + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible> + CreateAccessible (void); void TerminateShow(); void RestartShow(); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 29f4e53e19a7..a7658ceea78d 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -819,6 +819,12 @@ void SAL_CALL SlideShow::end() throw(RuntimeException) } } } + //IAccessibility2 Implementation 2009----- + //Fire the acc focus event when focus is switched back. The above method mpCurrentViewShellBase->GetWindow()->GrabFocus() will + //set focus to WorkWindow instead of the sd::window, so here call Shell's method to fire the focus event + if (pViewShell) + pViewShell->SwitchActiveViewFireFocus(); + //-----IAccessibility2 Implementation 2009 } mpCurrentViewShellBase = 0; } @@ -1045,6 +1051,10 @@ void SlideShow::activate( ViewShellBase& rBase ) if( mxController->startShow(mxCurrentSettings.get()) ) { pShell->Resize(); + //IAccessibility2 Implementation 2009----- + // Defer the sd::ShowWindow's GrabFocus to here. so that the accessible event can be fired correctly. + pShell->GetActiveWindow()->GrabFocus(); + //-----IAccessibility2 Implementation 2009 } else { @@ -1219,6 +1229,13 @@ void SlideShow::StartInPlacePresentation() if( !bSuccess ) end(); + //IAccessibility2 Implementation 2009----- + else + { + if(mpCurrentViewShellBase) + mpCurrentViewShellBase->GetWindow()->GrabFocus(); + } + //-----IAccessibility2 Implementation 2009 } } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 2a20eed5daea..248bdc547104 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1096,7 +1096,10 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) pBindings->Invalidate( SID_REHEARSE_TIMINGS ); } - mpShowWindow->GrabFocus(); + //IAccessibility2 Implementation 2009----- + // Defer the sd::ShowWindow's GrabFocus to SlideShow::activate. so that the accessible event can be fired correctly. + //mpShowWindow->GrabFocus(); + //-----IAccessibility2 Implementation 2009 std::vector<beans::PropertyValue> aProperties; aProperties.reserve( 4 ); @@ -1472,6 +1475,15 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects) pBindings->Invalidate( SID_NAVIGATOR_PAGENAME ); } } + //IAccessibility2 Implementation 2009----- + // send out page change event and notity to update all acc info for current page + if (mpViewShell) + { + sal_Int32 currentPageIndex = getCurrentSlideIndex(); + mpViewShell->fireSwitchCurrentPage(currentPageIndex); + mpViewShell->NotifyAccUpdate(); + } + //-----IAccessibility2 Implementation 2009 } // --------------------------------------------------------- diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx index d83863a24986..b6e420a680ee 100644 --- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx @@ -284,6 +284,11 @@ void FocusManager::HideFocusIndicator (const model::SharedPageDescriptor& rpDesc if (rpDescriptor.get() != NULL) { mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, false); + + //IAccessibility2 Implementation 2009----- + // Hide focus should also fire the focus event, Currently, only accessibility add the focus listener + NotifyFocusChangeListeners(); + //-----IAccessibility2 Implementation 2009 } } diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index a1cc87db9fac..1e755c76905a 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -211,6 +211,12 @@ void SlideSorterViewShell::Init (bool bIsMainViewShell) { ViewShell::Init(bIsMainViewShell); +//IAccessibility2 Implementation 2009----- + // since the updatePageList will show focus, the window.show() must be called ahead. This show is deferred from Init() + ::sd::Window* pActiveWindow = GetActiveWindow(); + if (pActiveWindow) + pActiveWindow->Show(); +//-----IAccessibility2 Implementation 2009 mpSlideSorter->GetModel().UpdatePageList(); if (mpContentWindow.get() != NULL) @@ -292,7 +298,19 @@ Reference<drawing::XDrawSubController> SlideSorterViewShell::CreateSubController pWindow); } - +//IAccessibility2 Implementation 2009----- +void SlideSorterViewShell::SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc ) +{ + if (xAcc.get()) + { + ::accessibility::AccessibleSlideSorterView* pBase = static_cast< ::accessibility::AccessibleSlideSorterView* >(xAcc.get()); + if (pBase) + { + pBase->SwitchViewActivated(); + } + } +} +//-----IAccessibility2 Implementation 2009 SlideSorter& SlideSorterViewShell::GetSlideSorter (void) const diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 47e3692e9f7e..5a24710dd6d0 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -539,9 +539,45 @@ void DrawController::FireSwitchCurrentPage (SdPage* pNewCurrentPage) throw() } } } +//IAccessibility2 Implementation 2009----- +void DrawController::NotifyAccUpdate() +{ + sal_Int32 nHandle = PROPERTY_UPDATEACC; + Any aNewValue, aOldValue; + fire (&nHandle, &aNewValue, &aOldValue, 1, sal_False); +} + +void DrawController::fireChangeLayer( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>* pCurrentLayer ) throw() +{ + if( pCurrentLayer != mpCurrentLayer ) + { + sal_Int32 nHandle = PROPERTY_ACTIVE_LAYER; + Any aNewValue (makeAny( *pCurrentLayer) ); + + Any aOldValue ; + + fire (&nHandle, &aNewValue, &aOldValue, 1, sal_False); + + mpCurrentLayer = pCurrentLayer; + } +} +// This method is only called in slide show and outline view +//void DrawController::fireSwitchCurrentPage(String pageName ) throw() +void DrawController::fireSwitchCurrentPage(sal_Int32 pageIndex ) throw() +{ + Any aNewValue; + Any aOldValue; + //OUString aPageName( pageName ); + //aNewValue <<= aPageName ; + aNewValue <<= pageIndex; + // Use new property to handle page change event + sal_Int32 nHandles = PROPERTY_PAGE_CHANGE; + fire( &nHandles, &aNewValue, &aOldValue, 1, sal_False ); +} +//-----IAccessibility2 Implementation 2009 void DrawController::FirePropertyChange ( sal_Int32 nHandle, @@ -750,6 +786,19 @@ void DrawController::FillPropertyTable ( PROPERTY_DRAWVIEWMODE, ::getCppuType((const ::com::sun::star::awt::Point*)0), beans::PropertyAttribute::BOUND|beans::PropertyAttribute::READONLY|beans::PropertyAttribute::MAYBEVOID )); + //IAccessibility2 Implementation 2009----- + // add new property to update current page's acc information + rProperties.push_back( + beans::Property( OUString( RTL_CONSTASCII_USTRINGPARAM("UpdateAcc") ), + PROPERTY_UPDATEACC, + ::getCppuType((const sal_Int16*)0), + beans::PropertyAttribute::BOUND )); + rProperties.push_back( + beans::Property( OUString( RTL_CONSTASCII_USTRINGPARAM("PageChange") ), + PROPERTY_PAGE_CHANGE, + ::getCppuType((const sal_Int16*)0), + beans::PropertyAttribute::BOUND )); + //-----IAccessibility2 Implementation 2009 } diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx index 297684961d2f..bcea595a591e 100644 --- a/sd/source/ui/unoidl/SdUnoDrawView.cxx +++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx @@ -151,6 +151,9 @@ Reference<drawing::XLayer> SdUnoDrawView::getActiveLayer (void) throw () xCurrentLayer = pManager->GetLayer (pLayer); } while (false); +//IAccessibility2 Implementation 2009----- + mrController.mpCurrentLayer = &(xCurrentLayer) ; +//-----IAccessibility2 Implementation 2009 return xCurrentLayer; } diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index d2790b87321e..06de7ac1f91a 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -553,7 +553,17 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) else mnStartPageIndex = (sal_uInt16)-1; } +//IAccessibility2 Implementation 2009----- + if ( Application::IsAccessibilityEnabled() ) + { + SvxSearchDialog* pSearchDlg = + ((SvxSearchDialog*)(SfxViewFrame::Current()->GetChildWindow( + SvxSearchDialogWrapper::GetChildWindowId())->GetWindow())); + pSearchDlg->SetDocWin( pViewShell->GetActiveWindow() ); + pSearchDlg->SetSrchFlag(); } +//-----IAccessibility2 Implementation 2009 + } else mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False ); diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index ecbbf4377073..2bcc1fe3fbd2 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -68,6 +68,9 @@ #include <svx/svdlegacy.hxx> #include <svx/svditer.hxx> +//IAccessibility2 Implementation 2009----- +#include <navigatr.hxx> +//-----IAccessibility2 Implementation 2009 namespace sd { #define PIPETTE_RANGE 0 @@ -211,6 +214,14 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) else { bRet = ViewShell::KeyInput(rKEvt, pWin); +//IAccessibility2 Implementation 2009----- + //Solution: If object is marked , the corresponding entry is set true , + //else the corresponding entry is set false . + if(KEY_TAB == rKEvt.GetKeyCode().GetCode()) + { + FreshNavigatrTree(); + } +//-----IAccessibility2 Implementation 2009 } } @@ -256,7 +267,33 @@ void DrawViewShell::StartRulerDrag ( mbIsRulerDrag = true; } } +//IAccessibility2 Implementation 2009----- +//Solution: If object is marked , the corresponding entry is set true , +//else the corresponding entry is set false . +void DrawViewShell::FreshNavigatrEntry() +{ + sal_uInt16 nId = SID_NAVIGATOR; + SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); + if( pWindow ) + { + SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) ); + if( pNavWin ) + pNavWin->FreshEntry(); + } +} +void DrawViewShell::FreshNavigatrTree() +{ + sal_uInt16 nId = SID_NAVIGATOR; + SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); + if( pWindow ) + { + SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) ); + if( pNavWin ) + pNavWin->FreshTree( GetDoc() ); + } +} +//-----IAccessibility2 Implementation 2009 /************************************************************************* |* |* MouseButtonDown event @@ -283,6 +320,11 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt, { ViewShell::MouseButtonDown(rMEvt, pWin); +//IAccessibility2 Implementation 2009----- + //Solution: If object is marked , the corresponding entry is set true , + //else the corresponding entry is set false . + FreshNavigatrTree(); +//-----IAccessibility2 Implementation 2009 if ( mbPipette ) ( (SvxBmpMask*) GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->PipetteClicked(); } @@ -458,6 +500,11 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) } else ViewShell::MouseButtonUp(rMEvt, pWin); +//IAccessibility2 Implementation 2009----- + //Solution: If object is marked , the corresponding entry is set true , + //else the corresponding entry is set false . + FreshNavigatrTree(); +//-----IAccessibility2 Implementation 2009 } } diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index b1d362d29c04..24794a217f43 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -705,6 +705,15 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex) // Tell the draw view and the tab control of the new active layer. mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex))); pBar->SetCurPageId(static_cast< sal_uInt16 >(pBar->GetPageId(nIndex))); + //IAccessibility2 Implementation 2009----- + SdUnoDrawView* pUnoDrawView = new SdUnoDrawView ( + GetViewShellBase().GetDrawController(), + *this, + *GetView()); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer(); + GetViewShellBase().GetDrawController().fireChangeLayer( &rLayer ); + delete pUnoDrawView; + //-----IAccessibility2 Implementation 2009 } } } diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index b3acc2823830..4d53a07c4cd6 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -232,6 +232,9 @@ OutlineViewShell::OutlineViewShell ( Construct(GetDocSh()); SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OutlineText)); +//IAccessibility2 Implementation 2009----- + m_StrOldPageName.EmptyString(); +//-----IAccessibility2 Implementation 2009 } /************************************************************************* @@ -1467,6 +1470,14 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) aLayoutStr = pPage->GetLayoutName(); aLayoutStr.Erase( aLayoutStr.SearchAscii( SD_LT_SEPARATOR ) ); + //IAccessibility2 Implementation 2009----- + //Now, CurrentPage property change is already sent for DrawView and OutlineView, so it is not necessary to send again here + if(m_StrOldPageName!=aPageStr) + { + GetViewShellBase().GetDrawController().fireSwitchCurrentPage(nPos); + m_StrOldPageName = aPageStr; + } + //-----IAccessibility2 Implementation 2009 } rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) ); rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 8728e96d1736..f12e3fd1cde1 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -45,6 +45,10 @@ #include "AccessibleDrawDocumentView.hxx" #include "WindowUpdater.hxx" +//IAccessibility2 Implementation 2009----- +#include <vcl/svapp.hxx> +//-----IAccessibility2 Implementation 2009 + namespace sd { #define SCROLL_LINE_FACT 0.05 // Faktor fuer Zeilenscrolling @@ -1170,8 +1174,25 @@ void Window::DropScroll(const basegfx::B2DPoint& rMousePos) ::com::sun::star::accessibility::XAccessible> Window::CreateAccessible (void) { +//IAccessibility2 Implementation 2009----- + // If current viewshell is PresentationViewShell, just return empty because the correct ShowWin will be created later. + if (mpViewShell && dynamic_cast< PresentationViewShell* >(mpViewShell)) + { + return ::Window::CreateAccessible (); + } + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible(sal_False); + if (xAcc.get()) + { + return xAcc; + } if (mpViewShell != NULL) - return mpViewShell->CreateAccessibleDocumentView (this); + //return mpViewShell->CreateAccessibleDocumentView (this); + { + xAcc = mpViewShell->CreateAccessibleDocumentView (this); + SetAccessible(xAcc); + return xAcc; + } +//-----IAccessibility2 Implementation 2009 else { OSL_TRACE ("::sd::Window::CreateAccessible: no view shell"); @@ -1179,6 +1200,22 @@ void Window::DropScroll(const basegfx::B2DPoint& rMousePos) } } +//IAccessibility2 Implementation 2009----- +// MT: Removed Windows::SwitchView() introduced with IA2 CWS. +// There are other notifications for this when the active view has chnaged, so please update the code to use that event mechanism +void Window::SwitchView() +{ + if (!Application::IsAccessibilityEnabled()) + { + return ; + } + if (mpViewShell) + { + mpViewShell->SwitchViewFireFocus(GetAccessible(sal_False)); + } +} +//-----IAccessibility2 Implementation 2009 + XubString Window::GetSurroundingText() const { if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE ) diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx index d54db2812066..d63b71b77df7 100644 --- a/sd/source/ui/view/tabcontr.cxx +++ b/sd/source/ui/view/tabcontr.cxx @@ -92,6 +92,7 @@ TabControl::TabControl(DrawViewShell* pViewSh, Window* pParent) : TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_SIZEABLE | WB_DRAG) ), DragSourceHelper( this ), DropTargetHelper( this ), + RrePageID(1), pDrViewSh(pViewSh), bInternalMove(false) { @@ -136,6 +137,12 @@ void TabControl::MouseButtonDown(const MouseEvent& rMEvt) Point aPos = PixelToLogic( rMEvt.GetPosPixel() ); sal_uInt16 aPageId = GetPageId(aPos); +//IAccessibility2 Implementation 2009----- + //Solution: initialize + if(RrePageID!=aPageId) + pDrViewSh->FreshNavigatrEntry(); + RrePageID=aPageId; +//-----IAccessibility2 Implementation 2009 if (aPageId == 0) { SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 7010a93f66fb..0cbd0aaeb31d 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -95,7 +95,9 @@ #include <editeng/eeitem.hxx> #include <svl/poolitem.hxx> #include <glob.hrc> - +//IAccessibility2 Implementation 2009----- +#include "AccessibleDocumentViewBase.hxx" +//-----IAccessibility2 Implementation 2009 #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED #define SO2_DECL_SVINPLACEOBJECT_DEFINED SO2_DECL_REF(SvInPlaceObject) @@ -470,6 +472,9 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) bReturn = GetViewShell()->KeyInput(rKEvt); } +//IAccessibility2 Implementation 2009----- + const sal_uInt32 OriCount(GetView()->getSelectedSdrObjectCount()); +//-----IAccessibility2 Implementation 2009 if(!bReturn) { rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) ); @@ -499,6 +504,14 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) } } } +//IAccessibility2 Implementation 2009----- + const sal_uInt32 EndCount(GetView()->getSelectedSdrObjectCount()); + // Here, oriCount or endCount must have one value=0, another value > 0, then to switch focus between Document and shape objects + if(bReturn && (OriCount + EndCount > 0) && (OriCount * EndCount == 0)) + { + SwitchActiveViewFireFocus(); + } +//-----IAccessibility2 Implementation 2009 if(!bReturn && GetActiveWindow()) { @@ -1604,7 +1617,36 @@ bool ViewShell::RelocateToParentWindow (::Window* pParentWindow) return true; } +//IAccessibility2 Implementation 2009----- +void ViewShell::SwitchViewFireFocus(::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc ) +{ + if (xAcc.get()) + { + ::accessibility::AccessibleDocumentViewBase* pBase = static_cast< ::accessibility::AccessibleDocumentViewBase* >(xAcc.get()); + if (pBase) + { + pBase->SwitchViewActivated(); + } + } +} +void ViewShell::SwitchActiveViewFireFocus() +{ + if (mpContentWindow) + { + SwitchViewFireFocus(mpContentWindow->GetAccessible(sal_False)); + } +} +// move these two methods from DrawViewShell. +void ViewShell::fireSwitchCurrentPage(sal_Int32 pageIndex) +{ + GetViewShellBase().GetDrawController().fireSwitchCurrentPage(pageIndex); +} +void ViewShell::NotifyAccUpdate( ) +{ + GetViewShellBase().GetDrawController().NotifyAccUpdate(); +} +//-----IAccessibility2 Implementation 2009 } // end of namespace sd |