LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
SvTreeList Class Referencefinal

#include <treelist.hxx>

Collaboration diagram for SvTreeList:
[legend]

Public Member Functions

 SvTreeList ()=delete
 
 SvTreeList (SvListView &)
 
 ~SvTreeList ()
 
void Broadcast (SvListAction nActionId, SvTreeListEntry *pEntry1=nullptr, SvTreeListEntry *pEntry2=nullptr, sal_uInt32 nPos=0)
 
void EnableInvalidate (bool bEnable)
 
bool IsEnableInvalidate () const
 
void InvalidateEntry (SvTreeListEntry *)
 
sal_uInt32 GetEntryCount () const
 
SvTreeListEntryFirst () const
 
SvTreeListEntryNext (SvTreeListEntry *pEntry, sal_uInt16 *pDepth=nullptr) const
 
SvTreeListEntryPrev (SvTreeListEntry *pEntry) const
 
SvTreeListEntryLast () const
 
SvTreeListEntryFirstChild (SvTreeListEntry *pParent) const
 
sal_uInt32 Insert (SvTreeListEntry *pEntry, SvTreeListEntry *pPar, sal_uInt32 nPos=TREELIST_APPEND)
 
sal_uInt32 Insert (SvTreeListEntry *pEntry, sal_uInt32 nRootPos=TREELIST_APPEND)
 
void InsertTree (SvTreeListEntry *pTree, SvTreeListEntry *pTargetParent, sal_uInt32 nListPos)
 
void Move (SvTreeListEntry *pSource, SvTreeListEntry *pTarget)
 
sal_uInt32 Move (SvTreeListEntry *pSource, SvTreeListEntry *pTargetParent, sal_uInt32 nListPos)
 
sal_uInt32 Copy (SvTreeListEntry *pSource, SvTreeListEntry *pTargetParent, sal_uInt32 nListPos)
 
bool Remove (const SvTreeListEntry *pEntry)
 
void Clear ()
 
bool IsChild (const SvTreeListEntry *pParent, const SvTreeListEntry *pChild) const
 
SvTreeListEntryGetEntry (SvTreeListEntry *pParent, sal_uInt32 nPos) const
 
SvTreeListEntryGetEntry (sal_uInt32 nRootPos) const
 
SvTreeListEntryGetEntryAtAbsPos (sal_uInt32 nAbsPos) const
 
const SvTreeListEntryGetParent (const SvTreeListEntry *pEntry) const
 
SvTreeListEntryGetParent (SvTreeListEntry *pEntry)
 
SvTreeListEntryGetRootLevelParent (SvTreeListEntry *pEntry) const
 
const SvTreeListEntriesGetChildList (SvTreeListEntry *pParent) const
 
SvTreeListEntriesGetChildList (SvTreeListEntry *pParent)
 
sal_uInt32 GetAbsPos (const SvTreeListEntry *pEntry) const
 
sal_uInt32 GetChildCount (const SvTreeListEntry *pParent) const
 
sal_uInt16 GetDepth (const SvTreeListEntry *pEntry) const
 
bool IsAtRootDepth (const SvTreeListEntry *pEntry) const
 
SvTreeListEntryClone (SvTreeListEntry *pEntry, sal_uInt32 &nCloneCount) const
 
void SetCloneLink (const Link< SvTreeListEntry *, SvTreeListEntry * > &rLink)
 
const Link< SvTreeListEntry *, SvTreeListEntry * > & GetCloneLink () const
 
SvTreeListEntryCloneEntry (SvTreeListEntry *pSource) const
 
void SetSortMode (SvSortMode eMode)
 
SvSortMode GetSortMode () const
 
sal_Int32 Compare (const SvTreeListEntry *pLeft, const SvTreeListEntry *pRight) const
 
void SetCompareHdl (const Link< const SvSortData &, sal_Int32 > &rLink)
 
void Resort ()
 

Static Public Member Functions

static sal_uInt32 GetRelPos (const SvTreeListEntry *pChild)
 

Private Member Functions

SvTreeListEntryFirstVisible () const
 
SvTreeListEntryNextVisible (const SvListView *, SvTreeListEntry *pEntry, sal_uInt16 *pDepth=nullptr) const
 
SvTreeListEntryPrevVisible (const SvListView *, SvTreeListEntry *pEntry) const
 
SvTreeListEntryLastVisible (const SvListView *) const
 
