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