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_uLong nPos=0)
 
void EnableInvalidate (bool bEnable)
 
void InvalidateEntry (SvTreeListEntry *)
 
sal_uLong GetEntryCount () const
 
SvTreeListEntryFirst () const
 
SvTreeListEntryNext (SvTreeListEntry *pEntry, sal_uInt16 *pDepth=nullptr) const
 
SvTreeListEntryPrev (SvTreeListEntry *pEntry) const
 
SvTreeListEntryLast () const
 
SvTreeListEntryFirstChild (SvTreeListEntry *pParent) const
 
sal_uLong Insert (SvTreeListEntry *pEntry, SvTreeListEntry *pPar, sal_uLong nPos=TREELIST_APPEND)
 
sal_uLong Insert (SvTreeListEntry *pEntry, sal_uLong nRootPos=TREELIST_APPEND)
 
void InsertTree (SvTreeListEntry *pTree, SvTreeListEntry *pTargetParent, sal_uLong nListPos)
 
void Move (SvTreeListEntry *pSource, SvTreeListEntry *pTarget)
 
sal_uLong Move (SvTreeListEntry *pSource, SvTreeListEntry *pTargetParent, sal_uLong nListPos)
 
sal_uLong Copy (SvTreeListEntry *pSource, SvTreeListEntry *pTargetParent, sal_uLong nListPos)
 
bool Remove (const SvTreeListEntry *pEntry)
 
void Clear ()
 
bool HasChildren (const SvTreeListEntry *pEntry) const
 
bool HasParent (const SvTreeListEntry *pEntry) const
 
bool IsChild (const SvTreeListEntry *pParent, const SvTreeListEntry *pChild) const
 
SvTreeListEntryGetEntry (SvTreeListEntry *pParent, sal_uLong nPos) const
 
SvTreeListEntryGetEntry (sal_uLong nRootPos) const
 
SvTreeListEntryGetEntryAtAbsPos (sal_uLong nAbsPos) const
 
const SvTreeListEntryGetParent (const SvTreeListEntry *pEntry) const
 
SvTreeListEntryGetParent (SvTreeListEntry *pEntry)
 
SvTreeListEntryGetRootLevelParent (SvTreeListEntry *pEntry) const
 
const SvTreeListEntriesGetChildList (SvTreeListEntry *pParent) const
 
SvTreeListEntriesGetChildList (SvTreeListEntry *pParent)
 
std::pair< SvTreeListEntries::iterator, SvTreeListEntries::iterator > GetChildIterators (SvTreeListEntry *pParent)
 
sal_uLong GetAbsPos (const SvTreeListEntry *pEntry) const
 
sal_uLong GetChildCount (const SvTreeListEntry *pParent) const
 
sal_uInt16 GetDepth (const SvTreeListEntry *pEntry) const
 
bool IsAtRootDepth (const SvTreeListEntry *pEntry) const
 
SvTreeListEntryClone (SvTreeListEntry *pEntry, sal_uLong &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 ()
 
void Reverse ()
 

Static Public Member Functions

static sal_uLong 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_uLong nVisPos) const
 
sal_uLong GetVisiblePos (const SvListView *, SvTreeListEntry const *pEntry) const
 
sal_uLong GetVisibleCount (SvListView *) const
 
sal_uLong GetVisibleChildCount (const SvListView *, SvTreeListEntry *pParent) const
 
SvTreeListEntryFirstSelected (const SvListView *) const
 
SvTreeListEntryNextSelected (const SvListView *, SvTreeListEntry *pEntry) const
 
SvTreeListEntryPrevSelected (const SvListView *, SvTreeListEntry *pEntry) const
 
SvTreeListEntryLastSelected (const SvListView *) const
 
sal_uLong GetChildSelectionCount (const SvListView *, SvTreeListEntry *pParent) const
 
VCL_DLLPRIVATE void SetAbsolutePositions ()
 
VCL_DLLPRIVATE void CloneChildren (SvTreeListEntries &rDst, sal_uLong &rCloneCount, SvTreeListEntries &rSrc, SvTreeListEntry &rNewParent) const
 
VCL_DLLPRIVATE void GetInsertionPos (SvTreeListEntry const *pEntry, SvTreeListEntry *pParent, sal_uLong &rPos)
 
VCL_DLLPRIVATE void ResortChildren (SvTreeListEntry *pParent)
 
