ItemTreeNodeData Class Reference

#include <customgui_itemtree_utils.h>

Detailed Description

Represents an element in a tree view through its state and custom data.

The payload combines the node's stable identifier, application ID, display text, view flags, application-defined data, and an optional linked object. Use this class to describe how a node should appear and behave; the item tree owns the payload while the payload owns its linked-object reference.

Public Member Functions

 ItemTreeNodeData ()
 
 ~ItemTreeNodeData ()
 
const ItemTreeNodeData & operator= (const ItemTreeNodeData &src)
 
 ItemTreeNodeData (const ItemTreeNodeData &src)
 
Bool operator!= (const ItemTreeNodeData &rhs) const
 
Bool CopyFrom (const ItemTreeNodeData &src, AliasTrans *trn)
 
Bool Init ()
 
Bool Write (HyperFile *hf) const
 
Bool Read (HyperFile *hf)
 
void SetSelected (Bool state)
 
Bool IsSelected () const
 
void SetMarked (Bool state)
 
Bool IsMarked () const
 
void SetOpened (Bool state)
 
Bool IsOpen () const
 
void SetHidden (Bool state)
 
Bool IsHidden () const
 
void SetEnabled (Bool state)
 
Bool IsEnabled () const
 
void SetNoRemove (Bool state)
 
void SetGreyedOut (Bool state)
 
Bool IsFolder () const
 
void SetFlag (const UInt32 flag, const Bool state)
 
Bool GetFlag (const UInt32 flag) const
 
Bool IsSelectedAndVisible () const
 
Bool IsMarkedAndVisible () const
 
Bool IsHighlightAndVisible () const
 

Public Attributes

UInt64 m_GUID
 
Int32 m_ID
 
UInt32 m_Flags
 
String m_Text
 
GeData m_Data
 
BaseLink * m_pLink
 

Constructor & Destructor Documentation

◆ ItemTreeNodeData() [1/2]

Initializes an empty item-tree node payload.

◆ ~ItemTreeNodeData()

Releases the linked object reference owned by the payload.

◆ ItemTreeNodeData() [2/2]

Creates a copy of an item-tree node payload.

Parameters
[in]srcSource payload.

Member Function Documentation

◆ operator=()

const ItemTreeNodeData& operator= ( const ItemTreeNodeData &  src)

Copies the payload and linked-object state from src.

Parameters
[in]srcSource payload.
Returns
This payload after the assignment.

◆ operator!=()

Bool operator!= ( const ItemTreeNodeData &  rhs) const

Compares this payload with rhs.

Parameters
[in]rhsPayload to compare with this payload.

◆ CopyFrom()

Bool CopyFrom ( const ItemTreeNodeData &  src,
AliasTrans *  trn 
)

Copies the payload and linked-object state.

Parameters
[in]srcSource payload.
[in]trnOptional alias translator for referenced data.
Returns
true on success; false if link allocation or copying fails.

◆ Init()

Bool Init ( )

Prepares the payload for use by allocating its link and assigning a stable GUID.

Returns
true on success; false if link allocation fails.

◆ Write()

Bool Write ( HyperFile *  hf) const

Serializes the payload and linked-object state to a hyper file.

Parameters
[in]hfHyper file receiving the serialized payload.
Returns
true on success; false if the link cannot be allocated or written.

◆ Read()

Bool Read ( HyperFile *  hf)

Restores the payload and linked-object state from a hyper file.

Parameters
[in]hfHyper file containing the serialized payload.
Returns
true on success; false if the link cannot be allocated or read.

◆ SetSelected()

void SetSelected ( Bool  state)

Sets whether the node is selected through ITEMTREE_FLAG_SELECT.

Parameters
[in]statetrue to select the node; false to clear the state.

◆ IsSelected()

Bool IsSelected ( ) const

Reports whether the node is selected.

Returns
true if the node is selected; otherwise false.

◆ SetMarked()

void SetMarked ( Bool  state)

Sets whether the node is marked through ITEMTREE_FLAG_MARK.

Parameters
[in]statetrue to mark the node; false to clear the state.

◆ IsMarked()

Bool IsMarked ( ) const

Reports whether the node is marked.

Returns
true if the node is marked; otherwise false.

◆ SetOpened()

void SetOpened ( Bool  state)

Sets whether the node is open through ITEMTREE_FLAG_OPEN.

Parameters
[in]statetrue to open the node; false to close it.

◆ IsOpen()

Bool IsOpen ( ) const

Reports whether the node is open.

Returns
true if the node is open; otherwise false.

◆ SetHidden()

void SetHidden ( Bool  state)

Sets whether the node is hidden through ITEMTREE_FLAG_HIDDEN.

Parameters
[in]statetrue to hide the node; false to show it.

◆ IsHidden()

Bool IsHidden ( ) const

Reports whether the node is hidden.

Returns
true if the node is hidden; otherwise false.

◆ SetEnabled()

void SetEnabled ( Bool  state)

Sets whether the node is enabled through ITEMTREE_FLAG_ENABLE.

Parameters
[in]statetrue to enable the node; false to disable it.

◆ IsEnabled()

Bool IsEnabled ( ) const

Reports whether the node is enabled.

Returns
true if the node is enabled; otherwise false.

◆ SetNoRemove()

void SetNoRemove ( Bool  state)

Sets whether the node can be removed through ITEMTREE_FLAG_NOREMOVE.

Parameters
[in]statetrue to prevent removal; false to allow it.

◆ SetGreyedOut()

void SetGreyedOut ( Bool  state)

Sets whether the node is visually greyed out through ITEMTREE_FLAG_GREYED_OUT.

Parameters
[in]statetrue to grey out the node; false to restore its normal appearance.

◆ IsFolder()

Bool IsFolder ( ) const

Reports whether the node represents a folder.

Returns
true if ITEMTREE_FLAG_FOLDER is set; otherwise false.

◆ SetFlag()

void SetFlag ( const UInt32  flag,
const Bool  state 
)

Sets or clears an arbitrary item-tree flag.

Parameters
[in]flagFlag to change.
[in]statetrue to set the flag; false to clear it.

◆ GetFlag()

Bool GetFlag ( const UInt32  flag) const

Reports whether an arbitrary item-tree flag is set.

Parameters
[in]flagFlag to query.
Returns
true if the flag is set; otherwise false.

◆ IsSelectedAndVisible()

Bool IsSelectedAndVisible ( ) const

Reports whether the node is selected and visible.

Returns
true if the node is selected and not hidden; otherwise false.

◆ IsMarkedAndVisible()

Bool IsMarkedAndVisible ( ) const

Reports whether the node is marked and visible.

Returns
true if the node is marked and not hidden; otherwise false.

◆ IsHighlightAndVisible()

Bool IsHighlightAndVisible ( ) const

Reports whether the node is highlighted and visible.

Returns
true if the node is selected or marked and not hidden; otherwise false.

Member Data Documentation

◆ m_GUID

UInt64 m_GUID

Stable identifier of the node.

◆ m_ID

Int32 m_ID

Application-defined identifier of the node.

◆ m_Flags

UInt32 m_Flags

Combination of ITEMTREE_FLAG_* values describing the node state.

◆ m_Text

String m_Text

Display text of the node.

◆ m_Data

GeData m_Data

Application-defined custom data associated with the node.

◆ m_pLink

BaseLink* m_pLink

Optional link to the represented object.