SvTreeListEntryNextVisible (const SvListView *, SvTreeListEntry *pEntry, sal_uInt16 &rDelta) const
 
SvTreeListEntryPrevVisible (const SvListView *, SvTreeListEntry *pEntry, sal_uInt16 &rDelta) const
 
bool IsEntryVisible (const SvListView *, SvTreeListEntry *pEntry) const
 
SvTreeListEntryGetEntryAtVisPos (const SvListView *, sal_uInt32 nVisPos) const
 
sal_uInt32 GetVisiblePos (const SvListView *, SvTreeListEntry const *pEntry) const
 
sal_uInt32 GetVisibleCount (SvListView *) const
 
sal_uInt32 GetVisibleChildCount (const SvListView *, SvTreeListEntry *pParent) const
 
SvTreeListEntryFirstSelected (const SvListView *) const
 
SvTreeListEntryNextSelected (const SvListView *, SvTreeListEntry *pEntry) const
 
sal_uInt32 GetChildSelectionCount (const SvListView *, SvTreeListEntry *pParent) const
 
VCL_DLLPRIVATE void SetAbsolutePositions ()
 
VCL_DLLPRIVATE void CloneChildren (SvTreeListEntries &rDst, sal_uInt32 &rCloneCount, SvTreeListEntries &rSrc, SvTreeListEntry &rNewParent) const
 
VCL_DLLPRIVATE void GetInsertionPos (SvTreeListEntry const *pEntry, SvTreeListEntry *pParent, sal_uInt32 &rPos)
 
VCL_DLLPRIVATE void ResortChildren (SvTreeListEntry *pParent)
 
 SvTreeList (const SvTreeList &)=delete
 
SvTreeListoperator= (const SvTreeList &)=delete
 

Static Private Member Functions

static VCL_DLLPRIVATE void SetListPositions (SvTreeListEntries &rEntries)
 Invalidate the cached position data to have them re-generated before the next access. More...
 

Private Attributes

SvListViewmrOwnerListView
 
sal_uInt32 nEntryCount
 
Link< SvTreeListEntry *, SvTreeListEntry * > aCloneLink
 
Link< const SvSortData &, sal_Int32 > aCompareLink
 
SvSortMode eSortMode
 
bool bAbsPositionsValid
 
bool mbEnableInvalidate
 
std::unique_ptr< SvTreeListEntrypRootItem
 

Friends

class SvListView
 

Detailed Description

Definition at line 64 of file treelist.hxx.

Constructor & Destructor Documentation

◆ SvTreeList() [1/3]

SvTreeList::SvTreeList ( const SvTreeList )
privatedelete

◆ SvTreeList() [2/3]

SvTreeList::SvTreeList ( )
delete

◆ SvTreeList() [3/3]

SvTreeList::SvTreeList ( SvListView listView)

Definition at line 62 of file treelist.cxx.

References bAbsPositionsValid, eSortMode, nEntryCount, None, and pRootItem.

◆ ~SvTreeList()

SvTreeList::~SvTreeList ( )

Definition at line 72 of file treelist.cxx.

Member Function Documentation

◆ Broadcast()

void SvTreeList::Broadcast ( SvListAction  nActionId,
SvTreeListEntry pEntry1 = nullptr,
SvTreeListEntry pEntry2 = nullptr,
sal_uInt32  nPos = 0 
)

◆ Clear()

void SvTreeList::Clear ( )

Definition at line 120 of file treelist.cxx.

References Broadcast(), CLEARED, CLEARING, nEntryCount, and pRootItem.

◆ Clone()

SvTreeListEntry * SvTreeList::Clone ( SvTreeListEntry pEntry,
sal_uInt32 &  nCloneCount 
) const

Definition at line 366 of file treelist.cxx.

References CloneChildren(), CloneEntry(), and SvTreeListEntry::m_Children.

Referenced by Copy().

◆ CloneChildren()

void SvTreeList::CloneChildren ( SvTreeListEntries rDst,
sal_uInt32 &  rCloneCount,
SvTreeListEntries rSrc,
SvTreeListEntry rNewParent 
) const
private

Definition at line 377 of file treelist.cxx.

References CloneChildren(), CloneEntry(), and SvTreeListEntry::m_Children.

Referenced by Clone(), and CloneChildren().

◆ CloneEntry()

SvTreeListEntry * SvTreeList::CloneEntry ( SvTreeListEntry pSource) const

