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