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<const SwFEShell*>( pCursorShell) != nullptr
524  ? static_cast<SwFEShell*>( pCursorShell )
525  : nullptr;
526  if( pFEShell )
527  {
528  OUString sDisplay;
529  sal_uInt16 nPage, nLogPage;
530  pFEShell->GetPageNumber(-1,true,nPage,nLogPage,sDisplay);
531 
532  OUString sValue = "page-name:" + sDisplay +
533  ";page-number:" +
534  OUString::number( nPage ) +
535  ";total-pages:" +
536  OUString::number( pCursorShell->GetPageCnt() ) + ";";
537 
538  SwContentFrame* pCurrFrame = pCursorShell->GetCurrFrame();
539  SwPageFrame* pCurrPage=static_cast<SwFrame*>(pCurrFrame)->FindPageFrame();
540  sal_uLong nLineNum = 0;
541  SwTextFrame* pTextFrame = nullptr;
542  SwTextFrame* pCurrTextFrame = nullptr;
543  pTextFrame = static_cast< SwTextFrame* >(pCurrPage->ContainsContent());
544  if (pCurrFrame->IsInFly())//such as, graphic,chart
545  {
546  SwFlyFrame *pFlyFrame = pCurrFrame->FindFlyFrame();
547  const SwFormatAnchor& rAnchor = pFlyFrame->GetFormat()->GetAnchor();
548  RndStdIds eAnchorId = rAnchor.GetAnchorId();
549  if(eAnchorId == RndStdIds::FLY_AS_CHAR)
550  {
551  const SwFrame *pSwFrame = pFlyFrame->GetAnchorFrame();
552  if(pSwFrame->IsTextFrame())
553  pCurrTextFrame = const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pSwFrame));
554  }
555  }
556  else
557  {
558  assert(dynamic_cast<SwTextFrame*>(pCurrFrame));
559  pCurrTextFrame = static_cast<SwTextFrame* >(pCurrFrame);
560  }
561  //check whether the text frame where the Graph/OLE/Frame anchored is in the Header/Footer
562  SwFrame* pFrame = pCurrTextFrame;
563  while ( pFrame && !pFrame->IsHeaderFrame() && !pFrame->IsFooterFrame() )
564  pFrame = pFrame->GetUpper();
565  if ( pFrame )
566  pCurrTextFrame = nullptr;
567  //check shape
568  if(pCursorShell->Imp()->GetDrawView())
569  {
570  const SdrMarkList &rMrkList = pCursorShell->Imp()->GetDrawView()->GetMarkedObjectList();
571  for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
572  {
573  SdrObject *pObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
574  SwFrameFormat* pFormat = static_cast<SwDrawContact*>(pObj->GetUserCall())->GetFormat();
575  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
576  if( RndStdIds::FLY_AS_CHAR != rAnchor.GetAnchorId() )
577  pCurrTextFrame = nullptr;
578  }
579  }
580  //calculate line number
581  if (pCurrTextFrame && pTextFrame)
582  {
583  if (!(pCurrTextFrame->IsInTab() || pCurrTextFrame->IsInFootnote()))
584  {
585  while( pTextFrame && pTextFrame != pCurrTextFrame )
586  {
587  //check header/footer
588  pFrame = pTextFrame;
589  while ( pFrame && !pFrame->IsHeaderFrame() && !pFrame->IsFooterFrame() )
590  pFrame = pFrame->GetUpper();
591  if ( pFrame )
592  {
593  pTextFrame = static_cast< SwTextFrame*>(pTextFrame->GetNextContentFrame());
594  continue;
595  }
596  if (!(pTextFrame->IsInTab() || pTextFrame->IsInFootnote() || pTextFrame->IsInFly()))
597  nLineNum += pTextFrame->GetThisLines();
598  pTextFrame = static_cast< SwTextFrame* >(pTextFrame ->GetNextContentFrame());
599  }
600  SwPaM* pCaret = pCursorShell->GetCursor();
601  if (!pCurrTextFrame->IsEmpty() && pCaret)
602  {
603  assert(pCurrTextFrame->IsTextFrame());
604  const SwPosition* pPoint = nullptr;
605  if (pCurrTextFrame->IsInFly())
606  {
607  SwFlyFrame *pFlyFrame = pCurrTextFrame->FindFlyFrame();
608  const SwFormatAnchor& rAnchor = pFlyFrame->GetFormat()->GetAnchor();
609  pPoint = rAnchor.GetContentAnchor();
610  SwContentNode *const pNode(pPoint->nNode.GetNode().GetContentNode());
611  pCurrTextFrame = pNode
612  ? static_cast<SwTextFrame*>(pNode->getLayoutFrame(
613  pCurrTextFrame->getRootFrame(), pPoint))
614  : nullptr;
615  }
616  else
617  pPoint = pCaret->GetPoint();
618  if (pCurrTextFrame)
619  {
620  TextFrameIndex const nActPos(pCurrTextFrame->MapModelToViewPos(*pPoint));
621  nLineNum += pCurrTextFrame->GetLineCount( nActPos );
622  }
623  }
624  else
625  ++nLineNum;
626  }
627  }
628 
629  sValue += "line-number:" + OUString::number( nLineNum ) + ";";
630 
631  SwFrame* pCurrCol=static_cast<SwFrame*>(pCurrFrame)->FindColFrame();
632 
633  sValue += "column-number:";
634 
635  int nCurrCol = 1;
636  if(pCurrCol!=nullptr)
637  {
638  //SwLayoutFrame* pParent = pCurrCol->GetUpper();
639  SwFrame* pCurrPageCol=static_cast<SwFrame*>(pCurrFrame)->FindColFrame();
640  while(pCurrPageCol && pCurrPageCol->GetUpper() && pCurrPageCol->GetUpper()->IsPageFrame())
641  {
642  pCurrPageCol = pCurrPageCol->GetUpper();
643  }
644 
645  SwLayoutFrame* pParent = pCurrPageCol->GetUpper();
646 
647  if(pParent!=nullptr)
648  {
649  SwFrame* pCol = pParent->Lower();
650  while(pCol&&(pCol!=pCurrPageCol))
651  {
652  pCol = pCol->GetNext();
653  ++nCurrCol;
654  }
655  }
656  }
657  sValue += OUString::number( nCurrCol ) + ";";
658 
659  const SwFormatCol &rFormatCol=pCurrPage->GetAttrSet()->GetCol();
660  sal_uInt16 nColCount=rFormatCol.GetNumCols();
661  nColCount = nColCount>0?nColCount:1;
662  sValue += "total-columns:" + OUString::number( nColCount ) + ";";
663 
664  SwSectionFrame* pCurrSctFrame=static_cast<SwFrame*>(pCurrFrame)->FindSctFrame();
665  if(pCurrSctFrame!=nullptr && pCurrSctFrame->GetSection()!=nullptr )
666  {
667  OUString sectionName = pCurrSctFrame->GetSection()->GetSectionName();
668 
669  sectionName = sectionName.replaceFirst( "\\" , "\\\\" );
670  sectionName = sectionName.replaceFirst( "=" , "\\=" );
671  sectionName = sectionName.replaceFirst( ";" , "\\;" );
672  sectionName = sectionName.replaceFirst( "," , "\\," );
673  sectionName = sectionName.replaceFirst( ":" , "\\:" );
674 
675  sValue += "section-name:" + sectionName + ";";
676 
677  //section-columns-number
678 
679  nCurrCol = 1;
680 
681  if(pCurrCol!=nullptr)
682  {
683  SwLayoutFrame* pParent = pCurrCol->GetUpper();
684  if(pParent!=nullptr)
685  {
686  SwFrame* pCol = pParent->Lower();
687  while(pCol&&(pCol!=pCurrCol))
688  {
689  pCol = pCol->GetNext();
690  nCurrCol +=1;
691  }
692  }
693  }
694  sValue += "section-columns-number:" +
695  OUString::number( nCurrCol ) + ";";
696 
697  //section-total-columns
698  const SwFormatCol &rFormatSctCol=pCurrSctFrame->GetAttrSet()->GetCol();
699  sal_uInt16 nSctColCount=rFormatSctCol.GetNumCols();
700  nSctColCount = nSctColCount>0?nSctColCount:1;
701  sValue += "section-total-columns:" +
702  OUString::number( nSctColCount ) + ";";
703  }
704 
705  anyAttribute <<= sValue;
706  }
707  return anyAttribute;
708 }
709 
711 {
712  SolarMutexGuard aGuard;
713  return sal_Int32(SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor);
714 }
715 
716 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
Base class of the Writer layout elements.
Definition: frame.hxx:298
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:157
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:2859
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:98
static OUString GetResource(const char *pResId, const OUString *pArg1=nullptr, const OUString *pArg2=nullptr)
bool IsInFly() const
Definition: frame.hxx:942
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
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:1354
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: acccontext.cxx:569
bool IsInFootnote() const
Definition: frame.hxx:930
vcl::Window * GetAccessibleParentWindow() const
SwAccessibleSelectionHelper maSelectionHelper
Definition: accdoc.hxx:96
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:187
constexpr OUStringLiteral sImplementationName
Definition: accdoc.cxx:56
SwViewShell * GetShell()
convenience method to get the SwViewShell through accessibility map
Definition: acccontext.hxx:117
tools::Long GetWidth() const
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:35
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
tools::Long Left() const
const SwFrame * GetFrame() const
Definition: accframe.hxx:103
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
bool isAccessibleChildSelected(sal_Int32 nChildIndex)
sal_uLong GetThisLines() const
Definition: txtfrm.hxx:665
bool IsInTab() const
Definition: frame.hxx:936
constexpr OUStringLiteral sServiceName
Definition: accdoc.cxx:55
int nCount
sal_Int32 SAL_CALL getBackground() override
Definition: accdoc.cxx:710
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
bool IsTextFrame() const
Definition: frame.hxx:1215
constexpr OUStringLiteral sAccessibleServiceName
Definition: acccontext.hxx:43
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1092
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:675
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:518
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:555
Style of a layout element.
Definition: frmfmt.hxx:58
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:165
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1259
#define SW_MOD()
Definition: swmodule.hxx:255
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:1294
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
const SwFrame * Lower() const
Definition: layfrm.hxx:101
virtual void SAL_CALL selectAllAccessibleChildren() override
Definition: accdoc.cxx:487
SwSection * GetSection()
Definition: sectfrm.hxx:82
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:661
float u
unsigned char sal_Bool
const SwRect & GetVisArea() const
Definition: accmap.cxx:3513
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: accdoc.cxx:161
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:91
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
tools::Long Top() const
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
Definition: accdoc.cxx:510
A page of the document layout.
Definition: pagefrm.hxx:41
virtual OUString SAL_CALL getImplementationName() override
Definition: accdoc.cxx:420
bool IsDisposing() const
Definition: acccontext.hxx:110
IMPL_LINK(SwAccessibleDocument, WindowChildEventListener, VclWindowEvent &, rEvent, void)
Definition: accdoc.cxx:384
Size GetSize() const
sal_uInt16 GetLineCount(TextFrameIndex nPos)
Determines the line count.
Definition: txtfrm.cxx:3735
SwDrawView * GetDrawView()
Definition: viewimp.hxx:154
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2448
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:1159
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
SwAccessibleMap * GetMap()
Definition: acccontext.hxx:113
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:33
tools::Long GetHeight() const
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:184
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:31
SdrObjUserCall * GetUserCall() const
void SetName(const OUString &rName)
Definition: acccontext.hxx:100
bool IsFooterFrame() const
Definition: frame.hxx:1175
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:1171
SwFrame * GetNext()
Definition: frame.hxx:659
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