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