◆ Compare()

sal_Int32 SvTreeList::Compare ( const SvTreeListEntry pLeft,
const SvTreeListEntry pRight 
) const

Definition at line 1358 of file treelist.cxx.

References SvSortData::pLeft, and SvSortData::pRight.

◆ Copy()

sal_uInt32 SvTreeList::Copy ( SvTreeListEntry pSource,
SvTreeListEntry pTargetParent,
sal_uInt32  nListPos 
)

◆ EnableInvalidate()

void SvTreeList::EnableInvalidate ( bool  bEnable)

Definition at line 999 of file treelist.cxx.

References mbEnableInvalidate.

Referenced by SalInstanceTreeView::freeze(), and SalInstanceTreeView::thaw().

◆ First()

SvTreeListEntry * SvTreeList::First ( ) const

◆ FirstChild()

SvTreeListEntry * SvTreeList::FirstChild ( SvTreeListEntry pParent) const

Definition at line 766 of file treelist.cxx.

References SvTreeListEntry::m_Children, and pRootItem.

◆ FirstSelected()

SvTreeListEntry * SvTreeList::FirstSelected ( const SvListView pView) const
private

Definition at line 754 of file treelist.cxx.

References DBG_ASSERT, First(), SvListView::IsSelected(), and NextVisible().

◆ FirstVisible()

SvTreeListEntry * SvTreeList::FirstVisible ( ) const
inlineprivate

Definition at line 79 of file treelist.hxx.

References First.

◆ GetAbsPos()

sal_uInt32 SvTreeList::GetAbsPos ( const SvTreeListEntry pEntry) const

◆ GetChildCount()

sal_uInt32 SvTreeList::GetChildCount ( const SvTreeListEntry pParent) const

Definition at line 397 of file treelist.cxx.

References GetDepth(), GetEntryCount(), SvTreeListEntry::m_Children, nCount, and Next().

Referenced by InsertTree(), and Remove().

◆ GetChildList() [1/2]

SvTreeListEntries & SvTreeList::GetChildList ( SvTreeListEntry pParent)

Definition at line 1496 of file treelist.cxx.

References SvTreeListEntry::m_Children.

◆ GetChildList() [2/2]

const SvTreeListEntries & SvTreeList::GetChildList ( SvTreeListEntry pParent) const

◆ GetChildSelectionCount()

sal_uInt32 SvTreeList::GetChildSelectionCount ( const SvListView pView,
SvTreeListEntry pParent 
) const
private

◆ GetCloneLink()

const Link< SvTreeListEntry *, SvTreeListEntry * > & SvTreeList::GetCloneLink ( ) const
inline

Definition at line 191 of file treelist.hxx.

◆ GetDepth()

sal_uInt16 SvTreeList::GetDepth ( const SvTreeListEntry pEntry) const

◆ GetEntry() [1/2]

SvTreeListEntry * SvTreeList::GetEntry ( sal_uInt32  nRootPos) const

Definition at line 1481 of file treelist.cxx.

References SvTreeListEntry::m_Children.

◆ GetEntry() [2/2]

SvTreeListEntry * SvTreeList::GetEntry ( SvTreeListEntry pParent,
sal_uInt32  nPos 
) const

Definition at line 1472 of file treelist.cxx.

References SvTreeListEntry::m_Children, and nPos.

Referenced by SalInstanceTreeView::swap().

◆ GetEntryAtAbsPos()

SvTreeListEntry * SvTreeList::GetEntryAtAbsPos ( sal_uInt32  nAbsPos) const

Definition at line 966 of file treelist.cxx.

References First(), and Next().

◆ GetEntryAtVisPos()

SvTreeListEntry * SvTreeList::GetEntryAtVisPos ( const SvListView pView,
sal_uInt32  nVisPos 
) const
private

Definition at line 977 of file treelist.cxx.

References DBG_ASSERT, First(), and NextVisible().

◆ GetEntryCount()

sal_uInt32 SvTreeList::GetEntryCount ( ) const
inline

Definition at line 141 of file treelist.hxx.

Referenced by GetChildCount().

◆ GetInsertionPos()

void SvTreeList::GetInsertionPos ( SvTreeListEntry const *  pEntry,
SvTreeListEntry pParent,
sal_uInt32 &  rPos 
)
private

Definition at line 1424 of file treelist.cxx.

