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 = GetEntryOnPos( _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 == GetEntryOnPos(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( GetEntryOnPos( _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 = GetEntryOnPos( _nRow );
724 return ( pEntry && IsSelected( pEntry ) );
725}
726
728{
729 return false;
730}
731
732void SvHeaderTabListBox::GetAllSelectedRows(css::uno::Sequence<sal_Int32 >& rRowIndices) const
733{
734 const sal_Int32 nCount = GetSelectedRowCount();
735 rRowIndices.realloc(nCount);
736 auto pRows = rRowIndices.getArray();
737 SvTreeListEntry* pEntry = FirstSelected();
738 sal_Int32 nIndex = 0;
739 while (nIndex < nCount && pEntry)
740 {
741 pRows[nIndex] = GetEntryPos(pEntry);
742 pEntry = NextSelected( pEntry );
743 ++nIndex;
744 }
745 assert(nIndex == nCount && "Mismatch between GetSelectedRowCount() and count of selected rows when iterating.");
746}
747
748void SvHeaderTabListBox::GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& ) const
749{
750}
751
752bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const
753{
754 return true;
755}
756
757OUString SvHeaderTabListBox::GetAccessibleCellText( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
758{
759 return GetTabEntryText(_nRow, _nColumnPos);
760}
761
762tools::Rectangle SvHeaderTabListBox::calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen )
763{
764 tools::Rectangle aRect;
765 if ( _bIsColumnBar )
766 {
767 vcl::Window* pParent = nullptr;
768 if ( !_bOnScreen )
769 pParent = m_pImpl->m_pHeaderBar->GetAccessibleParentWindow();
770
771 aRect = m_pImpl->m_pHeaderBar->GetWindowExtentsRelative( *pParent );
772 }
773 return aRect;
774}
775
777{
778 if ( _bOnScreen )
780 else
782}
783
784tools::Rectangle SvHeaderTabListBox::GetFieldRectPixel( sal_Int32 _nRow, sal_uInt16 _nColumn, bool _bIsHeader, bool _bOnScreen )
785{
786 DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" );
787 tools::Rectangle aRect;
788 SvTreeListEntry* pEntry = GetEntryOnPos(_nRow );
789 if ( pEntry )
790 {
791 aRect = _bIsHeader ? calcHeaderRect( true, false ) : GetBoundingRect( pEntry );
792 Point aTopLeft = aRect.TopLeft();
793 DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" );
794 tools::Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) );
795 aTopLeft.setX( aItemRect.Left() );
796 Size aSize = aItemRect.GetSize();
797 aRect = tools::Rectangle( aTopLeft, aSize );
798 aTopLeft = aRect.TopLeft();
799 if (_bOnScreen)
800 aTopLeft += GetWindowExtentsAbsolute().TopLeft();
801 else
803 aRect = tools::Rectangle( aTopLeft, aRect.GetSize() );
804 }
805
806 return aRect;
807}
808
809Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
810{
811 OSL_ENSURE( m_pAccessible, "Invalid call: Accessible is null" );
812
813 Reference< XAccessible > xChild;
814
815 TriState eState = TRISTATE_INDET;
816 bool bIsCheckBox = IsCellCheckBox( _nRow, _nColumnPos, eState );
817 if ( bIsCheckBox )
818 xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleCheckBoxCell(
819 m_pAccessible->getTable(), *this, nullptr, _nRow, _nColumnPos, eState, false );
820 else
821 xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxTableCell(
822 m_pAccessible->getTable(), *this, nullptr, _nRow, _nColumnPos, OFFSET_NONE );
823
824 return xChild;
825}
826
827Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleRowHeader( sal_Int32 )
828{
829 Reference< XAccessible > xHeader;
830 return xHeader;
831}
832
833Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleColumnHeader( sal_uInt16 _nColumn )
834{
835 // first call? -> initial list
836 if ( m_aAccessibleChildren.empty() )
837 {
838 const sal_uInt16 nColumnCount = GetColumnCount();
839 m_aAccessibleChildren.assign( nColumnCount, Reference< XAccessible >() );
840 }
841
842 // get header
843 Reference< XAccessible > xChild = m_aAccessibleChildren[ _nColumn ];
844 // already exists?
845 if ( !xChild.is() && m_pAccessible )
846 {
847 // no -> create new header cell
848 xChild = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxHeaderCell(
849 _nColumn, m_pAccessible->getHeaderBar(),
851 );
852
853 // insert into list
854 m_aAccessibleChildren[ _nColumn ] = xChild;
855 }
856 return xChild;
857}
858
860{
861 return -1;
862}
863
864Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleControl( sal_Int32 )
865{
866 Reference< XAccessible > xControl;
867 return xControl;
868}
869
871{
872 return false;
873}
874
875bool SvHeaderTabListBox::ConvertPointToCellAddress( sal_Int32&, sal_uInt16&, const Point& )
876{
877 return false;
878}
879
881{
882 return false;
883}
884
886{
887 return false;
888}
889
891{
892 OUString aRetText;
893 switch( _eType )
894 {
898 // should be empty now (see #i63983)
899 aRetText.clear();
900 break;
901
903 {
904 // here we need a valid pos, we can not handle -1
905 if ( _nPos >= 0 )
906 {
907 sal_uInt16 nColumnCount = GetColumnCount();
908 if (nColumnCount > 0)
909 {
910 sal_Int32 nRow = _nPos / nColumnCount;
911 sal_uInt16 nColumn = static_cast< sal_uInt16 >( _nPos % nColumnCount );
912 aRetText = GetCellText( nRow, nColumn );
913 }
914 }
915 break;
916 }
918 {
919 break; // checkbox cells have no name
920 }
922 {
923 aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( static_cast<sal_uInt16>(_nPos) ) );
924 break;
925 }
926
929 aRetText = "error";
930 break;
931
932 default:
933 OSL_FAIL("BrowseBox::GetAccessibleName: invalid enum!");
934 }
935 return aRetText;
936}
937
939{
940 OUString aRetText;
941
942 if( _eType == AccessibleBrowseBoxObjType::TableCell && _nPos != -1 )
943 {
944 sal_uInt16 nColumnCount = GetColumnCount();
945 if (nColumnCount > 0)
946 {
947 sal_Int32 nRow = _nPos / nColumnCount;
948 sal_uInt16 nColumn = static_cast< sal_uInt16 >( _nPos % nColumnCount );
949
950 OUString aText( VclResId(STR_SVT_ACC_DESC_TABLISTBOX) );
951 aText = aText.replaceFirst( "%1", OUString::number( nRow ) );
952 OUString sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
953 if ( sColHeader.isEmpty() )
954 sColHeader = OUString::number( nColumn );
955 aText = aText.replaceFirst( "%2", sColHeader );
956 aRetText = aText;
957 }
958 }
959
960 return aRetText;
961}
962
964{
965 switch( _eType )
966 {
969 {
970 _rStateSet |= AccessibleStateType::FOCUSABLE;
971 if ( HasFocus() )
972 _rStateSet |= AccessibleStateType::FOCUSED;
973 if ( IsActive() )
974 _rStateSet |= AccessibleStateType::ACTIVE;
975 if ( IsEnabled() )
976 {
977 _rStateSet |= AccessibleStateType::ENABLED;
978 _rStateSet |= AccessibleStateType::SENSITIVE;
979 }
980 if ( IsReallyVisible() )
981 _rStateSet |= AccessibleStateType::VISIBLE;
982 if ( _eType == AccessibleBrowseBoxObjType::Table )
983 {
984
985 _rStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
986 _rStateSet |= AccessibleStateType::MULTI_SELECTABLE;
987 }
988 break;
989 }
990
992 {
993 sal_Int32 nCurRow = GetCurrRow();
994 sal_uInt16 nCurColumn = GetCurrColumn();
995 if ( IsCellVisible( nCurRow, nCurColumn ) )
996 _rStateSet |= AccessibleStateType::VISIBLE;
997 if ( IsEnabled() )
998 _rStateSet |= AccessibleStateType::ENABLED;
999 _rStateSet |= AccessibleStateType::TRANSIENT;
1000 break;
1001 }
1002
1005 {
1006 _rStateSet |= AccessibleStateType::VISIBLE;
1007 _rStateSet |= AccessibleStateType::FOCUSABLE;
1008 _rStateSet |= AccessibleStateType::TRANSIENT;
1009 if ( IsEnabled() )
1010 _rStateSet |= AccessibleStateType::ENABLED;
1011 break;
1012 }
1013 default:
1014 break;
1015 }
1016}
1017
1018void SvHeaderTabListBox::FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const
1019{
1020 _rStateSet |= AccessibleStateType::FOCUSABLE;
1021 _rStateSet |= AccessibleStateType::SELECTABLE;
1022 _rStateSet |= AccessibleStateType::TRANSIENT;
1023
1024 if ( IsCellVisible( _nRow, _nColumn ) )
1025 {
1026 _rStateSet |= AccessibleStateType::VISIBLE;
1027 _rStateSet |= AccessibleStateType::ENABLED;
1028 }
1029
1030 if ( IsRowSelected( _nRow ) )
1031 {
1032 _rStateSet |= AccessibleStateType::ACTIVE;
1033 if (HasChildPathFocus())
1034 _rStateSet |= AccessibleStateType::FOCUSED;
1035 _rStateSet |= AccessibleStateType::SELECTED;
1036 }
1037 if ( IsEnabled() )
1038 _rStateSet |= AccessibleStateType::ENABLED;
1039}
1040
1042{
1043 GrabFocus();
1044}
1045
1046bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, std::vector< tools::Rectangle >& rVector )
1047{
1048 return GetOutDev()->GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, rVector );
1049}
1050
1052{
1054}
1055
1057{
1058 return Control::GetWindowExtentsRelative( rRelativeWindow );
1059}
1060
1062{
1064}
1065
1066Reference< XAccessible > SvHeaderTabListBox::GetAccessible()
1067{
1068 return Control::GetAccessible();
1069}
1070
1072{
1074}
1075
1077{
1078 return this;
1079}
1080
1082{
1084 DBG_ASSERT( pParent, "SvHeaderTabListBox::::CreateAccessible - accessible parent not found" );
1085
1086 Reference< XAccessible > xAccessible;
1087 if ( m_pAccessible ) xAccessible = m_pAccessible->getMyself();
1088
1089 if( pParent && !m_pAccessible )
1090 {
1091 Reference< XAccessible > xAccParent = pParent->GetAccessible();
1092 if ( xAccParent.is() )
1093 {
1094 m_pAccessible = m_pImpl->m_aFactoryAccess.getFactory().createAccessibleTabListBox( xAccParent, *this );
1095 if ( m_pAccessible )
1096 xAccessible = m_pAccessible->getMyself();
1097 }
1098 }
1099 return xAccessible;
1100}
1101
1103{
1104 return tools::Rectangle();
1105}
1106
1107sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
1108{
1109 OUString sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) );
1110 std::vector< tools::Rectangle > aRects;
1111 if ( GetGlyphBoundRects(Point(0,0), sText, 0, sText.getLength(), aRects) )
1112 {
1113 sal_Int32 nPos = 0;
1114 for (auto const& rectangle : aRects)
1115 {
1116 if( rectangle.Contains(_rPoint) )
1117 return nPos;
1118 ++nPos;
1119 }
1120 }
1121
1122 return -1;
1123}
1124
1125/* 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
void setX(tools::Long nX)
constexpr tools::Long Width() const
void RecalculateAccessibleChildren()
Definition: svtabbx.cxx:599
virtual void GrabFocus() override
Definition: svtabbx.cxx:1061
virtual bool GoToCell(sal_Int32 _nRow, sal_uInt16 _nColumn) override
Definition: svtabbx.cxx:687
virtual sal_Int32 GetSelectedRowCount() const override
Definition: svtabbx.cxx:711
HeaderBar * GetHeaderBar()
Definition: svtabbx.cxx:522
virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow, sal_Int32 _nColumnPos, sal_Int32 nIndex) override
Definition: svtabbx.cxx:1102
virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const override
Definition: svtabbx.cxx:1056
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:1041
virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override
Definition: svtabbx.cxx:1066
virtual void FillAccessibleStateSetForCell(sal_Int64 &_rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn) const override
Definition: svtabbx.cxx:1018
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:757
virtual void SelectAll() override
Definition: svtabbx.cxx:697
virtual tools::Rectangle GetFieldRectPixel(sal_Int32 _nRow, sal_uInt16 _nColumn, bool _bIsHeader, bool _bOnScreen) override
Definition: svtabbx.cxx:784
virtual bool ConvertPointToControlIndex(sal_Int32 &_rnIndex, const Point &_rPoint) override
Definition: svtabbx.cxx:870
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:833
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:1076
virtual bool IsCellVisible(sal_Int32 _nRow, sal_uInt16 _nColumn) const override
Definition: svtabbx.cxx:752
virtual tools::Rectangle calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen=true) override
Definition: svtabbx.cxx:762
virtual OUString GetAccessibleObjectName(AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos=-1) const override
Definition: svtabbx.cxx:890
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:1081
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:963
virtual ~SvHeaderTabListBox() override
Definition: svtabbx.cxx:493
virtual sal_Int32 GetAccessibleControlCount() const override
Definition: svtabbx.cxx:859
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:776
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader(sal_Int32 _nRow) override
Definition: svtabbx.cxx:827
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 _nRow, sal_uInt16 _nColumn) override
Definition: svtabbx.cxx:809
virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow, sal_Int32 _nColumnPos, const Point &_rPoint) override
Definition: svtabbx.cxx:1107
virtual vcl::Window * GetAccessibleParentWindow() const override
Definition: svtabbx.cxx:1071
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:748
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:875
virtual void SetNoSelection() override
Definition: svtabbx.cxx:692
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:864
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 tools::Rectangle GetWindowExtentsAbsolute() const override
Definition: svtabbx.cxx:1051
virtual bool GetGlyphBoundRects(const Point &rOrigin, const OUString &rStr, int nIndex, int nLen, std::vector< tools::Rectangle > &rVector) override
Definition: svtabbx.cxx:1046
virtual bool ConvertPointToRowHeader(sal_Int32 &_rnRow, const Point &_rPoint) override
Definition: svtabbx.cxx:880
::vcl::IAccessibleTabListBox * m_pAccessible
Definition: svtabbx.hxx:100
virtual bool ConvertPointToColumnHeader(sal_uInt16 &_rnColPos, const Point &_rPoint) override
Definition: svtabbx.cxx:885
virtual sal_uInt16 GetCurrColumn() const override
Definition: svtabbx.cxx:667
virtual OUString GetAccessibleObjectDescription(AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos=-1) const override
Definition: svtabbx.cxx:938
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
SvTreeListEntry * NextSelected(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:254
SvTreeListEntry * FirstSelected() const
Definition: treelist.hxx:251
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()
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::u16string_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 > getTable()=0
Returns the accessible object for the table.
virtual css::uno::Reference< css::accessibility::XAccessible > getHeaderBar()=0
returns the accessible object for the column header bar
tools::Rectangle GetWindowExtentsAbsolute() const
Definition: window.cxx:2924
bool IsReallyVisible() const
Definition: window2.cxx:1133
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3004
void GrabFocus()
Definition: window.cxx:2976
bool IsUpdateMode() const
Definition: window2.cxx:1199
bool HasFocus() const
Definition: window.cxx:2981
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
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: window.cxx:3356
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual OUString GetText() const
Definition: window.cxx:3055
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
Definition: window.cxx:2914
bool IsActive() const
Definition: window2.cxx:1209
bool IsEnabled() const
Definition: window2.cxx:1148
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