LibreOffice Module vcl (master)  1
svtabbx.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 
22 #include <vcl/toolkit/svtabbx.hxx>
23 #include <vcl/headbar.hxx>
24 #include <vcl/toolkit/svlbitm.hxx>
27 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
28 #include <rtl/ustrbuf.hxx>
29 #include <sal/log.hxx>
30 #include <o3tl/safeint.hxx>
31 #include <osl/diagnose.h>
32 #include <strings.hrc>
33 #include <svdata.hxx>
34 #include <memory>
35 #include <tools/json_writer.hxx>
36 
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::accessibility;
39 
42 
44  SvTreeListEntry* pEntry,
45  SvTabListBox* pTabListBox,
46  bool bCheckButtons)
47 {
48  while (pEntry)
49  {
50  auto aNode = rJsonWriter.startStruct();
51 
52  // simple listbox value
53  const SvLBoxItem* pIt = pEntry->GetFirstItem(SvLBoxItemType::String);
54  if (pIt)
55  rJsonWriter.put("text", static_cast<const SvLBoxString*>(pIt)->GetText());
56 
57  // column based data
58  {
59  auto aColumns = rJsonWriter.startArray("columns");
60 
61  for (size_t i = 0; i < pEntry->ItemCount(); i++)
62  {
63  SvLBoxItem& rItem = pEntry->GetItem(i);
64  if (rItem.GetType() == SvLBoxItemType::String)
65  {
66  const SvLBoxString* pStringItem = dynamic_cast<const SvLBoxString*>(&rItem);
67  if (pStringItem)
68  {
69  auto aColumn = rJsonWriter.startStruct();
70  rJsonWriter.put("text", pStringItem->GetText());
71  }
72  }
73  }
74  }
75 
76  // SalInstanceTreeView does not use the flag CHILDREN_ON_DEMAND
77  // and it creates a dummy child
78  const SvTreeListEntries& rChildren = pEntry->GetChildEntries();
79  if (rChildren.size() == 1)
80  {
81  auto& rChild = rChildren[0];
82  if (const SvLBoxItem* pChild = rChild->GetFirstItem(SvLBoxItemType::String))
83  {
84  if (static_cast<const SvLBoxString*>(pChild)->GetText() == "<dummy>")
85  rJsonWriter.put("ondemand", "true");
86  }
87  }
88 
89  if (bCheckButtons)
90  {
91  SvButtonState eCheckState = pTabListBox->GetCheckButtonState(pEntry);
92  if (eCheckState == SvButtonState::Unchecked)
93  rJsonWriter.put("state", "false");
94  else if (eCheckState == SvButtonState::Checked)
95  rJsonWriter.put("state", "true");
96  }
97 
98  if (pTabListBox->IsSelected(pEntry))
99  rJsonWriter.put("selected", "true");
100 
101  rJsonWriter.put("row", OString::number(pTabListBox->GetModel()->GetAbsPos(pEntry)).getStr());
102 
103  SvTreeListEntry* pChild = pTabListBox->FirstChild(pEntry);
104  if (pChild)
105  {
106  auto childrenNode = rJsonWriter.startArray("children");
107  lcl_DumpEntryAndSiblings(rJsonWriter, pChild, pTabListBox, bCheckButtons);
108  }
109 
110  pEntry = pEntry->NextSibling();
111  }
112 }
113 
115 {
117 
118  rJsonWriter.put("singleclickactivate", GetActivateOnSingleClick());
119 
120  bool bCheckButtons = static_cast<int>(nTreeFlags & SvTreeFlags::CHKBTN);
121 
122  auto entriesNode = rJsonWriter.startArray("entries");
123  lcl_DumpEntryAndSiblings(rJsonWriter, First(), this, bCheckButtons);
124 }
125 
126 // SvTreeListBox callback
127 
129 {
131  if( mvTabList.empty() )
132  return;
133 
134  DBG_ASSERT(!mvTabList.empty(),"TabList ?");
135 
136  // The tree listbox has now inserted its tabs into the list. Now we
137  // fluff up the list with additional tabs and adjust the rightmost tab
138  // of the tree listbox.
139 
140  // Picking the rightmost tab.
141  // HACK for the explorer! If ViewParent != 0, the first tab of the tree
142  // listbox is calculated by the tree listbox itself! This behavior is
143  // necessary for ButtonsOnRoot, as the explorer does not know in this
144  // case, which additional offset it needs to add to the tabs in this mode
145  // -- the tree listbox knows that, though!
146  /*
147  if( !pViewParent )
148  {
149  SvLBoxTab* pFirstTab = (SvLBoxTab*)aTabs.GetObject( aTabs.Count()-1 );
150  pFirstTab->SetPos( pTabList[0].GetPos() );
151  pFirstTab->nFlags &= ~MYTABMASK;
152  pFirstTab->nFlags |= pTabList[0].nFlags;
153  }
154  */
155 
156  // append all other tabs to the list
157  for( sal_uInt16 nCurTab = 1; nCurTab < sal_uInt16(mvTabList.size()); nCurTab++ )
158  {
159  SvLBoxTab& rTab = mvTabList[nCurTab];
160  AddTab( rTab.GetPos(), rTab.nFlags );
161  }
162 }
163 
164 void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
165  const Image& rColl, const Image& rExp)
166 {
167  SvTreeListBox::InitEntry(pEntry, rStr, rColl, rExp);
168 
169  sal_Int32 nIndex = 0;
170  // TODO: verify if nTabCount is always >0 here!
171  const sal_uInt16 nCount = mvTabList.size() - 1;
172  for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
173  {
174  const OUString aToken = GetToken(aCurEntry, nIndex);
175  pEntry->AddItem(std::make_unique<SvLBoxString>(aToken));
176  }
177 }
178 
180  : SvTreeListBox( pParent, nBits )
181 {
182  SetHighlightRange(); // select full width
183 }
184 
186 {
187  disposeOnce();
188 }
189 
191 {
192  mvTabList.clear();
194 }
195 
196 void SvTabListBox::SetTabs(sal_uInt16 nTabs, tools::Long const pTabPositions[], MapUnit eMapUnit)
197 {
198  mvTabList.resize(nTabs);
199 
200  MapMode aMMSource( eMapUnit );
201  MapMode aMMDest( MapUnit::MapPixel );
202 
203  for( sal_uInt16 nIdx = 0; nIdx < sal_uInt16(mvTabList.size()); nIdx++, pTabPositions++ )
204  {
205  Size aSize( *pTabPositions, 0 );
206  aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
207  tools::Long nNewTab = aSize.Width();
208  mvTabList[nIdx].SetPos( nNewTab );
209  mvTabList[nIdx].nFlags &= MYTABMASK;
210  }
212  if( IsUpdateMode() )
213  Invalidate();
214 }
215 
217  bool /*bChildrenOnDemand*/,
218  sal_uInt32 nPos, void* pUserData )
219 {
220  return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData );
221 }
222 
223 SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString& rStr,SvTreeListEntry* pParent,sal_uInt32 nPos,sal_uInt16 nCol,
224  void* pUser )
225 {
226  OUString aStr;
227  if( nCol != 0xffff )
228  {
229  while( nCol )
230  {
231  aStr += "\t";
232  nCol--;
233  }
234  }
235  aStr += rStr;
236  OUString aFirstStr( aStr );
237  sal_Int32 nEnd = aFirstStr.indexOf( '\t' );
238  if( nEnd != -1 )
239  {
240  aFirstStr = aFirstStr.copy(0, nEnd);
241  aCurEntry = aStr.copy(++nEnd);
242  }
243  else
244  aCurEntry.clear();
245  return SvTreeListBox::InsertEntry( aFirstStr, pParent, false, nPos, pUser );
246 }
247 
249 {
250  return GetEntryText( pEntry, 0xffff );
251 }
252 
253 OUString SvTabListBox::GetEntryText( const SvTreeListEntry* pEntry, sal_uInt16 nCol )
254 {
255  DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry");
256  OUStringBuffer aResult;
257  if( pEntry )
258  {
259  sal_uInt16 nCount = pEntry->ItemCount();
260  sal_uInt16 nCur = 0;
261  while( nCur < nCount )
262  {
263  const SvLBoxItem& rStr = pEntry->GetItem( nCur );
264  if (rStr.GetType() == SvLBoxItemType::String)
265  {
266  if( nCol == 0xffff )
267  {
268  if (!aResult.isEmpty())
269  aResult.append("\t");
270  aResult.append(static_cast<const SvLBoxString&>(rStr).GetText());
271  }
272  else
273  {
274  if( nCol == 0 )
275  return static_cast<const SvLBoxString&>(rStr).GetText();
276  nCol--;
277  }
278  }
279  nCur++;
280  }
281  }
282  return aResult.makeStringAndClear();
283 }
284 
285 OUString SvTabListBox::GetEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const
286 {
287  SvTreeListEntry* pEntry = GetEntryOnPos( nPos );
288  return GetEntryText( pEntry, nCol );
289 }
290 
291 OUString SvTabListBox::GetCellText( sal_uInt32 nPos, sal_uInt16 nCol ) const
292 {
293  SvTreeListEntry* pEntry = GetEntryOnPos( nPos );
294  DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" );
295  OUString aResult;
296  if (pEntry && pEntry->ItemCount() > o3tl::make_unsigned(nCol+1))
297  {
298  const SvLBoxItem& rStr = pEntry->GetItem( nCol + 1 );
299  if (rStr.GetType() == SvLBoxItemType::String)
300  aResult = static_cast<const SvLBoxString&>(rStr).GetText();
301  }
302  return aResult;
303 }
304 
305 sal_uInt32 SvTabListBox::GetEntryPos( const SvTreeListEntry* pEntry ) const
306 {
307  sal_uInt32 nPos = 0;
308  SvTreeListEntry* pTmpEntry = First();
309  while( pTmpEntry )
310  {
311  if ( pTmpEntry == pEntry )
312  return nPos;
313  pTmpEntry = Next( pTmpEntry );
314  ++nPos;
315  }
316  return 0xffffffff;
317 }
318 
319 // static
320 OUString SvTabListBox::GetToken( const OUString &sStr, sal_Int32& nIndex )
321 {
322  return sStr.getToken(0, '\t', nIndex);
323 }
324 
325 OUString SvTabListBox::GetTabEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const
326 {
327  SvTreeListEntry* pEntry = SvTreeListBox::GetEntry( nPos );
328  DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " );
329  OUStringBuffer aResult;
330  if ( pEntry )
331  {
332  sal_uInt16 nCount = pEntry->ItemCount();
333  sal_uInt16 nCur = 0;
334  while( nCur < nCount )
335  {
336  const SvLBoxItem& rBoxItem = pEntry->GetItem( nCur );
337  if (rBoxItem.GetType() == SvLBoxItemType::String)
338  {
339  if ( nCol == 0xffff )
340  {
341  if (!aResult.isEmpty())
342  aResult.append("\t");
343  aResult.append(static_cast<const SvLBoxString&>(rBoxItem).GetText());
344  }
345  else
346  {
347  if ( nCol == 0 )
348  {
349  OUString sRet = static_cast<const SvLBoxString&>(rBoxItem).GetText();
350  if ( sRet.isEmpty() )
351  sRet = VclResId( STR_SVT_ACC_EMPTY_FIELD );
352  return sRet;
353  }
354  --nCol;
355  }
356  }
357  ++nCur;
358  }
359  }
360  return aResult.makeStringAndClear();
361 }
362 
363 SvTreeListEntry* SvTabListBox::GetEntryOnPos( sal_uInt32 _nEntryPos ) const
364 {
365  SvTreeListEntry* pEntry = nullptr;
366  sal_uInt32 i, nPos = 0, nCount = GetLevelChildCount( nullptr );
367  for ( i = 0; i < nCount; ++i )
368  {
369  SvTreeListEntry* pParent = GetEntry(i);
370  if ( nPos == _nEntryPos )
371  {
372  pEntry = pParent;
373  break;
374  }
375  else
376  {
377  nPos++;
378  pEntry = GetChildOnPos( pParent, _nEntryPos, nPos );
379  if ( pEntry )
380  break;
381  }
382  }
383 
384  return pEntry;
385 }
386 
387 SvTreeListEntry* SvTabListBox::GetChildOnPos( SvTreeListEntry* _pParent, sal_uInt32 _nEntryPos, sal_uInt32& _rPos ) const
388 {
389  sal_uInt32 i, nCount = GetLevelChildCount( _pParent );
390  for ( i = 0; i < nCount; ++i )
391  {
392  SvTreeListEntry* pParent = GetEntry( _pParent, i );
393  if ( _rPos == _nEntryPos )
394  return pParent;
395  else
396  {
397  _rPos++;
398  SvTreeListEntry* pEntry = GetChildOnPos( pParent, _nEntryPos, _rPos );
399  if ( pEntry )
400  return pEntry;
401  }
402  }
403 
404  return nullptr;
405 }
406 
407 void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
408 {
409  DBG_ASSERT(nTab<mvTabList.size(),"GetTabPos:Invalid Tab");
410  if( nTab >= mvTabList.size() )
411  return;
412  SvLBoxTab& rTab = mvTabList[ nTab ];
413  SvLBoxTabFlags nFlags = rTab.nFlags;
414  nFlags &= ~MYTABMASK;
415  // see SvLBoxTab::CalcOffset for force, which only matters for centering
416  nFlags |= static_cast<SvLBoxTabFlags>(eJustify) | SvLBoxTabFlags::FORCE;
417  rTab.nFlags = nFlags;
419  if( IsUpdateMode() )
420  Invalidate();
421 }
422 
423 void SvTabListBox::SetTabEditable(sal_uInt16 nTab, bool bEditable)
424 {
425  DBG_ASSERT(nTab<mvTabList.size(),"GetTabPos:Invalid Tab");
426  if( nTab >= mvTabList.size() )
427  return;
428  SvLBoxTab& rTab = mvTabList[ nTab ];
429  if (bEditable)
431  else
432  rTab.nFlags &= ~SvLBoxTabFlags::EDITABLE;
433 }
434 
436 {
438  SetTabs();
439 
440  DBG_ASSERT(nTab<mvTabList.size(),"GetTabPos:Invalid Tab");
441  return aTabs[ nTab ]->GetPos();
442 }
443 
444 namespace vcl
445 {
447  {
449  AccessibleFactoryAccess m_aFactoryAccess;
450 
451  SvHeaderTabListBoxImpl() : m_pHeaderBar( nullptr ) { }
452  };
453 }
454 
456  : SvTabListBox(pParent, nWinStyle)
457  , m_bFirstPaint(true)
458  , m_pImpl(new ::vcl::SvHeaderTabListBoxImpl)
459  , m_pAccessible(nullptr)
460 {
461 }
462 
464 {
465  disposeOnce();
466 }
467 
469 {
470  m_pImpl.reset();
472 }
473 
474 void SvHeaderTabListBox::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect )
475 {
476  if (m_bFirstPaint)
477  {
478  m_bFirstPaint = false;
479  }
480  SvTabListBox::Paint(rRenderContext, rRect);
481 }
482 
484 {
485  DBG_ASSERT( !m_pImpl->m_pHeaderBar, "header bar already initialized" );
486  DBG_ASSERT( pHeaderBar, "invalid header bar initialization" );
487  m_pImpl->m_pHeaderBar = pHeaderBar;
488  SetScrolledHdl( LINK( this, SvHeaderTabListBox, ScrollHdl_Impl ) );
489  m_pImpl->m_pHeaderBar->SetCreateAccessibleHdl( LINK( this, SvHeaderTabListBox, CreateAccessibleHdl_Impl ) );
490 }
491 
493 {
494  return m_pImpl ? m_pImpl->m_pHeaderBar : nullptr;
495 }
496 
497 bool SvHeaderTabListBox::IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol )
498 {
500  SvLBoxButton& rItem = static_cast<SvLBoxButton&>( pEntry->GetItem( nCol + 1 ) );
501 
502  if (rItem.GetType() == SvLBoxItemType::Button)
503  {
504  SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
505  eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
506  }
507 
508  return ( eState == SvButtonState::Checked );
509 }
510 
512  const OUString& rStr, SvTreeListEntry* pParent, sal_uInt32 nPos, sal_uInt16 nCol, void* pUserData )
513 {
514  SvTreeListEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData );
516  return pEntry;
517 }
518 
520  SvTreeListEntry* pEnt, SvTreeListEntry* pPar, sal_uInt32 nPos )
521 {
522  sal_uInt32 n = SvTabListBox::Insert( pEnt, pPar, nPos );
524  return n;
525 }
526 
527 sal_uInt32 SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uInt32 nRootPos )
528 {
529  sal_uInt32 nPos = SvTabListBox::Insert( pEntry, nRootPos );
531  return nPos;
532 }
533 
535 {
537 
538  auto aHeaders = rJsonWriter.startArray("headers");
539 
540  HeaderBar* pHeaderBar = GetHeaderBar();
541  for(sal_uInt16 i = 0; i < pHeaderBar->GetItemCount(); i++)
542  {
543  auto aNode = rJsonWriter.startStruct();
544  rJsonWriter.put("text", pHeaderBar->GetItemText(pHeaderBar->GetItemId(i)));
545  }
546 }
547 
549 {
550  m_pImpl->m_pHeaderBar->SetOffset( -GetXOffset() );
551 }
552 
553 IMPL_LINK_NOARG(SvHeaderTabListBox, CreateAccessibleHdl_Impl, HeaderBar*, void)
554 {
555  vcl::Window* pParent = m_pImpl->m_pHeaderBar->GetAccessibleParentWindow();
556  DBG_ASSERT( pParent, "SvHeaderTabListBox..CreateAccessibleHdl_Impl - accessible parent not found" );
557  if ( pParent )
558  {
559  css::uno::Reference< XAccessible > xAccParent = pParent->GetAccessible();
560  if ( xAccParent.is() )
561  {
562  Reference< XAccessible > xAccessible = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxHeaderBar(
563  xAccParent, *this, AccessibleBrowseBoxObjType::ColumnHeaderBar );
564  m_pImpl->m_pHeaderBar->SetAccessible( xAccessible );
565  }
566  }
567 }
568 
570 {
571  if ( !m_aAccessibleChildren.empty() )
572  {
573  sal_uInt32 nCount = ( GetRowCount() + 1 ) * GetColumnCount();
574  if ( m_aAccessibleChildren.size() < nCount )
575  m_aAccessibleChildren.resize( nCount );
576  else
577  {
578  DBG_ASSERT( m_aAccessibleChildren.size() == nCount, "wrong children count" );
579  }
580  }
581 }
582 
583 bool SvHeaderTabListBox::IsCellCheckBox( sal_Int32 _nRow, sal_uInt16 _nColumn, TriState& _rState ) const
584 {
585  bool bRet = false;
586  SvTreeListEntry* pEntry = GetEntry( _nRow );
587  if ( pEntry )
588  {
589  sal_uInt16 nItemCount = pEntry->ItemCount();
590  if ( nItemCount > ( _nColumn + 1 ) )
591  {
592  SvLBoxItem& rItem = pEntry->GetItem( _nColumn + 1 );
593  if (rItem.GetType() == SvLBoxItemType::Button)
594  {
595  bRet = true;
596  _rState = ( ( static_cast<SvLBoxButton&>(rItem).GetButtonFlags() & SvItemStateFlags::UNCHECKED ) == SvItemStateFlags::NONE )
598  }
599  }
600  else
601  {
602  SAL_WARN( "svtools.contnr", "SvHeaderTabListBox::IsCellCheckBox(): column out of range" );
603  }
604  }
605  return bRet;
606 }
608 {
609  return GetEntryCount();
610 }
611 
613 {
614  return m_pImpl->m_pHeaderBar->GetItemCount();
615 }
616 
618 {
619  sal_Int32 nRet = -1;
620  SvTreeListEntry* pEntry = GetCurEntry();
621  if ( pEntry )
622  {
623  sal_uInt32 nCount = GetEntryCount();
624  for ( sal_uInt32 i = 0; i < nCount; ++i )
625  {
626  if ( pEntry == GetEntry(i) )
627  {
628  nRet = i;
629  break;
630  }
631  }
632  }
633 
634  return nRet;
635 }
636 
638 {
639  return 0;
640 }
641 
642 OUString SvHeaderTabListBox::GetRowDescription( sal_Int32 _nRow ) const
643 {
644  return GetEntryText( _nRow );
645 }
646 
647 OUString SvHeaderTabListBox::GetColumnDescription( sal_uInt16 _nColumn ) const
648 {
649  return m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) );
650 }
651 
653 {
654  return false;
655 }
656 
657 bool SvHeaderTabListBox::GoToCell( sal_Int32 /*_nRow*/, sal_uInt16 /*_nColumn*/ )
658 {
659  return false;
660 }
661 
663 {
665 }
666 
668 {
670 }
671 
672 void SvHeaderTabListBox::SelectRow( sal_Int32 _nRow, bool _bSelect, bool )
673 {
674  Select( GetEntry( _nRow ), _bSelect );
675 }
676 
677 void SvHeaderTabListBox::SelectColumn( sal_uInt16, bool )
678 {
679 }
680 
682 {
683  return GetSelectionCount();
684 }
685 
687 {
688  return 0;
689 }
690 
691 bool SvHeaderTabListBox::IsRowSelected( sal_Int32 _nRow ) const
692 {
693  SvTreeListEntry* pEntry = GetEntry( _nRow );
694  return ( pEntry && IsSelected( pEntry ) );
695 }
696 
698 {
699  return false;
700 }
701 
702 void SvHeaderTabListBox::GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& ) const
703 {
704 }
705 
706 void SvHeaderTabListBox::GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& ) const
707 {
708 }
709 
710 bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const
711 {
712  return true;
713 }
714 
715 OUString SvHeaderTabListBox::GetAccessibleCellText( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
716 {
717  return GetTabEntryText(_nRow, _nColumnPos);
718 }
719 
720 tools::Rectangle SvHeaderTabListBox::calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen )
721 {
722  tools::Rectangle aRect;
723  if ( _bIsColumnBar )
724  {
725  vcl::Window* pParent = nullptr;
726  if ( !_bOnScreen )
727  pParent = m_pImpl->m_pHeaderBar->GetAccessibleParentWindow();
728 
729  aRect = m_pImpl->m_pHeaderBar->GetWindowExtentsRelative( pParent );
730  }
731  return aRect;
732 }
733 
735 {
736  vcl::Window* pParent = nullptr;
737  if ( !_bOnScreen )
738  pParent = GetAccessibleParentWindow();
739 
740  tools::Rectangle aRect( GetWindowExtentsRelative( pParent ) );
741  return aRect;
742 }
743 
744 tools::Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, bool _bIsHeader, bool _bOnScreen )
745 {
746  DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" );
747  tools::Rectangle aRect;
748  SvTreeListEntry* pEntry = GetEntry( _nRow );
749  if ( pEntry )
750  {
751  aRect = _bIsHeader ? calcHeaderRect( true, false ) : GetBoundingRect( pEntry );
752  Point aTopLeft = aRect.TopLeft();
753  DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" );
754  tools::Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) );
755  aTopLeft.setX( aItemRect.Left() );
756  Size aSize = aItemRect.GetSize();
757  aRect = tools::Rectangle( aTopLeft, aSize );
758  vcl::Window* pParent = nullptr;
759  if ( !_bOnScreen )
760  pParent = GetAccessibleParentWindow();
761  aTopLeft = aRect.TopLeft();
762  aTopLeft += GetWindowExtentsRelative( pParent ).TopLeft();
763  aRect = tools::Rectangle( aTopLeft, aRect.GetSize() );
764  }
765 
766  return aRect;
767 }
768 
769 Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
770 {
771  OSL_ENSURE( m_pAccessible, "Invalid call: Accessible is null" );
772 
773  Reference< XAccessible > xChild;
774 
775  TriState eState = TRISTATE_INDET;
776  bool bIsCheckBox = IsCellCheckBox( _nRow, _nColumnPos, eState );
777  if ( bIsCheckBox )
778  xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleCheckBoxCell(
779  m_pAccessible->getHeaderBar(), *this, nullptr, _nRow, _nColumnPos, eState, false );
780  else
781  xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxTableCell(
782  m_pAccessible->getHeaderBar(), *this, nullptr, _nRow, _nColumnPos, OFFSET_NONE );
783 
784  return xChild;
785 }
786 
787 Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleRowHeader( sal_Int32 )
788 {
789  Reference< XAccessible > xHeader;
790  return xHeader;
791 }
792 
793 Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleColumnHeader( sal_uInt16 _nColumn )
794 {
795  // first call? -> initial list
796  if ( m_aAccessibleChildren.empty() )
797  {
798  const sal_uInt16 nColumnCount = GetColumnCount();
799  m_aAccessibleChildren.assign( nColumnCount, Reference< XAccessible >() );
800  }
801 
802  // get header
803  Reference< XAccessible > xChild = m_aAccessibleChildren[ _nColumn ];
804  // already exists?
805  if ( !xChild.is() && m_pAccessible )
806  {
807  // no -> create new header cell
808  xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxHeaderCell(
809  _nColumn, m_pAccessible->getHeaderBar(),
811  );
812 
813  // insert into list
814  m_aAccessibleChildren[ _nColumn ] = xChild;
815  }
816  return xChild;
817 }
818 
820 {
821  return -1;
822 }
823 
824 Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleControl( sal_Int32 )
825 {
826  Reference< XAccessible > xControl;
827  return xControl;
828 }
829 
830 bool SvHeaderTabListBox::ConvertPointToControlIndex( sal_Int32&, const Point& )
831 {
832  return false;
833 }
834 
835 bool SvHeaderTabListBox::ConvertPointToCellAddress( sal_Int32&, sal_uInt16&, const Point& )
836 {
837  return false;
838 }
839 
840 bool SvHeaderTabListBox::ConvertPointToRowHeader( sal_Int32&, const Point& )
841 {
842  return false;
843 }
844 
845 bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Point& )
846 {
847  return false;
848 }
849 
851 {
852  OUString aRetText;
853  switch( _eType )
854  {
858  // should be empty now (see #i63983)
859  aRetText.clear();
860  break;
861 
863  {
864  // here we need a valid pos, we can not handle -1
865  if ( _nPos >= 0 )
866  {
867  sal_uInt16 nColumnCount = GetColumnCount();
868  if (nColumnCount > 0)
869  {
870  sal_Int32 nRow = _nPos / nColumnCount;
871  sal_uInt16 nColumn = static_cast< sal_uInt16 >( _nPos % nColumnCount );
872  aRetText = GetCellText( nRow, nColumn );
873  }
874  }
875  break;
876  }
878  {
879  break; // checkbox cells have no name
880  }
882  {
883  aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( static_cast<sal_uInt16>(_nPos) ) );
884  break;
885  }
886 
889  aRetText = "error";
890  break;
891 
892  default:
893  OSL_FAIL("BrowseBox::GetAccessibleName: invalid enum!");
894  }
895  return aRetText;
896 }
897 
899 {
900  OUString aRetText;
901 
902  if( _eType == AccessibleBrowseBoxObjType::TableCell && _nPos != -1 )
903  {
904  sal_uInt16 nColumnCount = GetColumnCount();
905  if (nColumnCount > 0)
906  {
907  sal_Int32 nRow = _nPos / nColumnCount;
908  sal_uInt16 nColumn = static_cast< sal_uInt16 >( _nPos % nColumnCount );
909 
910  OUString aText( VclResId(STR_SVT_ACC_DESC_TABLISTBOX) );
911  aText = aText.replaceFirst( "%1", OUString::number( nRow ) );
912  OUString sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
913  if ( sColHeader.isEmpty() )
914  sColHeader = OUString::number( nColumn );
915  aText = aText.replaceFirst( "%2", sColHeader );
916  aRetText = aText;
917  }
918  }
919 
920  return aRetText;
921 }
922 
924 {
925  switch( _eType )
926  {
929  {
930  _rStateSet.AddState( AccessibleStateType::FOCUSABLE );
931  if ( HasFocus() )
932  _rStateSet.AddState( AccessibleStateType::FOCUSED );
933  if ( IsActive() )
934  _rStateSet.AddState( AccessibleStateType::ACTIVE );
935  if ( IsEnabled() )
936  {
937  _rStateSet.AddState( AccessibleStateType::ENABLED );
938  _rStateSet.AddState( AccessibleStateType::SENSITIVE );
939  }
940  if ( IsReallyVisible() )
941  _rStateSet.AddState( AccessibleStateType::VISIBLE );
942  if ( _eType == AccessibleBrowseBoxObjType::Table )
943  {
944 
945  _rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
946  _rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
947  }
948  break;
949  }
950 
952  {
953  sal_Int32 nCurRow = GetCurrRow();
954  sal_uInt16 nCurColumn = GetCurrColumn();
955  if ( IsCellVisible( nCurRow, nCurColumn ) )
956  _rStateSet.AddState( AccessibleStateType::VISIBLE );
957  if ( IsEnabled() )
958  _rStateSet.AddState( AccessibleStateType::ENABLED );
959  _rStateSet.AddState( AccessibleStateType::TRANSIENT );
960  break;
961  }
962 
965  {
966  _rStateSet.AddState( AccessibleStateType::VISIBLE );
967  _rStateSet.AddState( AccessibleStateType::FOCUSABLE );
968  _rStateSet.AddState( AccessibleStateType::TRANSIENT );
969  if ( IsEnabled() )
970  _rStateSet.AddState( AccessibleStateType::ENABLED );
971  break;
972  }
973  default:
974  break;
975  }
976 }
977 
978 void SvHeaderTabListBox::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const
979 {
980  _rStateSet.AddState( AccessibleStateType::SELECTABLE );
981  _rStateSet.AddState( AccessibleStateType::TRANSIENT );
982 
983  if ( IsCellVisible( _nRow, _nColumn ) )
984  {
985  _rStateSet.AddState( AccessibleStateType::VISIBLE );
986  _rStateSet.AddState( AccessibleStateType::ENABLED );
987  }
988 
989  if ( IsRowSelected( _nRow ) )
990  {
991  _rStateSet.AddState( AccessibleStateType::ACTIVE );
992  _rStateSet.AddState( AccessibleStateType::SELECTED );
993  }
994  if ( IsEnabled() )
995  _rStateSet.AddState( AccessibleStateType::ENABLED );
996 }
997 
999 {
1000  GrabFocus();
1001 }
1002 
1003 bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, std::vector< tools::Rectangle >& rVector )
1004 {
1005  return GetOutDev()->GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, rVector );
1006 }
1007 
1009 {
1010  return Control::GetWindowExtentsRelative( pRelativeWindow );
1011 }
1012 
1014 {
1016 }
1017 
1018 Reference< XAccessible > SvHeaderTabListBox::GetAccessible()
1019 {
1020  return Control::GetAccessible();
1021 }
1022 
1024 {
1026 }
1027 
1029 {
1030  return this;
1031 }
1032 
1033 Reference< XAccessible > SvHeaderTabListBox::CreateAccessible()
1034 {
1036  DBG_ASSERT( pParent, "SvHeaderTabListBox::::CreateAccessible - accessible parent not found" );
1037 
1038  Reference< XAccessible > xAccessible;
1039  if ( m_pAccessible ) xAccessible = m_pAccessible->getMyself();
1040 
1041  if( pParent && !m_pAccessible )
1042  {
1043  Reference< XAccessible > xAccParent = pParent->GetAccessible();
1044  if ( xAccParent.is() )
1045  {
1046  m_pAccessible = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleTabListBox( xAccParent, *this );
1047  if ( m_pAccessible )
1048  xAccessible = m_pAccessible->getMyself();
1049  }
1050  }
1051  return xAccessible;
1052 }
1053 
1055 {
1056  return tools::Rectangle();
1057 }
1058 
1059 sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
1060 {
1061  OUString sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) );
1062  std::vector< tools::Rectangle > aRects;
1063  if ( GetGlyphBoundRects(Point(0,0), sText, 0, sText.getLength(), aRects) )
1064  {
1065  sal_Int32 nPos = 0;
1066  for (auto const& rectangle : aRects)
1067  {
1068  if( rectangle.Contains(_rPoint) )
1069  return nPos;
1070  ++nPos;
1071  }
1072  }
1073 
1074  return -1;
1075 }
1076 
1077 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void AddItem(std::unique_ptr< SvLBoxItem > pItem)
virtual void SelectAll() override
Definition: svtabbx.cxx:667
sal_Int32 nIndex
tools::Rectangle GetBoundingRect(const SvTreeListEntry *pEntry)
Calculate and return the bounding rectangle of an entry.
static SvButtonState ConvertToButtonState(SvItemStateFlags nItemFlags)
Definition: svlbitm.cxx:102
SvTabJustify
Definition: svtabbx.hxx:35
SvTabListBox(vcl::Window *pParent, WinBits)
Definition: svtabbx.cxx:179
OUString GetItemText(sal_uInt16 nItemId) const
Definition: headbar.cxx:1226
OUString aCurEntry
Definition: svtabbx.hxx:46
ScopedJsonWriterStruct startStruct()
virtual void GrabFocus() override
Definition: svtabbx.cxx:1013
sal_uInt32 GetEntryPos(const SvTreeListEntry *pEntry) const
Definition: svtabbx.cxx:305
SvTreeListEntry * GetChildOnPos(SvTreeListEntry *_pParent, sal_uInt32 _nEntryPos, sal_uInt32 &_rPos) const
Definition: svtabbx.cxx:387
SvTreeList * GetModel() const
void SetTabEditable(sal_uInt16 nTab, bool bEditable)
Definition: svtabbx.cxx:423
virtual sal_Int32 GetRowCount() const override
Definition: svtabbx.cxx:607
vcl::Window * GetAccessibleParentWindow() const
long Long
virtual sal_Int32 GetAccessibleControlCount() const override
Definition: svtabbx.cxx:819
The BrowseBox itself.
ScopedJsonWriterArray startArray(const char *)
sal_Int64 n
SvItemStateFlags
Definition: svlbitm.hxx:47
void SetScrolledHdl(const Link< SvTreeListBox *, void > &rLink)
AccessibleChildren m_aAccessibleChildren
Definition: svtabbx.hxx:101
sal_uInt32 GetEntryCount() const
virtual OUString GetAccessibleObjectName(AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos=-1) const override
Definition: svtabbx.cxx:850
virtual OUString GetAccessibleCellText(sal_Int32 _nRow, sal_uInt16 _nColumnPos) const override
Definition: svtabbx.cxx:715
virtual void FillAccessibleStateSet(::utl::AccessibleStateSetHelper &_rStateSet, AccessibleBrowseBoxObjType _eType) const override
Definition: svtabbx.cxx:923
virtual void SelectRow(sal_Int32 _nRow, bool _bSelect=true, bool bExpand=true) override
Definition: svtabbx.cxx:672
sal_uInt32 GetAbsPos(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:824
const OUString & GetText() const
Definition: svlbitm.hxx:133
SvTreeListEntry * GetCurEntry() const
The row header bar ("handle column").
TRISTATE_TRUE
::vcl::IAccessibleTabListBox * m_pAccessible
Definition: svtabbx.hxx:100
SvHeaderTabListBox(vcl::Window *pParent, WinBits nBits)
Definition: svtabbx.cxx:455
virtual bool ConvertPointToCellAddress(sal_Int32 &_rnRow, sal_uInt16 &_rnColPos, const Point &_rPoint) override
Definition: svtabbx.cxx:835
SvLBoxTabFlags nFlags
constexpr tools::Long Width() const
virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow, sal_Int32 _nColumnPos, const Point &_rPoint) override
Definition: svtabbx.cxx:1059
virtual vcl::Window * GetWindowInstance() override
Definition: svtabbx.cxx:1028
sal_Int64 WinBits
virtual void SetNoSelection() override
Definition: svtabbx.cxx:662
virtual OUString GetAccessibleObjectDescription(AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos=-1) const override
Definition: svtabbx.cxx:898
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 _nRow, sal_uInt16 _nColumn) override
Definition: svtabbx.cxx:769
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: window.cxx:3358
virtual sal_Int32 GetSelectedColumnCount() const override
Definition: svtabbx.cxx:686
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
virtual tools::Rectangle calcTableRect(bool _bOnScreen=true) override
Definition: svtabbx.cxx:734
int nCount
bool GetActivateOnSingleClick() const
SvTreeListEntry * NextSibling() const
virtual SvTreeListEntry * InsertEntry(const OUString &rText, SvTreeListEntry *pParent=nullptr, bool bChildrenOnDemand=false, sal_uInt32 nPos=TREELIST_APPEND, void *pUserData=nullptr) override
Definition: svtabbx.cxx:216
virtual OUString GetText() const
Definition: window.cxx:3055
VclPtr< HeaderBar > m_pHeaderBar
Definition: svtabbx.cxx:448
virtual bool GoToCell(sal_Int32 _nRow, sal_uInt16 _nColumn) override
Definition: svtabbx.cxx:657
virtual bool IsCellVisible(sal_Int32 _nRow, sal_uInt16 _nColumn) const override
Definition: svtabbx.cxx:710
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
Definition: window.cxx:2910
constexpr SvLBoxTabFlags MYTABMASK
Definition: svtabbx.cxx:40
virtual tools::Rectangle calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen=true) override
Definition: svtabbx.cxx:720
virtual bool ConvertPointToControlIndex(sal_Int32 &_rnIndex, const Point &_rPoint) override
Definition: svtabbx.cxx:830
TRISTATE_INDET
virtual void SetTabs() override
Definition: svtabbx.cxx:128
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:258
The horizontal column header bar.
void SetHighlightRange(sal_uInt16 nFirstTab=0, sal_uInt16 nLastTab=0xffff)
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: headbar.cxx:1142
size_t ItemCount() const
virtual vcl::Window * GetAccessibleParentWindow() const override
Definition: svtabbx.cxx:1023
virtual sal_uInt32 Insert(SvTreeListEntry *pEnt, SvTreeListEntry *pPar, sal_uInt32 nPos=TREELIST_APPEND) override
Definition: svtabbx.cxx:519
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: svtabbx.cxx:190
#define DBG_ASSERT(sCon, aError)
virtual sal_Int32 GetSelectedRowCount() const override
Definition: svtabbx.cxx:681
int i
HeaderBar * GetHeaderBar()
Definition: svtabbx.cxx:492
std::unique_ptr<::vcl::SvHeaderTabListBoxImpl > m_pImpl
Definition: svtabbx.hxx:99
virtual bool IsColumnSelected(sal_Int32 _nColumn) const override
Definition: svtabbx.cxx:697
virtual void SetTabs()
OUString GetCellText(sal_uInt32 nPos, sal_uInt16 nCol) const
Definition: svtabbx.cxx:291
sal_uInt32 GetSelectionCount() const
Definition: treelist.cxx:1047
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader(sal_uInt16 _nColumnPos) override
Definition: svtabbx.cxx:793
virtual bool ConvertPointToColumnHeader(sal_uInt16 &_rnColPos, const Point &_rPoint) override
Definition: svtabbx.cxx:845
TRISTATE_FALSE
bool IsSelected(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1328
bool IsUpdateMode() const
Definition: window2.cxx:1167
SvTreeListEntry * FirstChild(SvTreeListEntry *pParent) const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:175
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
virtual bool GetGlyphBoundRects(const Point &rOrigin, const OUString &rStr, int nIndex, int nLen, std::vector< tools::Rectangle > &rVector) override
Definition: svtabbx.cxx:1003
virtual ~SvTabListBox() override
Definition: svtabbx.cxx:185
SvButtonState
Definition: treelistbox.hxx:56
std::vector< SvLBoxTab > mvTabList
Definition: svtabbx.hxx:45
sal_uInt16 GetItemCount() const
Definition: headbar.cxx:1127
void InitHeaderBar(HeaderBar *pHeaderBar)
Definition: svtabbx.cxx:483
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Creates and returns the accessible object of the whole BrowseBox.
Definition: svtabbx.cxx:1033
virtual void GetAllSelectedRows(css::uno::Sequence< sal_Int32 > &_rRows) const override
Definition: svtabbx.cxx:702
virtual void InitEntry(SvTreeListEntry *, const OUString &, const Image &, const Image &)
virtual SvTreeListEntry * InsertEntryToColumn(const OUString &, SvTreeListEntry *pParent, sal_uInt32 nPos, sal_uInt16 nCol, void *pUserData=nullptr)
Definition: svtabbx.cxx:223
const SvLBoxItem & GetItem(size_t nPos) const
void SelectAll(bool bSelect)
void SetTabJustify(sal_uInt16 nTab, SvTabJustify)
Definition: svtabbx.cxx:407
void GrabFocus()
Definition: window.cxx:2976
Size LogicToLogic(const Size &rSzSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: window3.cxx:195
SvItemStateFlags GetButtonFlags() const
Definition: svlbitm.hxx:180
void put(const char *pPropName, const OUString &rPropValue)
constexpr Point TopLeft() const
#define OFFSET_NONE
virtual SvLBoxItemType GetType() const =0
SvTreeListEntries & GetChildEntries()
std::vector< std::unique_ptr< SvLBoxTab > > aTabs
SvTreeListEntry * Next(SvTreeListEntry *pEntry) const
virtual SvLBoxItemType GetType() const override
Definition: svlbitm.cxx:347
virtual sal_Int32 GetCurrRow() const override
Definition: svtabbx.cxx:617
virtual css::uno::Reference< css::accessibility::XAccessible > getMyself()=0
returns the XAccessible object itself
SvTreeListEntry * First() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: svtabbx.cxx:474
virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const override
Definition: svtabbx.cxx:1008
virtual SvTreeListEntry * InsertEntryToColumn(const OUString &, SvTreeListEntry *pParent, sal_uInt32 nPos, sal_uInt16 nCol, void *pUserData=nullptr) override
Definition: svtabbx.cxx:511
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
sal_uInt32 GetLevelChildCount(SvTreeListEntry *pParent) const
virtual void GetAllSelectedColumns(css::uno::Sequence< sal_Int32 > &_rColumns) const override
Definition: svtabbx.cxx:706
DefTokenId nToken
virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow, sal_Int32 _nColumnPos, sal_Int32 nIndex) override
Definition: svtabbx.cxx:1054
constexpr Size GetSize() const
def rectangle(l)
bool IsCellCheckBox(sal_Int32 _nRow, sal_uInt16 _nColumn, TriState &_rState) const
Definition: svtabbx.cxx:583
virtual OUString GetEntryText(SvTreeListEntry *pEntry) const override
Definition: svtabbx.cxx:248
virtual void InitEntry(SvTreeListEntry *, const OUString &, const Image &, const Image &) override
Definition: svtabbx.cxx:164
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: svtabbx.cxx:114
virtual SvTreeListEntry * InsertEntry(const OUString &rText, SvTreeListEntry *pParent=nullptr, bool bChildrenOnDemand=false, sal_uInt32 nPos=TREELIST_APPEND, void *pUserData=nullptr)
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override
Definition: svtabbx.cxx:1018
virtual css::uno::Reference< css::accessibility::XAccessible > getHeaderBar()=0
returns the accessible object for the column header bar
SvTreeListEntry * GetEntry(SvTreeListEntry *pParent, sal_uInt32 nPos) const
static void lcl_DumpEntryAndSiblings(tools::JsonWriter &rJsonWriter, SvTreeListEntry *pEntry, SvTabListBox *pTabListBox, bool bCheckButtons)
Definition: svtabbx.cxx:43
::OutputDevice const * GetOutDev() const
Definition: window.cxx:568
A cell of the column header bar.
Definition: image.hxx:39
virtual bool HasRowHeader() const override
Definition: svtabbx.cxx:652
SvButtonState GetCheckButtonState(SvTreeListEntry *) const
virtual tools::Rectangle GetFieldRectPixelAbs(sal_Int32 _nRow, sal_uInt16 _nColumn, bool _bIsHeader, bool _bOnScreen=true) override
Definition: svtabbx.cxx:744
const SvLBoxItem * GetFirstItem(SvLBoxItemType eType) const
SvTreeListEntry * GetEntryOnPos(sal_uInt32 _nEntryPos) const
Definition: svtabbx.cxx:363
A cell of the row header bar.
AccessibleFactoryAccess m_aFactoryAccess
Definition: svtabbx.cxx:449
bool IsActive() const
Definition: window2.cxx:1177
AccessibleBrowseBoxObjType
This enumeration contains a constant for each kind of accessible object of a BrowseBox.
SvxBoxItem & rBoxItem
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
static OUString GetToken(const OUString &sStr, sal_Int32 &nIndex)
Definition: svtabbx.cxx:320
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: svtabbx.cxx:534
virtual void SelectColumn(sal_uInt16 _nColumn, bool _bSelect=true) override
Definition: svtabbx.cxx:677
virtual sal_uInt16 GetColumnCount() const override
Definition: svtabbx.cxx:612
bool IsEnabled() const
Definition: window2.cxx:1116
MapUnit
#define SAL_WARN(area, stream)
tools::Long GetPos() const
virtual OUString GetRowDescription(sal_Int32 _nRow) const override
Definition: svtabbx.cxx:642
bool Select(SvTreeListEntry *pEntry, bool bSelect=true)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader(sal_Int32 _nRow) override
Definition: svtabbx.cxx:787
virtual bool ConvertPointToRowHeader(sal_Int32 &_rnRow, const Point &_rPoint) override
Definition: svtabbx.cxx:840
virtual OUString GetColumnDescription(sal_uInt16 _nColumn) const override
Definition: svtabbx.cxx:647
SvLBoxTabFlags
Definition: treelistbox.hxx:62
virtual sal_uInt32 Insert(SvTreeListEntry *pEnt, SvTreeListEntry *pPar, sal_uInt32 nPos=TREELIST_APPEND)
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
bool IsReallyVisible() const
Definition: window2.cxx:1101
tools::Long GetLogicTab(sal_uInt16 nTab)
Definition: svtabbx.cxx:435
SvTreeFlags nTreeFlags
virtual bool IsRowSelected(sal_Int32 _nRow) const override
Definition: svtabbx.cxx:691
TriState
virtual void FillAccessibleStateSetForCell(::utl::AccessibleStateSetHelper &_rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn) const override
Definition: svtabbx.cxx:978
bool HasFocus() const
Definition: window.cxx:2981
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: svtabbx.cxx:468
OUString GetTabEntryText(sal_uInt32 nPos, sal_uInt16 nCol) const
Definition: svtabbx.cxx:325
void AddState(sal_Int16 aState)
virtual void GrabTableFocus() override
Definition: svtabbx.cxx:998
aStr
static bool IsItemChecked(SvTreeListEntry *pEntry, sal_uInt16 nCol)
Definition: svtabbx.cxx:497
bool GetGlyphBoundRects(const Point &rOrigin, const OUString &rStr, int nIndex, int nLen, std::vector< tools::Rectangle > &rVector) const
virtual sal_uInt16 GetCurrColumn() const override
Definition: svtabbx.cxx:637
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
sal_uInt16 nPos
IMPL_LINK_NOARG(SvHeaderTabListBox, ScrollHdl_Impl, SvTreeListBox *, void)
Definition: svtabbx.cxx:548
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 _nIndex) override
Definition: svtabbx.cxx:824
std::vector< std::unique_ptr< SvTreeListEntry > > SvTreeListEntries
virtual ~SvHeaderTabListBox() override
Definition: svtabbx.cxx:463
void AddTab(tools::Long nPos, SvLBoxTabFlags nFlags)
void RecalculateAccessibleChildren()
Definition: svtabbx.cxx:569