References DBG_ASSERT, Descending, i, None, and TREELIST_ENTRY_NOTFOUND.

Referenced by Insert(), and InsertTree().

◆ GetParent() [1/2]

const SvTreeListEntry * SvTreeList::GetParent ( const SvTreeListEntry pEntry) const

◆ GetParent() [2/2]

SvTreeListEntry * SvTreeList::GetParent ( SvTreeListEntry pEntry)

Definition at line 1511 of file treelist.cxx.

References SvTreeListEntry::pParent.

◆ GetRelPos()

sal_uInt32 SvTreeList::GetRelPos ( const SvTreeListEntry pChild)
static

◆ GetRootLevelParent()

SvTreeListEntry * SvTreeList::GetRootLevelParent ( SvTreeListEntry pEntry) const

Definition at line 1012 of file treelist.cxx.

References DBG_ASSERT, SvTreeListEntry::pParent, and pRootItem.

Referenced by SvImpLBox::KeyInput().

◆ GetSortMode()

SvSortMode SvTreeList::GetSortMode ( ) const
inline

Definition at line 197 of file treelist.hxx.

Referenced by SalInstanceTreeView::get_sort_order().

◆ GetVisibleChildCount()

sal_uInt32 SvTreeList::GetVisibleChildCount ( const SvListView pView,
SvTreeListEntry pParent 
) const
private

◆ GetVisibleCount()

sal_uInt32 SvTreeList::GetVisibleCount ( SvListView pView) const
private

◆ GetVisiblePos()

sal_uInt32 SvTreeList::GetVisiblePos ( const SvListView pView,
SvTreeListEntry const *  pEntry 
) const
private

◆ Insert() [1/2]

sal_uInt32 SvTreeList::Insert ( SvTreeListEntry pEntry,
sal_uInt32  nRootPos = TREELIST_APPEND 
)
inline

Definition at line 150 of file treelist.hxx.

References Insert().

◆ Insert() [2/2]

sal_uInt32 SvTreeList::Insert ( SvTreeListEntry pEntry,
SvTreeListEntry pPar,
sal_uInt32  nPos = TREELIST_APPEND 
)

◆ InsertTree()

void SvTreeList::InsertTree ( SvTreeListEntry pTree,
SvTreeListEntry pTargetParent,
sal_uInt32  nListPos 
)

◆ InvalidateEntry()

void SvTreeList::InvalidateEntry ( SvTreeListEntry pEntry)

◆ IsAtRootDepth()

bool SvTreeList::IsAtRootDepth ( const SvTreeListEntry pEntry) const

Definition at line 115 of file treelist.cxx.

References SvTreeListEntry::pParent, and pRootItem.

Referenced by SvImpLBox::DrawNet().

◆ IsChild()

bool SvTreeList::IsChild ( const SvTreeListEntry pParent,
const SvTreeListEntry pChild 
) const

◆ IsEnableInvalidate()

bool SvTreeList::IsEnableInvalidate ( ) const
inline

Definition at line 136 of file treelist.hxx.

Referenced by SalInstanceTreeView::InvalidateModelEntry().

◆ IsEntryVisible()

bool SvTreeList::IsEntryVisible ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private

◆ Last()

SvTreeListEntry * SvTreeList::Last ( ) const

◆ LastVisible()

SvTreeListEntry * SvTreeList::LastVisible ( const SvListView pView) const
private

Definition at line 702 of file treelist.cxx.

References DBG_ASSERT, IsEntryVisible(), Last(), and PrevVisible().

◆ Move() [1/2]

void SvTreeList::Move ( SvTreeListEntry pSource,
SvTreeListEntry pTarget 
)

◆ Move() [2/2]

sal_uInt32 SvTreeList::Move ( SvTreeListEntry pSource,
SvTreeListEntry pTargetParent,
sal_uInt32  nListPos 
)

◆ Next()

SvTreeListEntry * SvTreeList::Next ( SvTreeListEntry pEntry,
sal_uInt16 *  pDepth = nullptr 
) const

◆ NextSelected()

SvTreeListEntry * SvTreeList::NextSelected ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private

Definition at line 778 of file treelist.cxx.

References DBG_ASSERT, SvListView::IsSelected(), and Next().

◆ NextVisible() [1/2]

SvTreeListEntry * SvTreeList::NextVisible ( const SvListView pView,
SvTreeListEntry pEntry,
sal_uInt16 &  rDelta 
) const
private

