LibreOffice Module sw (master)  1
accdoc.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <vcl/window.hxx>
21 #include <rootfrm.hxx>
22 
23 #include <com/sun/star/accessibility/AccessibleRole.hpp>
24 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
25 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
26 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
29 #include <vcl/svapp.hxx>
31 #include <viewsh.hxx>
32 #include <doc.hxx>
33 #include <accmap.hxx>
34 #include "accdoc.hxx"
35 #include <strings.hrc>
36 #include <pagefrm.hxx>
37 
38 #include <swatrset.hxx>
39 #include <docsh.hxx>
40 #include <crsrsh.hxx>
41 #include <fesh.hxx>
42 #include <fmtclds.hxx>
43 #include <flyfrm.hxx>
44 #include <txtfrm.hxx>
45 #include <sectfrm.hxx>
46 #include <section.hxx>
47 #include <swmodule.hxx>
48 #include <svtools/colorcfg.hxx>
49 
50 #include <fmtanchr.hxx>
51 #include <viewimp.hxx>
52 #include <dview.hxx>
53 #include <dcontact.hxx>
54 #include <svx/svdmark.hxx>
55 constexpr OUStringLiteral sServiceName = u"com.sun.star.text.AccessibleTextDocumentView";
56 constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleDocumentView";
57 
58 using namespace ::com::sun::star;
59 using namespace ::com::sun::star::accessibility;
60 
61 using lang::IndexOutOfBoundsException;
62 
63 // SwAccessibleDocumentBase: base class for SwAccessibleDocument and
64 // SwAccessiblePreview
65 
67  std::shared_ptr<SwAccessibleMap> const& pMap)
68  : SwAccessibleContext(pMap, AccessibleRole::DOCUMENT_TEXT,
69  pMap->GetShell()->GetLayout())
70  , mxParent(pMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible())
71  , mpChildWin(nullptr)
72 {
73 }
74 
76 {
77 }
78 
80 {
81  SolarMutexGuard aGuard;
82 
83  SwRect aOldVisArea( GetVisArea() );
84  const SwRect& rNewVisArea = GetMap()->GetVisArea();
85  if( aOldVisArea != rNewVisArea )
86  {
88  // #i58139# - showing state of document view needs also be updated.
89  // Thus, call method <Scrolled(..)> instead of <ChildrenScrolled(..)>
90  // ChildrenScrolled( GetFrame(), aOldVisArea );
91  Scrolled( aOldVisArea );
92  }
93 }
94 
95 void SwAccessibleDocumentBase::AddChild( vcl::Window *pWin, bool bFireEvent )
96 {
97  SolarMutexGuard aGuard;
98 
99  OSL_ENSURE( !mpChildWin, "only one child window is supported" );
100  if( !mpChildWin )
101  {
102  mpChildWin = pWin;
103 
104  if( bFireEvent )
105  {
106  AccessibleEventObject aEvent;
107  aEvent.EventId = AccessibleEventId::CHILD;
108  aEvent.NewValue <<= mpChildWin->GetAccessible();
109  FireAccessibleEvent( aEvent );
110  }
111  }
112 }
113 
115 {
116  SolarMutexGuard aGuard;
117 
118  OSL_ENSURE( !mpChildWin || pWin == mpChildWin, "invalid child window to remove" );
119  if( mpChildWin && pWin == mpChildWin )
120  {
121  AccessibleEventObject aEvent;
122  aEvent.EventId = AccessibleEventId::CHILD;
123  aEvent.OldValue <<= mpChildWin->GetAccessible();
124  FireAccessibleEvent( aEvent );
125 
126  mpChildWin = nullptr;
127  }
128 }
129 
131 {
132  SolarMutexGuard aGuard;
133 
134  // ThrowIfDisposed is called by parent
135 
136  sal_Int32 nChildren = SwAccessibleContext::getAccessibleChildCount();
137  if( !IsDisposing() && mpChildWin )
138  nChildren++;
139 
140  return nChildren;
141 }
142 
143 uno::Reference< XAccessible> SAL_CALL
145 {
146  SolarMutexGuard aGuard;
147 
148  if( mpChildWin )
149  {
150  ThrowIfDisposed();
151 
152  if ( nIndex == GetChildCount( *(GetMap()) ) )
153  {
154  return mpChildWin->GetAccessible();
155  }
156  }
157 
159 }
160 
161 uno::Reference< XAccessible> SAL_CALL SwAccessibleDocumentBase::getAccessibleParent()
162 {
163  return mxParent;
164 }
165 
167 {
168  SolarMutexGuard aGuard;
169 
170  uno::Reference < XAccessibleContext > xAcc( mxParent->getAccessibleContext() );
171  uno::Reference < XAccessible > xThis( this );
172  sal_Int32 nCount = xAcc->getAccessibleChildCount();
173 
174  for( sal_Int32 i=0; i < nCount; i++ )
175  {
176  try
177  {
178  if( xAcc->getAccessibleChild( i ) == xThis )
179  return i;
180  }
181  catch(const css::lang::IndexOutOfBoundsException &)
182  {
183  return -1;
184  }
185  }
186  return -1;
187 }
188 
190 {
191  return GetResource( STR_ACCESS_DOC_DESC );
192 }
193 
195 {
196  SolarMutexGuard g;
197 
198  OUString sAccName = GetResource( STR_ACCESS_DOC_WORDPROCESSING );
199  SwDoc *pDoc = GetMap() ? GetShell()->GetDoc() : nullptr;
200  if ( pDoc )
201  {
202  OUString sFileName = pDoc->getDocAccTitle();
203  if ( sFileName.isEmpty() )
204  {
205  SwDocShell* pDocSh = pDoc->GetDocShell();
206  if ( pDocSh )
207  {
208  sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME );
209  }
210  }
211 
212  if ( !sFileName.isEmpty() )
213  {
214  sAccName = sFileName + " - " + sAccName;
215  }
216  }
217 
218  return sAccName;
219 }
220 
221 awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
222 {
223  try
224  {
225  SolarMutexGuard aGuard;
226 
227  vcl::Window *pWin = GetWindow();
228  if (!pWin)
229  {
230  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
231  }
232 
234  awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
235  aPixBounds.GetWidth(), aPixBounds.GetHeight() );
236 
237  return aBox;
238  }
239  catch(const css::lang::IndexOutOfBoundsException &)
240  {
241  return awt::Rectangle();
242  }
243 }
244 
246 {
247  SolarMutexGuard aGuard;
248 
249  vcl::Window *pWin = GetWindow();
250  if (!pWin)
251  {
252  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
253  }
254 
255  Point aPixPos( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ).TopLeft() );
256  awt::Point aLoc( aPixPos.getX(), aPixPos.getY() );
257 
258  return aLoc;
259 }
260 
262 {
263  SolarMutexGuard aGuard;
264 
265  vcl::Window *pWin = GetWindow();
266  if (!pWin)
267  {
268  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
269  }
270 
271  Point aPixPos( pWin->GetWindowExtentsRelative( nullptr ).TopLeft() );
272  awt::Point aLoc( aPixPos.getX(), aPixPos.getY() );
273 
274  return aLoc;
275 }
276 
277 css::awt::Size SAL_CALL SwAccessibleDocumentBase::getSize()
278 {
279  SolarMutexGuard aGuard;
280 
281  vcl::Window *pWin = GetWindow();
282  if (!pWin)
283  {
284  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
285  }
286 
287  Size aPixSize( pWin->GetWindowExtentsRelative( nullptr ).GetSize() );
288  awt::Size aSize( aPixSize.Width(), aPixSize.Height() );
289 
290  return aSize;
291 }
292 
294  const awt::Point& aPoint )
295 {
296  SolarMutexGuard aGuard;
297 
298  vcl::Window *pWin = GetWindow();
299  if (!pWin)
300  {
301  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
302  }
303 
304  tools::Rectangle aPixBounds( pWin->GetWindowExtentsRelative( nullptr ) );
305  aPixBounds.Move(-aPixBounds.Left(), -aPixBounds.Top());
306 
307  Point aPixPoint( aPoint.X, aPoint.Y );
308  return aPixBounds.IsInside( aPixPoint );
309 }
310 
311 uno::Reference< XAccessible > SAL_CALL SwAccessibleDocumentBase::getAccessibleAtPoint(
312  const awt::Point& aPoint )
313 {
314  SolarMutexGuard aGuard;
315 
316  if( mpChildWin )
317  {
318  ThrowIfDisposed();
319 
320  vcl::Window *pWin = GetWindow();
321  if (!pWin)
322  {
323  throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this));
324  }
325 
326  Point aPixPoint( aPoint.X, aPoint.Y ); // px rel to window
327  if( mpChildWin->GetWindowExtentsRelative( pWin ).IsInside( aPixPoint ) )
328  return mpChildWin->GetAccessible();
329  }
330 
332 }
333 
334 // SwAccessibleDocument
335 
337  ::utl::AccessibleStateSetHelper& rStateSet )
338 {
339  SwAccessibleContext::GetStates( rStateSet );
340 
341  // MULTISELECTABLE
342  rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
343  rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
344 }
345 
347  std::shared_ptr<SwAccessibleMap> const& pInitMap)
348  : SwAccessibleDocumentBase(pInitMap)
349  , maSelectionHelper(*this)
350 {
351  SetName(pInitMap->GetDocName());
352  vcl::Window *pWin = pInitMap->GetShell()->GetWin();
353  if( pWin )
354  {
355  pWin->AddChildEventListener( LINK( this, SwAccessibleDocument, WindowChildEventListener ));
356  sal_uInt16 nCount = pWin->GetChildCount();
357  for( sal_uInt16 i=0; i < nCount; i++ )
358  {
359  vcl::Window* pChildWin = pWin->GetChild( i );
360  if( pChildWin &&
361  AccessibleRole::EMBEDDED_OBJECT == pChildWin->GetAccessibleRole() )
362  AddChild( pChildWin, false );
363  }
364  }
365 }
366 
368 {
369  vcl::Window *pWin = GetMap() ? GetMap()->GetShell()->GetWin() : nullptr;
370  if( pWin )
371  pWin->RemoveChildEventListener( LINK( this, SwAccessibleDocument, WindowChildEventListener ));
372 }
373 
374 void SwAccessibleDocument::Dispose(bool bRecursive, bool bCanSkipInvisible)
375 {
376  OSL_ENSURE( GetFrame() && GetMap(), "already disposed" );
377 
378  vcl::Window *pWin = GetMap() ? GetMap()->GetShell()->GetWin() : nullptr;
379  if( pWin )
380  pWin->RemoveChildEventListener( LINK( this, SwAccessibleDocument, WindowChildEventListener ));
381  SwAccessibleContext::Dispose(bRecursive, bCanSkipInvisible);
382 }
383 
384 IMPL_LINK( SwAccessibleDocument, WindowChildEventListener, VclWindowEvent&, rEvent, void )
385 {
386  OSL_ENSURE( rEvent.GetWindow(), "Window???" );
387  switch ( rEvent.GetId() )
388  {
389  case VclEventId::WindowShow: // send create on show for direct accessible children
390  {
391  vcl::Window* pChildWin = static_cast< vcl::Window* >( rEvent.GetData() );
392  if( pChildWin && AccessibleRole::EMBEDDED_OBJECT == pChildWin->GetAccessibleRole() )
393  {
394  AddChild( pChildWin );
395  }
396  }
397  break;
398  case VclEventId::WindowHide: // send destroy on hide for direct accessible children
399  {
400  vcl::Window* pChildWin = static_cast< vcl::Window* >( rEvent.GetData() );
401  if( pChildWin && AccessibleRole::EMBEDDED_OBJECT == pChildWin->GetAccessibleRole() )
402  {
403  RemoveChild( pChildWin );
404  }
405  }
406  break;
407  case VclEventId::ObjectDying: // send destroy on hide for direct accessible children
408  {
409  vcl::Window* pChildWin = rEvent.GetWindow();
410  if( pChildWin && AccessibleRole::EMBEDDED_OBJECT == pChildWin->GetAccessibleRole() )
411  {
412  RemoveChild( pChildWin );
413  }
414  }
415  break;
416  default: break;
417  }
418 }
419 
421 {
422  return sImplementationName;
423 }
424 
425 sal_Bool SAL_CALL SwAccessibleDocument::supportsService(const OUString& sTestServiceName)
426 {
427  return cppu::supportsService(this, sTestServiceName);
428 }
429 
430 uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames()
431 {
433 }
434 
435 // XInterface
436 
438  const uno::Type& rType )
439 {
440  uno::Any aRet;
442  {
443  uno::Reference<XAccessibleSelection> aSelect = this;
444  aRet <<= aSelect;
445  }
447  {
448  uno::Reference<XAccessibleExtendedAttributes> aAttribute = this;
449  aRet <<= aAttribute;
450  }
451  else
452  aRet = SwAccessibleContext::queryInterface( rType );
453  return aRet;
454 }
455 
456 // XTypeProvider
457 uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
458 {
459  return cppu::OTypeCollection(
461  SwAccessibleDocumentBase::getTypes() ).getTypes();
462 }
463 
464 uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId()
465 {
466  return css::uno::Sequence<sal_Int8>();
467 }
468 
469 // XAccessibleSelection
470 
472  sal_Int32 nChildIndex )
473 {
475 }
476 
478  sal_Int32 nChildIndex )
479 {
480  return maSelectionHelper.isAccessibleChildSelected(nChildIndex);
481 }
482 
484 {
485 }
486 
488 {
490 }
491 
493 {
495 }
496 
498  sal_Int32 nSelectedChildIndex )
499 {
500  return maSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
501 }
502 
503 // index has to be treated as global child index.
505  sal_Int32 nChildIndex )
506 {
508 }
509 
511 {
512  SolarMutexGuard g;
513 
514  uno::Any anyAttribute;
515  SwDoc *pDoc = GetMap() ? GetShell()->GetDoc() : nullptr;
516 
517  if (!pDoc)
518  return anyAttribute;
519  SwCursorShell* pCursorShell = GetCursorShell();
520  if( !pCursorShell )
521  return anyAttribute;
522 
523  SwFEShell* pFEShell = dynamic_cast<SwFEShell*>(pCursorShell);
524  if( pFEShell )
525  {
526  OUString sDisplay;
527  sal_uInt16 nPage, nLogPage;
528  pFEShell->GetPageNumber(-1,true,nPage,nLogPage,sDisplay);
529 
530  OUString sValue = "page-name:" + sDisplay +
531  ";page-number:" +
532  OUString::number( nPage ) +
533  ";total-pages:" +
534  OUString::number( pCursorShell->GetPageCnt() ) + ";";
535 
536  SwContentFrame* pCurrFrame = pCursorShell->GetCurrFrame();
537  SwPageFrame* pCurrPage=static_cast<SwFrame*>(pCurrFrame)->FindPageFrame();
538  sal_uLong nLineNum = 0;
539  SwTextFrame* pTextFrame = nullptr;
540  SwTextFrame* pCurrTextFrame = nullptr;
541  pTextFrame = static_cast< SwTextFrame* >(pCurrPage->ContainsContent());
542  if (pCurrFrame->IsInFly())//such as, graphic,chart
543  {
544  SwFlyFrame *pFlyFrame = pCurrFrame->FindFlyFrame();
545  const SwFormatAnchor& rAnchor = pFlyFrame->GetFormat()->GetAnchor();
546  RndStdIds eAnchorId = rAnchor.GetAnchorId();
547  if(eAnchorId == RndStdIds::FLY_AS_CHAR)
548  {
549  const SwFrame *pSwFrame = pFlyFrame->GetAnchorFrame();
550  if(pSwFrame->IsTextFrame())
551  pCurrTextFrame = const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pSwFrame));
552  }
553  }
554  else
555  {
556  assert(dynamic_cast<SwTextFrame*>(pCurrFrame));
557  pCurrTextFrame = static_cast<SwTextFrame* >(pCurrFrame);
558  }
559  //check whether the text frame where the Graph/OLE/Frame anchored is in the Header/Footer
560  SwFrame* pFrame = pCurrTextFrame;
561  while ( pFrame && !pFrame->IsHeaderFrame() && !pFrame->IsFooterFrame() )
562  pFrame = pFrame->GetUpper();
563  if ( pFrame )
564  pCurrTextFrame = nullptr;
565  //check shape
566  if(pCursorShell->Imp()->GetDrawView())
567  {
568  const SdrMarkList &rMrkList = pCursorShell->Imp()->GetDrawView()->GetMarkedObjectList();
569  for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
570  {
571  SdrObject *pObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
572  SwFrameFormat* pFormat = static_cast<SwDrawContact*>(pObj->GetUserCall())->GetFormat();
573  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
574  if( RndStdIds::FLY_AS_CHAR != rAnchor.GetAnchorId() )
575  pCurrTextFrame = nullptr;
576  }
577  }
578  //calculate line number
579  if (pCurrTextFrame && pTextFrame)
580  {
581  if (!(pCurrTextFrame->IsInTab() || pCurrTextFrame->IsInFootnote()))
582  {
583  while( pTextFrame && pTextFrame != pCurrTextFrame )
584  {
585  //check header/footer
586  pFrame = pTextFrame;
587  while ( pFrame && !pFrame->IsHeaderFrame() && !pFrame->IsFooterFrame() )
588  pFrame = pFrame->GetUpper();
589  if ( pFrame )
590  {
591  pTextFrame = static_cast< SwTextFrame*>(pTextFrame->GetNextContentFrame());
592  continue;
593  }
594  if (!(pTextFrame->IsInTab() || pTextFrame->IsInFootnote() || pTextFrame->IsInFly()))
595  nLineNum += pTextFrame->GetThisLines();
596  pTextFrame = static_cast< SwTextFrame* >(pTextFrame ->GetNextContentFrame());
597  }
598  SwPaM* pCaret = pCursorShell->GetCursor();
599  if (!pCurrTextFrame->IsEmpty() && pCaret)
600  {
601  assert(pCurrTextFrame->IsTextFrame());
602  const SwPosition* pPoint = nullptr;
603  if (pCurrTextFrame->IsInFly())
604  {
605  SwFlyFrame *pFlyFrame = pCurrTextFrame->FindFlyFrame();
606  const SwFormatAnchor& rAnchor = pFlyFrame->GetFormat()->GetAnchor();
607  pPoint = rAnchor.GetContentAnchor();
608  SwContentNode *const pNode(pPoint->nNode.GetNode().GetContentNode());
609  pCurrTextFrame = pNode
610  ? static_cast<SwTextFrame*>(pNode->getLayoutFrame(
611  pCurrTextFrame->getRootFrame(), pPoint))
612  : nullptr;
613  }
614  else
615  pPoint = pCaret->GetPoint();
616  if (pCurrTextFrame)
617  {
618  TextFrameIndex const nActPos(pCurrTextFrame->MapModelToViewPos(*pPoint));
619  nLineNum += pCurrTextFrame->GetLineCount( nActPos );
620  }
621  }
622  else
623  ++nLineNum;
624  }
625  }
626 
627  sValue += "line-number:" + OUString::number( nLineNum ) + ";";
628 
629  SwFrame* pCurrCol=static_cast<SwFrame*>(pCurrFrame)->FindColFrame();
630 
631  sValue += "column-number:";
632 
633  int nCurrCol = 1;
634  if(pCurrCol!=nullptr)
635  {
636  //SwLayoutFrame* pParent = pCurrCol->GetUpper();
637  SwFrame* pCurrPageCol=static_cast<SwFrame*>(pCurrFrame)->FindColFrame();
638  while(pCurrPageCol && pCurrPageCol->GetUpper() && pCurrPageCol->GetUpper()->IsPageFrame())
639  {
640  pCurrPageCol = pCurrPageCol->GetUpper();
641  }
642 
643  SwLayoutFrame* pParent = pCurrPageCol->GetUpper();
644 
645  if(pParent!=nullptr)
646  {
647  SwFrame* pCol = pParent->Lower();
648  while(pCol&&(pCol!=pCurrPageCol))
649  {
650  pCol = pCol->GetNext();
651  ++nCurrCol;
652  }
653  }
654  }
655  sValue += OUString::number( nCurrCol ) + ";";
656 
657  const SwFormatCol &rFormatCol=pCurrPage->GetAttrSet()->GetCol();
658  sal_uInt16 nColCount=rFormatCol.GetNumCols();
659  nColCount = nColCount>0?nColCount:1;
660  sValue += "total-columns:" + OUString::number( nColCount ) + ";";
661 
662  SwSectionFrame* pCurrSctFrame=static_cast<SwFrame*>(pCurrFrame)->FindSctFrame();
663  if(pCurrSctFrame!=nullptr && pCurrSctFrame->GetSection()!=nullptr )
664  {
665  OUString sectionName = pCurrSctFrame->GetSection()->GetSectionName();
666 
667  sectionName = sectionName.replaceFirst( "\\" , "\\\\" );
668  sectionName = sectionName.replaceFirst( "=" , "\\=" );
669  sectionName = sectionName.replaceFirst( ";" , "\\;" );
670  sectionName = sectionName.replaceFirst( "," , "\\," );
671  sectionName = sectionName.replaceFirst( ":" , "\\:" );
672 
673  sValue += "section-name:" + sectionName + ";";
674 
675  //section-columns-number
676 
677  nCurrCol = 1;
678 
679  if(pCurrCol!=nullptr)
680  {
681  SwLayoutFrame* pParent = pCurrCol->GetUpper();
682  if(pParent!=nullptr)
683  {
684  SwFrame* pCol = pParent->Lower();
685  while(pCol&&(pCol!=pCurrCol))
686  {
687  pCol = pCol->GetNext();
688  nCurrCol +=1;
689  }
690  }
691  }
692  sValue += "section-columns-number:" +
693  OUString::number( nCurrCol ) + ";";
694 
695  //section-total-columns
696  const SwFormatCol &rFormatSctCol=pCurrSctFrame->GetAttrSet()->GetCol();
697  sal_uInt16 nSctColCount=rFormatSctCol.GetNumCols();
698  nSctColCount = nSctColCount>0?nSctColCount:1;
699  sValue += "section-total-columns:" +
700  OUString::number( nSctColCount ) + ";";
701  }
702 
703  anyAttribute <<= sValue;
704  }
705  return anyAttribute;
706 }
707 
709 {
710  SolarMutexGuard aGuard;
711  return sal_Int32(SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor);
712 }
713 
714 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:315
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:158
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
Definition: accdoc.cxx:293
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
Definition: accdoc.cxx:492
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
Definition: acccontext.cxx:443
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2877
size_t GetMarkCount() const
Marks a position in the document model.
Definition: pam.hxx:35
SwAccessibleDocumentBase(std::shared_ptr< SwAccessibleMap > const &pInitMap)
Definition: accdoc.cxx:66
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
Definition: accdoc.cxx:261
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:115
bool IsInFly() const
Definition: frame.hxx:962
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:195
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
Definition: accdoc.cxx:504
OUString GetTitle(sal_uInt16 nMaxLen=0) const
SwViewShellImp * Imp()
Definition: viewsh.hxx:182
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: acccontext.cxx:569
constexpr tools::Long Left() const
bool IsInFootnote() const
Definition: frame.hxx:950
vcl::Window * GetAccessibleParentWindow() const
SwAccessibleSelectionHelper maSelectionHelper
Definition: accdoc.hxx:97
sal_uIntPtr sal_uLong
vcl::Window * GetWindow()
Definition: acccontext.cxx:83
WeakReference< XInterface > mxParent
void AddChild(vcl::Window *pWin, bool bFireEvent=true)
Definition: accdoc.cxx:95
void Scrolled(const SwRect &rOldVisArea)
Definition: acccontext.cxx:264
Definition: doc.hxx:188
constexpr OUStringLiteral sImplementationName
Definition: accdoc.cxx:56
SwViewShell * GetShell()
convenience method to get the SwViewShell through accessibility map
Definition: acccontext.hxx:119
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
SdrMark * GetMark(size_t nNum) const
virtual void SAL_CALL clearAccessibleSelection() override
Definition: accdoc.cxx:483
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
Definition: accdoc.cxx:477
static sal_Int32 GetChildCount(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame *pFrame, bool bInPagePreviewr)
Definition: accframe.cxx:41
virtual css::awt::Point SAL_CALL getLocation() override
Definition: accdoc.cxx:245
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: accdoc.cxx:189
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: accdoc.cxx:457
SwCursorShell * GetCursorShell()
convenience method to get SwCursorShell through accessibility map
Definition: acccontext.cxx:101
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
Definition: accdoc.cxx:471
SwViewShell * GetShell() const
Definition: accmap.hxx:169
const SwFrame * GetFrame() const
Definition: accframe.hxx:103
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
bool isAccessibleChildSelected(sal_Int32 nChildIndex)
sal_uLong GetThisLines() const
Definition: txtfrm.hxx:668
bool IsInTab() const
Definition: frame.hxx:956
constexpr OUStringLiteral sServiceName
Definition: accdoc.cxx:55
int nCount
sal_Int32 SAL_CALL getBackground() override
Definition: accdoc.cxx:708
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
bool IsTextFrame() const
Definition: frame.hxx:1235
constexpr OUStringLiteral sAccessibleServiceName
Definition: acccontext.hxx:45
constexpr tools::Long GetWidth() const
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1112
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:677
virtual ~SwAccessibleDocumentBase() override
Definition: accdoc.cxx:75
css::uno::Reference< css::accessibility::XAccessible > getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex)
SdrObject * GetMarkedSdrObj() const
bool IsEmpty() const
Definition: txtfrm.hxx:521
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: accdoc.cxx:425
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: accdoc.cxx:130
#define SFX_TITLE_APINAME
const OUString & getDocAccTitle() const
Definition: doc.hxx:556
Style of a layout element.
Definition: frmfmt.hxx:59
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:165
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1269
#define SW_MOD()
Definition: swmodule.hxx:256
virtual css::awt::Rectangle SAL_CALL getBounds() override
Definition: accdoc.cxx:221
virtual css::awt::Size SAL_CALL getSize() override
Definition: accdoc.cxx:277
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1291
const OUString & GetSectionName() const
Definition: section.hxx:168
const SwPosition * GetPoint() const
Definition: pam.hxx:207
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
static OUString GetResource(TranslateId pResId, const OUString *pArg1=nullptr, const OUString *pArg2=nullptr)
const SwFrame * Lower() const
Definition: layfrm.hxx:101
virtual void SAL_CALL selectAllAccessibleChildren() override
Definition: accdoc.cxx:487
SwSection * GetSection()
Definition: sectfrm.hxx:93
const SdrMarkList & GetMarkedObjectList() const
FlyAnchors.
Definition: fmtanchr.hxx:34
SwAccessibleDocument(std::shared_ptr< SwAccessibleMap > const &pInitMap)
Definition: accdoc.cxx:346
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
float u
unsigned char sal_Bool
const SwRect & GetVisArea() const
Definition: accmap.cxx:3461
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: accdoc.cxx:161
constexpr tools::Long Top() const
bool IsInside(const Point &rPOINT) const
void SetVisArea(const SwRect &rNewVisArea)
Definition: accframe.hxx:131
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: accdoc.cxx:311
access to an accessible Writer document
Definition: accdoc.hxx:92
virtual ~SwAccessibleDocument() override
Definition: accdoc.cxx:367
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Definition: acccontext.cxx:579
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
Definition: accdoc.cxx:510
A page of the document layout.
Definition: pagefrm.hxx:57
virtual OUString SAL_CALL getImplementationName() override
Definition: accdoc.cxx:420
bool IsDisposing() const
Definition: acccontext.hxx:112
IMPL_LINK(SwAccessibleDocument, WindowChildEventListener, VclWindowEvent &, rEvent, void)
Definition: accdoc.cxx:384
constexpr Point TopLeft() const
sal_uInt16 GetLineCount(TextFrameIndex nPos)
Determines the line count.
Definition: txtfrm.cxx:3746
constexpr Size GetSize() const
SwDrawView * GetDrawView()
Definition: viewimp.hxx:154
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2447
void RemoveChild(vcl::Window *pWin)
Definition: accdoc.cxx:114
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true)
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet)
Definition: acccontext.cxx:481
void selectAccessibleChild(sal_Int32 nChildIndex)
const char sDisplay[]
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: accdoc.cxx:464
bool IsPageFrame() const
Definition: frame.hxx:1179
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
SwAccessibleMap * GetMap()
Definition: acccontext.hxx:115
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: accdoc.cxx:437
virtual OUString SAL_CALL getAccessibleName() override
Definition: accdoc.cxx:194
void deselectAccessibleChild(sal_Int32 nChildIndex)
VclPtr< vcl::Window > mpChildWin
Definition: accdoc.hxx:34
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet) override
Definition: accdoc.cxx:336
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
Definition: accdoc.cxx:166
RndStdIds
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
sal_uInt16 GetPageNumber(const Point &rPoint) const
Page number of the page containing Point, O if no page.
Definition: fews.cxx:185
const SwFrame * GetAnchorFrame() const
sal_uInt16 GetAccessibleRole() const
const SwRect & GetVisArea() const
Definition: accframe.hxx:136
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: accdoc.cxx:430
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: acccontext.cxx:814
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:67
void AddState(sal_Int16 aState)
css::uno::Reference< css::accessibility::XAccessible > mxParent
Definition: accdoc.hxx:32
SdrObjUserCall * GetUserCall() const
void SetName(const OUString &rName)
Definition: acccontext.hxx:102
bool IsFooterFrame() const
Definition: frame.hxx:1195
AnyEventRef aEvent
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
Definition: accdoc.cxx:497
bool IsHeaderFrame() const
Definition: frame.hxx:1191
constexpr tools::Long GetHeight() const
SwFrame * GetNext()
Definition: frame.hxx:677
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Definition: accdoc.cxx:144
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true) override
Definition: accdoc.cxx:374