7#ifndef __HDI_CORE_HIERARCHICAL_COLUMN_VIEW__
8#define __HDI_CORE_HIERARCHICAL_COLUMN_VIEW__
21 class TreeColumnEntry;
30 typedef std::vector<TreeColumnEntry> EntryVector;
31 typedef std::vector<std::string> ColumnNameVector;
32 typedef std::vector<double> ColumnWidthVector;
33 typedef std::vector<int32_t> IndexVector;
34 typedef std::vector<std::string> IDVector;
35 typedef std::vector<std::string> ValueVector;
92 const uint16_t numCols_,
93 const EntryVector& entries_,
94 const IndexVector& indexPath_
109 const ColumnNameVector& colNames_,
110 const EntryVector& entries_,
111 const IndexVector& indexPath_
127 const uint16_t numCols_,
128 const EntryVector& entries_,
129 const IDVector& idPath_
145 const ColumnNameVector& colNames_,
146 const EntryVector& entries_,
147 const IDVector& idPath_
214 virtual std::string
text()
const;
284 virtual const std::vector< std::shared_ptr<TreeColumnEntry> >*
const entries()
const;
294 virtual bool hasEntry(
const IDVector& idPath_)
const;
304 virtual std::shared_ptr<TreeColumnEntry>
entryWithIDPath(
const IDVector& idPath_)
const;
345 virtual std::shared_ptr<TreeColumnEntry>
removeEntry(
const IDVector& idPath_);
363 virtual bool reorderEntry(
const IDVector& targetID_,
const IDVector& positionID_);
792 typedef std::unique_ptr<HierarchicalColumnView> HierarchicalColumnViewUP;
793 typedef std::shared_ptr<HierarchicalColumnView> HierarchicalColumnViewSP;
794 typedef std::weak_ptr<HierarchicalColumnView> HierarchicalColumnViewWP;
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Hierarchical column view widget, much like a list view but allowing for entries with multiple columns...
Definition: hdicoreHierarchicalColumnView.h:28
virtual void setOutlineColumnExpands(const bool exp_)
Sets whether the outline column automatically expands in width when its children are shown.
virtual void setPotentialReorderCallback(const Callback &callback_)
Sets the potential-reorder callback for the widget.
virtual int32_t clickedColumnIndex() const
Gets the column index of the cell in the entry that was last clicked.
virtual void setOutlineColumnIndex(const uint16_t oc_)
Sets which column is the outline column (shows disclosure triangles)
virtual Callback *const expansionCallback() const
Gets the callback set for when an entry is expanded/collapsed.
virtual std::vector< std::string > potentialReorderSource() const
Gets the source item involved in the potential reorder, i.e. the entry being dragged.
virtual std::shared_ptr< TreeColumnEntry > removeEntry(const IDVector &idPath_)
Removes a specific entry from the list of entries.
virtual std::vector< std::string > reorderSource() const
Gets the source item involved in the reorder, i.e. the entry being dropped.
virtual void setCellChangedCallback(const Callback &callback_)
Sets the callback for when a cell is modified via double-click inline editing.
virtual bool reorderable() const
Gets whether reordering support for the list is enabled.
virtual void setPotentialReorderGood(const bool good_)
Sets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual ~HierarchicalColumnView()
HierarchicalColumnView destructor.
virtual bool setCurrentIDPath(const IDVector &idPath_)
Sets the currently selected entry by ID path.
virtual void setText(const std::string &)
Does nothing.
virtual std::vector< std::string > reorderPosition() const
Gets the position for the reorder, i.e. the entry just before the reposition.
virtual void setCellClickCallback(const Callback &callback_)
Sets/updates the callback for when a cell is clicked.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual Callback *const reorderCallback() const
Gets the current reorder callback for the widget.
virtual void update()
Force the hierarchical column view to update its entries.
HierarchicalColumnView(const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const IDVector &idPath_)
Constructor for a hierarchical column view with an initial ID selected.
HierarchicalColumnView(const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const IDVector &idPath_)
Constructor for a hierarchical column view with an initial ID selected.
HierarchicalColumnView(const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const IndexVector &indexPath_)
Constructs a hierarchical column view.
virtual std::unique_ptr< TreeColumnEntry > currentEntry() const
Gets the current entry object.
virtual bool columnWidthsLocked() const
Gets whether the column widths are locked (i.e. the user cannot change them)
HierarchicalColumnView()
Constructs an empty HierarchicalColumnView object.
virtual void valueChanged()
Simulates the hierarchical column view having its value changed.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual void setColumnWidthsLocked(const bool locked_)
Sets whether the column widths are locked (i.e. the user cannot change them)
virtual void setExpansionCallback(const Callback &callback_)
Sets/updates the callback for when an entry is expanded/collapsed.
virtual bool outlineColumnExpands() const
Gets whether the outline column automatically expands in width when its children are shown.
virtual std::shared_ptr< TreeColumnEntry > entryWithIDPath(const IDVector &idPath_) const
Gets the entry with the given ID path, provided it exists within the widget.
virtual uint16_t outlineColumnIndex() const
Gets which column is the outline column (shows disclosure triangles)
virtual std::unique_ptr< TreeColumnEntry > expansionEntry() const
Gets the entry that was last expanded/collapsed.
virtual const std::vector< std::shared_ptr< TreeColumnEntry > > *const entries() const
Gets the entries vector.
HierarchicalColumnView(const Rect &frame_, const uint16_t numCols_)
Constructs a hierarchical column view with a frame only, no contents.
virtual void setReorderable(const bool enable_)
Sets whether reordering support for the list is enabled.
virtual ColumnNameVector columnNames() const
Gets the column names vector.
virtual void setColumnWidths(const ColumnWidthVector &widths_)
Sets the widths of each column in the view.
virtual IndexVector currentIndexPath() const
Gets the index path of the currently selected entry.
virtual HierarchicalColumnView & operator=(const HierarchicalColumnView &rhs_)
Allows one HierarchicalColumnView object to be assigned from another.
HierarchicalColumnView(const HierarchicalColumnView &hcView_)
Constructs a new HierarchicalColumnView object from an existing HierarchicalColumnView object (copy c...
virtual Callback *const cellChangedCallback() const
Gets the callback for when a cell is modified via double-click inline editing.
virtual Callback *const potentialReorderCallback() const
Gets the current potential-reorder callback for the list.
virtual bool insertEntry(const TreeColumnEntry &entry_, const IDVector &idPath_)
Inserts an entry into the list of entries at a given position.
virtual bool setCurrentIndexPath(const IndexVector &indexPath_)
Sets the currently selected entry by index path.
virtual bool hasHeader() const
Gets whether the widget has a header component to show the names of the columns.
virtual std::vector< std::string > potentialReorderPosition() const
Gets the position for the reorder, i.e. the entry just before the proposed reposition.
virtual bool hasEntry(const IDVector &idPath_) const
Gets whether the entries vector already contains an entry, based on its ID path.
virtual ColumnWidthVector columnWidths() const
Gets the widths of each column in the view.
virtual Callback *const cellClickCallback() const
Gets the callback set for when a cell is clicked.
virtual int32_t changedColumnIndex() const
Gets the column index of the cell in the entry that was last modified.
virtual bool potentialReorderGood() const
Gets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual HierarchicalColumnView * clone() const
Convenience method to clone a HierarchicalColumnView object on the heap.
virtual std::string text() const
Gets the current text value of the list.
HierarchicalColumnView(const Rect &frame_, const ColumnNameVector &colNames_)
Constructs a hierarchical column view with a frame only, no contents.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a hierarchical column view to be changed out entirely.
virtual HierarchicalColumnView * duplicate() const
Convenience method to duplicate a HierarchicalColumnView object, creating a new and identical UI elem...
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the hierarchical column view.
virtual std::unique_ptr< TreeColumnEntry > changedEntry() const
Gets the entry that was last modified via double-click inline editing.
virtual void setReorderCallback(const Callback &callback_)
Sets the reorder callback for the widget.
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...
HierarchicalColumnView(const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const IndexVector &indexPath_)
Constructs a hierarchical column view.
virtual std::unique_ptr< TreeColumnEntry > clickedEntry() const
Gets the entry of the cell that was last clicked.
virtual void deselectAll()
Deselects all currently selected entries in the list.
virtual IDVector currentIDPath() const
Gets the ID path of the currently selected entry.
virtual uint16_t columnCount() const
Gets the number of columns in the widget.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Allows hierarchical column views to store more data than simply strings and indices.
Definition: hdicoreTreeColumnEntry.h:29
Header file for a variety of plugin convenience macros.