◆ NextVisible() [2/2]

SvTreeListEntry * SvTreeList::NextVisible ( const SvListView pView,
SvTreeListEntry pEntry,
sal_uInt16 *  pDepth = nullptr 
) const
private

◆ operator=()

SvTreeList & SvTreeList::operator= ( const SvTreeList )
privatedelete

◆ Prev()

SvTreeListEntry * SvTreeList::Prev ( SvTreeListEntry pEntry) const

◆ PrevVisible() [1/2]

SvTreeListEntry * SvTreeList::PrevVisible ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private

◆ PrevVisible() [2/2]

SvTreeListEntry * SvTreeList::PrevVisible ( const SvListView pView,
SvTreeListEntry pEntry,
sal_uInt16 &  rDelta 
) const
private

Definition at line 734 of file treelist.cxx.

References DBG_ASSERT, GetVisiblePos(), IsEntryVisible(), and PrevVisible().

◆ Remove()

bool SvTreeList::Remove ( const SvTreeListEntry pEntry)

◆ Resort()

void SvTreeList::Resort ( )

◆ ResortChildren()

void SvTreeList::ResortChildren ( SvTreeListEntry pParent)
private

Definition at line 1404 of file treelist.cxx.

References DBG_ASSERT, and SvTreeListEntry::m_Children.

◆ SetAbsolutePositions()

void SvTreeList::SetAbsolutePositions ( )
private

Definition at line 833 of file treelist.cxx.

References bAbsPositionsValid, First(), SvTreeListEntry::nAbsPos, Next(), and nPos.

Referenced by GetAbsPos().

◆ SetCloneLink()

void SvTreeList::SetCloneLink ( const Link< SvTreeListEntry *, SvTreeListEntry * > &  rLink)
inline

Definition at line 188 of file treelist.hxx.

◆ SetCompareHdl()

void SvTreeList::SetCompareHdl ( const Link< const SvSortData &, sal_Int32 > &  rLink)
inline

Definition at line 199 of file treelist.hxx.

Referenced by SvTreeListBox::ImplInitStyle(), and SalInstanceTreeView::make_sorted().

◆ SetListPositions()

void SvTreeList::SetListPositions ( SvTreeListEntries rEntries)
staticprivate

Invalidate the cached position data to have them re-generated before the next access.

Definition at line 989 of file treelist.cxx.

References SvTreeListEntry::InvalidateChildrensListPositions(), and SvTreeListEntry::pParent.

Referenced by Copy(), Insert(), InsertTree(), Move(), and Remove().

◆ SetSortMode()

void SvTreeList::SetSortMode ( SvSortMode  eMode)
inline

Definition at line 196 of file treelist.hxx.

References eMode.

Referenced by SvTreeListBox::ImplInitStyle(), and SalInstanceTreeView::set_sort_order().

Friends And Related Function Documentation

◆ SvListView

friend class SvListView
friend

Definition at line 66 of file treelist.hxx.

Member Data Documentation

◆ aCloneLink

Link<SvTreeListEntry*, SvTreeListEntry*> SvTreeList::aCloneLink
private

Definition at line 71 of file treelist.hxx.

Referenced by CloneEntry().

◆ aCompareLink

Link<const SvSortData&, sal_Int32> SvTreeList::aCompareLink
private

Definition at line 72 of file treelist.hxx.

◆ bAbsPositionsValid

bool SvTreeList::bAbsPositionsValid
private

◆ eSortMode

SvSortMode SvTreeList::eSortMode
private

Definition at line 73 of file treelist.hxx.

Referenced by SvTreeList().

◆ mbEnableInvalidate

bool SvTreeList::mbEnableInvalidate
private

Definition at line 77 of file treelist.hxx.

Referenced by EnableInvalidate(), and InvalidateEntry().

◆ mrOwnerListView

SvListView& SvTreeList::mrOwnerListView
private

Definition at line 68 of file treelist.hxx.

Referenced by Broadcast().

◆ nEntryCount

sal_uInt32 SvTreeList::nEntryCount
private

Definition at line 69 of file treelist.hxx.

Referenced by Clear(), Copy(), First(), Insert(), InsertTree(), Remove(), and SvTreeList().

◆ pRootItem

std::unique_ptr<SvTreeListEntry> SvTreeList::pRootItem
private

The documentation for this class was generated from the following files: