7#ifndef __HDI_CORE_COLUMN_VIEW__
8#define __HDI_CORE_COLUMN_VIEW__
29 typedef std::vector<ColumnEntry> EntryVector;
30 typedef std::vector<std::string> ColumnNameVector;
31 typedef std::vector<double> ColumnWidthVector;
87 const uint16_t numCols_,
88 const EntryVector& entries_,
104 const ColumnNameVector& colNames_,
105 const EntryVector& entries_,
122 const uint16_t numCols_,
123 const EntryVector& entries_,
124 const std::string& initialID_
140 const ColumnNameVector& colNames_,
141 const EntryVector& entries_,
142 const std::string& initialID_
208 virtual std::string
text()
const;
278 virtual const std::vector< std::shared_ptr<ColumnEntry> >*
const entries()
const;
288 virtual bool hasEntry(
const std::string& id_)
const;
298 virtual std::shared_ptr<ColumnEntry>
entryWithID(
const std::string& id_)
const;
375 virtual bool reorderEntry(
const std::string& targetID_,
const std::string& positionID_);
723 typedef std::unique_ptr<ColumnView> ColumnViewUP;
724 typedef std::shared_ptr<ColumnView> ColumnViewSP;
725 typedef std::weak_ptr<ColumnView> ColumnViewWP;
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Allows column views to store more data than simply strings and indices.
Definition: hdicoreColumnEntry.h:30
Column view widget, much like a list view but allowing for entries with multiple columns.
Definition: hdicoreColumnView.h:27
virtual ColumnWidthVector columnWidths() const
Gets the widths of each column in the view.
virtual Callback *const reorderCallback() const
Gets the current reorder callback for the widget.
virtual ColumnNameVector columnNames() const
Gets the column names vector.
virtual void setPotentialReorderCallback(const Callback &callback_)
Sets the potential-reorder callback for the widget.
virtual std::vector< std::string > reorderPosition() const
Gets the position for the reorder, i.e. the entry just before the reposition.
virtual bool setCurrentID(const std::string &id_)
Sets the currently selected entry by ID.
virtual int32_t changedColumnIndex() const
Gets the column index of the cell in the entry that was last modified.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the column view.
virtual void setColumnWidthsLocked(const bool locked_)
Sets whether the column widths are locked (i.e. the user cannot change them)
virtual int32_t currentIndex() const
Gets the index of the currently selected entry.
virtual bool hasEntry(const std::string &id_) const
Gets whether the entries vector already contains an entry, based on its ID.
virtual bool reorderEntry(const std::string &targetID_, const std::string &positionID_)
Reorders a target entry (based on ID) to be newly located just after another existing entry in the li...
ColumnView(const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const std::string &initialID_)
Constructor for a column view with an initial ID selected.
virtual void deselectAll()
Deselects all currently selected entries in the list.
ColumnView(const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const int32_t index_)
Constructs a column view.
virtual bool pushEntry(const ColumnEntry &entry_)
Pushes an entry onto the list (i.e. at the end)
ColumnView(const ColumnView &colView_)
Constructs a new ColumnView object from an existing ColumnView object (copy constructor)
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual std::unique_ptr< ColumnEntry > clickedEntry() const
Gets the entry of the cell that was last clicked.
virtual std::unique_ptr< ColumnEntry > changedEntry() const
Gets the entry that was last modified via double-click inline editing.
virtual bool columnWidthsLocked() const
Gets whether the column widths are locked (i.e. the user cannot change them)
virtual ColumnView * duplicate() const
Convenience method to duplicate a ColumnView object, creating a new and identical UI element to the t...
virtual void setText(const std::string &)
Does nothing.
virtual bool potentialReorderGood() const
Gets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual ColumnView * clone() const
Convenience method to clone a ColumnView object on the heap.
virtual bool hasHeader() const
Gets whether the widget has a header component to show the names of the columns.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual void update()
Force the column view to update its entries.
virtual std::vector< std::string > reorderSource() const
Gets the source item involved in the reorder, i.e. the entry being dropped.
virtual bool reorderable() const
Gets whether reordering support for the list is enabled.
virtual void valueChanged()
Simulates the column view having its value changed.
virtual void setReorderCallback(const Callback &callback_)
Sets the reorder callback for the widget.
virtual bool removeEntry(const std::string &id_, ColumnEntry &entry__)
Removes a specific entry from the list of entries.
virtual std::string text() const
Gets the current text value of the list.
ColumnView(const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const int32_t index_)
Constructs a column view.
virtual std::vector< std::string > potentialReorderPosition() const
Gets the position for the reorder, i.e. the entry just before the proposed reposition.
ColumnView(const Rect &frame_, const uint16_t numCols_)
Constructs a column view with a frame only, no contents.
virtual void setCellClickCallback(const Callback &callback_)
Sets/updates the callback for when a cell is clicked.
virtual std::shared_ptr< ColumnEntry > entryWithID(const std::string &id_) const
Gets the entry with the given ID, provided it exists within the widget.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a column view to be changed out entirely.
ColumnView()
Constructs an empty ColumnView object.
virtual Callback *const cellClickCallback() const
Gets the callback set for when a cell is clicked.
virtual Callback *const potentialReorderCallback() const
Gets the current potential-reorder callback for the list.
ColumnView(const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const std::string &initialID_)
Constructor for a column view with an initial ID selected.
virtual int32_t clickedColumnIndex() const
Gets the column index of the cell in the entry that was last clicked.
virtual void setPotentialReorderGood(const bool good_)
Sets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual const std::vector< std::shared_ptr< ColumnEntry > > *const entries() const
Gets the entries vector.
virtual bool setCurrentIndex(const int32_t index_)
Sets the currently selected entry by index.
virtual std::string currentID() const
Gets the ID of the currently selected entry.
virtual std::vector< std::string > potentialReorderSource() const
Gets the source item involved in the potential reorder, i.e. the entry being dragged.
virtual void setReorderable(const bool enable_)
Sets whether reordering support for the list is enabled.
virtual ColumnView & operator=(const ColumnView &rhs_)
Allows one ColumnView object to be assigned from another.
ColumnView(const Rect &frame_, const ColumnNameVector &colNames_)
Constructs a column view with a frame only, no contents.
virtual std::unique_ptr< ColumnEntry > currentEntry() const
Gets the current entry object.
virtual void setColumnWidths(const ColumnWidthVector &widths_)
Sets the widths of each column in the view.
virtual uint16_t columnCount() const
Gets the number of columns in the widget.
virtual Callback *const cellChangedCallback() const
Gets the callback for when a cell is modified via double-click inline editing.
virtual void setCellChangedCallback(const Callback &callback_)
Sets the callback for when a cell is modified via double-click inline editing.
virtual bool popEntry(ColumnEntry &entry__)
Pops an entry off the list (i.e. from the end)
virtual bool insertEntry(const std::string &id_, const ColumnEntry &entry_)
Inserts an entry into the list of entries at a given position.
virtual ~ColumnView()
ColumnView destructor.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Header file for a variety of plugin convenience macros.