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