diff options
author | Michael Brauer <mib@openoffice.org> | 2002-02-20 17:14:14 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2002-02-20 17:14:14 +0000 |
commit | 65397bff2302f4d36be3699aaa18b0c75fddc617 (patch) | |
tree | 7bb88eb664c90a143306994500cbd98ad551502c /sw | |
parent | b6eb9c338d0cf90c1fb20a055ce1b078f9fd9e99 (diff) |
#95586#: Accessible API is now view aware
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 21 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 29 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 135 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 27 | ||||
-rw-r--r-- | sw/source/ui/inc/edtwin.hxx | 11 |
6 files changed, 107 insertions, 136 deletions
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 1989f40a1c56..815e69326ac3 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: viewimp.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2001-06-20 11:12:34 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:11:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,7 @@ class SwRegionRects; class ExtOutputDevice; class SdrPaintInfoRec; struct SdrPaintProcRec; +class SwAccessibleMap; class SwViewImp { @@ -112,6 +113,9 @@ class SwViewImp //ausgetragen. SwLayIdle *pIdleAct; //Analog zur SwLayAction fuer SwLayIdle. + SwAccessibleMap *pAccMap; // Accessible Wrappers + + AutoTimer aScrollTimer; //Fuer das Aufraeumen nach dem Scrollen. BOOL bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig? @@ -154,6 +158,7 @@ class SwViewImp void PaintFlyChilds( SwFlyFrm *pFly, ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec ); + SwAccessibleMap *CreateAccessibleMap(); public: SwViewImp( ViewShell * ); @@ -233,6 +238,11 @@ public: void SetRestoreActions(USHORT nSet){nRestoreActions = nSet;} USHORT GetRestoreActions() const{return nRestoreActions;} + + inline sal_Bool IsAccessible() const { return pAccMap != 0; } + void UpdateAccessible(); + inline SwAccessibleMap *GetAccessibleMapPtr() { return pAccMap; } + SwAccessibleMap &GetAccessibleMap(); }; //Kann auf dem Stack angelegt werden, wenn etwas ausgegeben oder @@ -263,6 +273,13 @@ inline const SwPageFrm *SwViewImp::GetFirstVisPage() const return pFirstVisPage; } +inline SwAccessibleMap& SwViewImp::GetAccessibleMap() +{ + if( !pAccMap ) + CreateAccessibleMap(); + + return *pAccMap; +} #endif //_VIEWIMP_HXX diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 9a38d7be2afc..28f7a2be8b21 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frmtool.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: mib $ $Date: 2002-02-14 10:52:18 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:08:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -159,11 +159,9 @@ #ifndef _LAYCACHE_HXX #include <laycache.hxx> #endif -#ifdef ACCESSIBLE_LAYOUT #ifndef _ACCMAP_HXX #include <accmap.hxx> #endif -#endif #include "mdiexp.hxx" #include "statstr.hrc" @@ -309,9 +307,17 @@ SwFrmNotify::~SwFrmNotify() if ( bAbsP || bPrtP || bFrmS || bPrtS ) #endif { -#ifdef ACCESSIBLE_LAYOUT - aAccMap.MoveFrm( pFrm, aFrm ); -#endif + ViewShell *pVSh = pFrm->GetShell(); + if( pVSh ) + { + ViewShell *pTmp = pVSh; + do + { + if( pTmp->Imp()->IsAccessible() ) + pTmp->Imp()->GetAccessibleMap().MoveFrm( pFrm, aFrm ); + pTmp = (ViewShell*)pTmp->GetNext(); + } while ( pTmp != pVSh ); + } //Auch die Flys wollen etwas von den Veraenderungen mitbekommen, //FlyInCnts brauchen hier nicht benachrichtigt werden. diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index f573317449c5..5eec4a83c59a 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ssfrm.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: mib $ $Date: 2002-02-14 10:52:18 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:08:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -131,10 +131,17 @@ #ifndef _FMTCLDS_HXX //autogen #include <fmtclds.hxx> #endif -#ifdef ACCESSIBLE_LAYOUT #ifndef _ACCMAP_HXX #include <accmap.hxx> #endif +#ifndef _VIEWSH_HXX +#include <viewsh.hxx> +#endif +#ifndef _VIEWIMP_HXX +#include <viewimp.hxx> +#endif +#ifndef _FRMSH_HXX +#include <frmsh.hxx> #endif #ifdef VERTICAL_LAYOUT @@ -376,9 +383,19 @@ void SwFrm::CheckDirChange() SwFrm::~SwFrm() { -#ifdef ACCESSIBLE_LAYOUT - aAccMap.DisposeFrm( this ); -#endif + ViewShell *pVSh = GetShell(); + ASSERT( pVSh || (!pVSh && FindRootFrm()), + "no shell: accessible object might get invalid" ); + if( pVSh ) + { + ViewShell *pTmp = pVSh; + do + { + if( pTmp->Imp()->IsAccessible() ) + pTmp->Imp()->GetAccessibleMap().DisposeFrm( this ); + pTmp = (ViewShell*)pTmp->GetNext(); + } while ( pTmp != pVSh ); + } if( pDrawObjs ) { diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index d8ef959f39b2..c50f98ed1c79 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewimp.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:29 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:06:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,9 @@ #ifndef _SVDPAGE_HXX //autogen #include <svx/svdpage.hxx> #endif +#ifndef _ACCMAP_HXX +#include <accmap.hxx> +#endif /************************************************************************* |* @@ -160,6 +163,7 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : pSdrPageView( 0 ), pDrawView( 0 ), nRestoreActions( 0 ) + ,pAccMap( 0 ) { bResetXorVisibility = bShowHdlPaint = bResetHdlHiddenPaint = bScrolled = @@ -182,6 +186,8 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : SwViewImp::~SwViewImp() { + delete pAccMap; + //JP 29.03.96: nach ShowPage muss auch HidePage gemacht werden!!! if( pDrawView ) pDrawView->HidePage( pSdrPageView ); @@ -367,112 +373,21 @@ Color SwViewImp::GetRetoucheColor() const return aRet; } -/************************************************************************ - - $Log: not supported by cvs2svn $ - Revision 1.96 2000/09/18 16:04:37 willem.vandorp - OpenOffice header added. - - Revision 1.95 2000/07/17 10:31:08 ama - Opt: Smarter scrolling for RVP - - Revision 1.94 2000/05/09 11:35:43 ama - Unicode changes - - Revision 1.93 2000/04/27 07:37:23 os - UNICODE - - Revision 1.92 2000/03/03 15:17:22 os - StarView remainders removed - - Revision 1.91 2000/02/11 14:36:08 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.90 1999/09/22 12:37:10 os - big handles - - Revision 1.89 1999/09/06 13:19:00 aw - changes due to support of new handles - - - Rev 1.85 13 Aug 1999 15:11:32 MA - adoption to new markers, but still inkomplete - - Rev 1.84 08 Apr 1999 12:36:28 MA - #64467# Complete und Retouche ggf. zuruecksetzen - - Rev 1.83 30 Mar 1999 17:11:30 AW - #41275# changed handling of Snap-functionality - - Rev 1.82 16 Jul 1998 18:55:36 AMA - Fix #50348#51949#: Controls bei virtuellen Outputdevice extra painten - - Rev 1.81 07 Jul 1998 13:23:02 OS - alle Actions fuer layoutabhaengige UNO-Operationen kurzfristig aufheben - - Rev 1.80 24 Jun 1998 18:45:22 MA - DataChanged fuer ScrollBar und Retouche, Retouche ganz umgestellt - - Rev 1.79 03 Jun 1998 09:25:20 MA - #50392# Handles und Xor aufgeraeumt - - Rev 1.78 27 Apr 1998 15:09:12 MA - ein paar sv2vcl - - Rev 1.77 28 Jan 1998 13:40:52 MA - ueberfluessiges Hell-Paint vom Text entfernt - - Rev 1.76 28 Nov 1997 09:08:46 MA - includes - - Rev 1.75 03 Nov 1997 13:07:30 MA - precomp entfernt - - Rev 1.74 21 Oct 1997 14:10:24 MA - #44844# VirDev zu klein - - Rev 1.73 13 Oct 1997 10:30:18 MA - Umbau/Vereinfachung Paint - - Rev 1.72 15 Aug 1997 12:24:06 OS - charatr/frmatr/txtatr aufgeteilt - - Rev 1.71 12 Aug 1997 15:08:52 MH - chg: header - - Rev 1.70 07 Jul 1997 16:33:42 OS - SnapSize auch im Init auf den gleichen Wert wie SetGridFine setzen #41380# - - Rev 1.69 11 Jun 1997 12:58:40 MH - add: include Win16 - - Rev 1.68 04 Apr 1997 17:37:12 NF - includes - - Rev 1.67 25 Mar 1997 14:46:28 MA - Smooth - - Rev 1.66 23 Mar 1997 13:08:42 MA - new: bPainInScroll - - Rev 1.65 25 Feb 1997 09:10:54 MA - chg: Option fuer SolidHdl - - Rev 1.64 25 Feb 1997 08:45:44 MA - chg: SolidHdl ueberm Berg - - Rev 1.63 19 Feb 1997 11:04:04 MA - chg: neue huebsche Handles - - Rev 1.62 05 Feb 1997 09:17:14 MA - fix: Refresh, virtuelles Device hinreichend gross einstellen - - Rev 1.61 23 Jan 1997 14:21:42 OM - Klickverhalten von polygonen geaendert - - Rev 1.60 16 Jan 1997 17:34:34 MA - chg: Paint oder nicht sagt uns jetzt SwFlyFrm::IsPaint - -*************************************************************************/ - +void SwViewImp::UpdateAccessible() +{ + // We require a layout and an XModel to be accessible. + SwDoc *pDoc = GetShell()->GetDoc(); + Window *pWin = GetShell()->GetWin(); + ASSERT( pDoc->GetRootFrm(), "no layout, no access" ); + ASSERT( pWin, "no window, no access" ); + + if( IsAccessible() && pDoc->GetRootFrm() && pWin ) + GetAccessibleMap().GetDocumentView(); +} +SwAccessibleMap *SwViewImp::CreateAccessibleMap() +{ + ASSERT( !pAccMap, "accessible map exists" ) + pAccMap = new SwAccessibleMap( GetShell() ); + return pAccMap; +} diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 050aa7f5528b..4ab192df2709 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ama $ $Date: 2002-01-21 09:46:44 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:06:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -164,6 +164,9 @@ #ifndef _NDINDEX_HXX #include <ndindex.hxx> #endif +#ifndef _ACCMAP_HXX +#include <accmap.hxx> +#endif #ifndef _STATSTR_HRC #include <statstr.hrc> @@ -1105,6 +1108,10 @@ void ViewShell::VisPortChgd( const SwRect &rRect) Imp()->bPaintInScroll = TRUE; GetWin()->Update(); Imp()->bPaintInScroll = FALSE; + + if( Imp()->IsAccessible() ) + Imp()->UpdateAccessible(); + } /****************************************************************************** @@ -2157,5 +2164,21 @@ BOOL ViewShell::IsNewLayout() const return GetLayout()->IsNewLayout(); } +::com::sun::star::uno::Reference< + ::drafts::com::sun::star::accessibility::XAccessible > ViewShell::CreateAccessible() +{ + using namespace ::com::sun::star::uno; + using namespace ::drafts::com::sun::star::accessibility; + Reference< XAccessible > xAcc; + SwDoc *pDoc = GetDoc(); + // We require a layout and an XModel to be accessible. + ASSERT( pDoc->GetRootFrm(), "no layout, no access" ); + ASSERT( GetWin(), "no window, no access" ); + + if( pDoc->GetRootFrm() && GetWin() ) + xAcc = Imp()->GetAccessibleMap().GetDocumentView(); + + return xAcc; +} diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx index e8709e45d8ea..c11cbd9a1b1b 100644 --- a/sw/source/ui/inc/edtwin.hxx +++ b/sw/source/ui/inc/edtwin.hxx @@ -2,9 +2,9 @@ * * $RCSfile: edtwin.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: vg $ $Date: 2002-02-18 14:54:53 $ + * last change: $Author: mib $ $Date: 2002-02-20 18:14:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -175,10 +175,6 @@ friend void PageNumNotify( ViewShell* pVwSh, bChainMode : 1, //Rahmen verbinden bWasShdwCrsr : 1, //ShadowCrsr war im MouseButtonDown an bLockInput : 1; //Lock waehrend die Rechenleiste aktiv ist -#ifdef ACCESSIBLE_LAYOUT - BOOL bHasAccessible : 1; -#endif - void LeaveArea(const Point &); void JustifyAreaTimer(); @@ -290,10 +286,7 @@ public: const SwView &GetView() const { return rView; } SwView &GetView() { return rView; } -#ifdef ACCESSIBLE_LAYOUT virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > CreateAccessible(); - void UpdateAccessible(); -#endif // Tipfenster loeschen static void ClearTip(); |