7#ifndef __HDI_CORE_HIERARCHICAL_VIEW__
8#define __HDI_CORE_HIERARCHICAL_VIEW__
29 typedef std::vector<TreeEntry> EntryVector;
30 typedef std::vector<int32_t> IndexVector;
31 typedef std::vector<std::string> IDVector;
32 typedef std::vector<std::string> ValueVector;
77 const EntryVector& entries_,
78 const IndexVector& indexPath_
93 const EntryVector& entries_,
94 const IDVector& idPath_
160 virtual std::string
text()
const;
259 virtual const std::vector< std::shared_ptr<TreeEntry> >*
const entries()
const;
269 virtual bool hasEntry(
const IDVector& idPath_)
const;
320 virtual std::shared_ptr<TreeEntry>
removeEntry(
const IDVector& idPath_);
338 virtual bool reorderEntry(
const IDVector& targetID_,
const IDVector& positionID_);
598 typedef std::unique_ptr<HierarchicalView> HierarchicalViewUP;
599 typedef std::shared_ptr<HierarchicalView> HierarchicalViewSP;
600 typedef std::weak_ptr<HierarchicalView> HierarchicalViewWP;
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Hierarchical view widget, much like a list view but allowing for a tree-like structure of entries.
Definition: hdicoreHierarchicalView.h:27
virtual void setExpansionCallback(const Callback &callback_)
Sets/updates the callback for when an entry is expanded/collapsed.
virtual bool setCurrentIDPath(const IDVector &idPath_)
Sets the currently selected entry by ID path.
virtual std::vector< std::string > reorderPosition() const
Gets the position for the reorder, i.e. the entry just before the reposition.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual void setCellChangedCallback(const Callback &callback_)
Sets the callback for when a cell is modified via double-click inline editing.
virtual IndexVector currentIndexPath() const
Gets the index path of the currently selected entry.
HierarchicalView(const HierarchicalView &hierView_)
Constructs a new HierarchicalView object from an existing HierarchicalView object (copy constructor)
virtual void setReorderable(const bool enable_)
Sets whether reordering support for the list is enabled.
HierarchicalView(const Rect &frame_)
Constructs a hierarchical view with a frame only, no contents.
HierarchicalView(const Rect &frame_, const EntryVector &entries_, const IDVector &idPath_)
Constructor for a hierarchical view with an initial ID selected.
virtual bool reorderEntry(const IDVector &targetID_, const IDVector &positionID_)
Reorders a target entry (based on ID path) to be newly located just after another existing entry in t...
virtual void valueChanged()
Simulates the hierarchical view having its value changed.
virtual const std::vector< std::shared_ptr< TreeEntry > > *const entries() const
Gets the entries vector.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
HierarchicalView()
Constructs an empty HierarchicalView object.
virtual void update()
Force the hierarchical view to update its entries.
virtual Callback *const cellChangedCallback() const
Gets the callback for when a cell is modified via double-click inline editing.
HierarchicalView(const Rect &frame_, const EntryVector &entries_, const IndexVector &indexPath_)
Constructs a hierarchical view.
virtual bool insertEntry(const TreeEntry &entry_, const IDVector &idPath_)
Inserts an entry into the list of entries at a given position.
virtual std::unique_ptr< TreeEntry > changedEntry() const
Gets the entry that was last modified via double-click inline editing.
virtual bool potentialReorderGood() const
Gets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual std::vector< std::string > potentialReorderPosition() const
Gets the position for the reorder, i.e. the entry just before the proposed reposition.
virtual ValueVector currentValuePath() const
Gets the string value path of the currently selected entry.
virtual std::shared_ptr< TreeEntry > entryWithIDPath(const IDVector &idPath_) const
Gets the entry with the given ID path, provided it exists within the widget.
virtual bool setCurrentIndexPath(const IndexVector &indexPath_)
Sets the currently selected entry by index path.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the hierarchical view.
virtual bool reorderable() const
Gets whether reordering support for the list is enabled.
virtual void deselectAll()
Deselects all currently selected entries in the list.
virtual void setPotentialReorderCallback(const Callback &callback_)
Sets the potential-reorder callback for the widget.
virtual std::vector< std::string > reorderSource() const
Gets the source item involved in the reorder, i.e. the entry being dropped.
virtual void setPotentialReorderGood(const bool good_)
Sets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual std::vector< std::string > potentialReorderSource() const
Gets the source item involved in the potential reorder, i.e. the entry being dragged.
virtual void setText(const std::string &)
Does nothing.
virtual bool hasEntry(const IDVector &idPath_) const
Gets whether the entries vector already contains an entry, based on its ID path.
virtual HierarchicalView * clone() const
Convenience method to clone a HierarchicalView object on the heap.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a hierarchical view to be changed out entirely.
virtual std::string text() const
Gets the current text value of the list.
virtual ~HierarchicalView()
HierarchicalView destructor.
virtual std::unique_ptr< TreeEntry > currentEntry() const
Gets the current entry object.
virtual std::shared_ptr< TreeEntry > removeEntry(const IDVector &idPath_)
Removes a specific entry from the list of entries.
virtual HierarchicalView * duplicate() const
Convenience method to duplicate a HierarchicalView object, creating a new and identical UI element to...
virtual Callback *const reorderCallback() const
Gets the current reorder callback for the widget.
virtual bool setCurrentValuePath(const ValueVector &valuePath_)
Sets the currently selected entry by value path.
virtual Callback *const potentialReorderCallback() const
Gets the current potential-reorder callback for the list.
virtual bool currentUserData(void *&data__) const
Gets the user data for the current entry.
virtual IDVector currentIDPath() const
Gets the ID path of the currently selected entry.
virtual void setReorderCallback(const Callback &callback_)
Sets the reorder callback for the widget.
virtual Callback *const expansionCallback() const
Gets the callback set for when an entry is expanded/collapsed.
virtual std::unique_ptr< TreeEntry > expansionEntry() const
Gets the entry that was last expanded/collapsed.
virtual HierarchicalView & operator=(const HierarchicalView &rhs_)
Allows one HierarchicalView object to be assigned from another.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Allows hierarchical views to store more data than simply strings and indices.
Definition: hdicoreTreeEntry.h:28
Header file for a variety of plugin convenience macros.