VCL_DLLPRIVATE void ReverseChildren (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_uLong 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 63 of file treelist.hxx.

Constructor & Destructor Documentation

SvTreeList::SvTreeList ( const SvTreeList )
privatedelete
SvTreeList::SvTreeList ( )
delete
SvTreeList::SvTreeList ( SvListView listView)

Definition at line 61 of file treelist.cxx.

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

SvTreeList::~SvTreeList ( )

Definition at line 71 of file treelist.cxx.

Member Function Documentation

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

Definition at line 119 of file treelist.cxx.

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

SvTreeListEntry * SvTreeList::Clone ( SvTreeListEntry pEntry,
sal_uLong nCloneCount 
) const

Definition at line 365 of file treelist.cxx.

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

Referenced by Copy().

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

Definition at line 376 of file treelist.cxx.

References CloneEntry(), and SvTreeListEntry::m_Children.

Referenced by Clone().

SvTreeListEntry * SvTreeList::CloneEntry ( SvTreeListEntry pSource) const
sal_Int32 SvTreeList::Compare ( const SvTreeListEntry pLeft,
const SvTreeListEntry pRight 
) const

Definition at line 1392 of file treelist.cxx.

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

sal_uLong SvTreeList::Copy ( SvTreeListEntry pSource,
SvTreeListEntry pTargetParent,
sal_uLong  nListPos 
)
void SvTreeList::EnableInvalidate ( bool  bEnable)

Definition at line 1025 of file treelist.cxx.

References mbEnableInvalidate.

SvTreeListEntry * SvTreeList::First ( ) const
SvTreeListEntry * SvTreeList::FirstChild ( SvTreeListEntry pParent) const

Definition at line 773 of file treelist.cxx.

References SvTreeListEntry::m_Children, and pRootItem.

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

Definition at line 761 of file treelist.cxx.

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

SvTreeListEntry* SvTreeList::FirstVisible ( ) const
inlineprivate

Definition at line 78 of file treelist.hxx.

References First.

sal_uLong SvTreeList::GetAbsPos ( const SvTreeListEntry pEntry) const
sal_uLong SvTreeList::GetChildCount ( const SvTreeListEntry pParent) const

Definition at line 396 of file treelist.cxx.

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

Referenced by InsertTree(), and Remove().

std::pair< SvTreeListEntries::iterator, SvTreeListEntries::iterator > SvTreeList::GetChildIterators ( SvTreeListEntry pParent)

Definition at line 1054 of file treelist.cxx.

References SvTreeListEntry::m_Children, and pRootItem.

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

Definition at line 1568 of file treelist.cxx.

References SvTreeListEntry::m_Children.

sal_uLong SvTreeList::GetChildSelectionCount ( const SvListView pView,
SvTreeListEntry pParent 
) const
private
const Link<SvTreeListEntry*,SvTreeListEntry*>& SvTreeList::GetCloneLink ( ) const
inline

Definition at line 198 of file treelist.hxx.

sal_uInt16 SvTreeList::GetDepth ( const SvTreeListEntry pEntry) const
SvTreeListEntry * SvTreeList::GetEntry ( SvTreeListEntry pParent,
sal_uLong  nPos 
) const
SvTreeListEntry * SvTreeList::GetEntry ( sal_uLong  nRootPos) const

Definition at line 1553 of file treelist.cxx.

References SvTreeListEntry::m_Children.

SvTreeListEntry * SvTreeList::GetEntryAtAbsPos ( sal_uLong  nAbsPos) const

Definition at line 992 of file treelist.cxx.

References First(), and Next().

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

Definition at line 1003 of file treelist.cxx.

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

sal_uLong SvTreeList::GetEntryCount ( ) const
inline

Definition at line 142 of file treelist.hxx.

Referenced by GetChildCount().

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

Definition at line 1483 of file treelist.cxx.

References DBG_ASSERT, i, SortDescending, SortNone, and TREELIST_ENTRY_NOTFOUND.

Referenced by Insert(), and InsertTree().

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

Definition at line 1583 of file treelist.cxx.

References SvTreeListEntry::pParent.

sal_uLong SvTreeList::GetRelPos ( const SvTreeListEntry pChild)
static
SvTreeListEntry * SvTreeList::GetRootLevelParent ( SvTreeListEntry pEntry) const

Definition at line 1038 of file treelist.cxx.

References DBG_ASSERT, SvTreeListEntry::pParent, and pRootItem.

Referenced by SvImpLBox::KeyInput().

SvSortMode SvTreeList::GetSortMode ( ) const
inline

Definition at line 204 of file treelist.hxx.

Referenced by SalInstanceTreeView::get_sort_order().

sal_uLong SvTreeList::GetVisibleChildCount ( const SvListView pView,
SvTreeListEntry pParent 
) const
private
sal_uLong SvTreeList::GetVisibleCount ( SvListView pView) const
private
sal_uLong SvTreeList::GetVisiblePos ( const SvListView pView,
SvTreeListEntry const *  pEntry 
) const
private
bool SvTreeList::HasChildren ( const SvTreeListEntry pEntry) const

Definition at line 1531 of file treelist.cxx.

References SvTreeListEntry::m_Children.

bool SvTreeList::HasParent ( const SvTreeListEntry pEntry) const

Definition at line 1539 of file treelist.cxx.

References SvTreeListEntry::pParent.

sal_uLong SvTreeList::Insert ( SvTreeListEntry pEntry,
SvTreeListEntry pPar,
sal_uLong  nPos = TREELIST_APPEND 
)
sal_uLong SvTreeList::Insert ( SvTreeListEntry pEntry,
sal_uLong  nRootPos = TREELIST_APPEND 
)
inline

Definition at line 151 of file treelist.hxx.

References Insert.

void SvTreeList::InsertTree ( SvTreeListEntry pTree,
SvTreeListEntry pTargetParent,
sal_uLong  nListPos 
)
void SvTreeList::InvalidateEntry ( SvTreeListEntry pEntry)
bool SvTreeList::IsAtRootDepth ( const SvTreeListEntry pEntry) const

Definition at line 114 of file treelist.cxx.

References SvTreeListEntry::pParent, and pRootItem.

Referenced by SvImpLBox::DrawNet().

bool SvTreeList::IsChild ( const SvTreeListEntry pParent,
const SvTreeListEntry pChild 
) const
bool SvTreeList::IsEntryVisible ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private
SvTreeListEntry * SvTreeList::Last ( ) const
SvTreeListEntry * SvTreeList::LastSelected ( const SvListView pView) const
private

Definition at line 804 of file treelist.cxx.

References DBG_ASSERT, SvListView::IsSelected(), Last(), and Prev().

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

Definition at line 709 of file treelist.cxx.

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

void SvTreeList::Move ( SvTreeListEntry pSource,
SvTreeListEntry pTarget 
)
sal_uLong SvTreeList::Move ( SvTreeListEntry pSource,
SvTreeListEntry pTargetParent,
sal_uLong  nListPos 
)
SvTreeListEntry * SvTreeList::Next ( SvTreeListEntry pEntry,
sal_uInt16 *  pDepth = nullptr 
) const
SvTreeListEntry * SvTreeList::NextSelected ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private

Definition at line 785 of file treelist.cxx.

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

SvTreeListEntry * SvTreeList::NextVisible ( const SvListView pView,
SvTreeListEntry pEntry,
sal_uInt16 *  pDepth = nullptr 
) const
private
SvTreeListEntry * SvTreeList::NextVisible ( const SvListView pView,
SvTreeListEntry pEntry,
sal_uInt16 &  rDelta 
) const
private
SvTreeList& SvTreeList::operator= ( const SvTreeList )
privatedelete
SvTreeListEntry * SvTreeList::Prev ( SvTreeListEntry pEntry) const
SvTreeListEntry * SvTreeList::PrevSelected ( const SvListView pView,
SvTreeListEntry pEntry 
) const
private

Definition at line 794 of file treelist.cxx.

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

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

Definition at line 741 of file treelist.cxx.

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

bool SvTreeList::Remove ( const SvTreeListEntry pEntry)
void SvTreeList::Resort ( )
void SvTreeList::ResortChildren ( SvTreeListEntry pParent)
private

Definition at line 1438 of file treelist.cxx.

References DBG_ASSERT, and SvTreeListEntry::m_Children.

void SvTreeList::Reverse ( )

Definition at line 1458 of file treelist.cxx.

References REVERSED.

void SvTreeList::ReverseChildren ( SvTreeListEntry pParent)
private

Definition at line 1465 of file treelist.cxx.

References DBG_ASSERT, and SvTreeListEntry::m_Children.

void SvTreeList::SetAbsolutePositions ( )
private

Definition at line 859 of file treelist.cxx.

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

Referenced by GetAbsPos().

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

Definition at line 195 of file treelist.hxx.

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

Definition at line 206 of file treelist.hxx.

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

void SvTreeList::SetListPositions ( SvTreeListEntries rEntries)
staticprivate

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

Definition at line 1015 of file treelist.cxx.

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

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

void SvTreeList::SetSortMode ( SvSortMode  eMode)
inline

Friends And Related Function Documentation

friend class SvListView
friend

Definition at line 65 of file treelist.hxx.

Member Data Documentation

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

Definition at line 70 of file treelist.hxx.

Referenced by CloneEntry().

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

Definition at line 71 of file treelist.hxx.

bool SvTreeList::bAbsPositionsValid
private
SvSortMode SvTreeList::eSortMode
private

Definition at line 72 of file treelist.hxx.

Referenced by SvTreeList().

bool SvTreeList::mbEnableInvalidate
private

Definition at line 76 of file treelist.hxx.

Referenced by EnableInvalidate(), and InvalidateEntry().

SvListView& SvTreeList::mrOwnerListView
private

Definition at line 67 of file treelist.hxx.

Referenced by Broadcast().

sal_uLong SvTreeList::nEntryCount
private

Definition at line 68 of file treelist.hxx.

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

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

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