Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreHierarchicalColumnView.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_HIERARCHICAL_COLUMN_VIEW__
8#define __HDI_CORE_HIERARCHICAL_COLUMN_VIEW__
9
10#include <vector>
11
12#include "hdicoreMacros.h"
13
14#include "hdicoreWidget.h"
15
16namespace hdi
17{
18 namespace core
19 {
20 class Callback;
21 class TreeColumnEntry;
22
28 {
29 public:
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;
36
49
59
68 HierarchicalColumnView(const Rect& frame_, const uint16_t numCols_);
69
78 HierarchicalColumnView(const Rect& frame_, const ColumnNameVector& colNames_);
79
91 const Rect& frame_,
92 const uint16_t numCols_,
93 const EntryVector& entries_,
94 const IndexVector& indexPath_
95 );
96
108 const Rect& frame_,
109 const ColumnNameVector& colNames_,
110 const EntryVector& entries_,
111 const IndexVector& indexPath_
112 );
113
126 const Rect& frame_,
127 const uint16_t numCols_,
128 const EntryVector& entries_,
129 const IDVector& idPath_
130 );
131
144 const Rect& frame_,
145 const ColumnNameVector& colNames_,
146 const EntryVector& entries_,
147 const IDVector& idPath_
148 );
149
159
166
182
199
205 virtual void deselectAll();
206
214 virtual std::string text() const;
215
225 virtual void setText(const std::string&);
226
234 virtual IndexVector currentIndexPath() const;
235
244 virtual bool setCurrentIndexPath(const IndexVector& indexPath_);
245
253 virtual IDVector currentIDPath() const;
254
263 virtual bool setCurrentIDPath(const IDVector& idPath_);
264
272 virtual std::unique_ptr<TreeColumnEntry> currentEntry() const;
273
284 virtual const std::vector< std::shared_ptr<TreeColumnEntry> >* const entries() const;
285
294 virtual bool hasEntry(const IDVector& idPath_) const;
295
304 virtual std::shared_ptr<TreeColumnEntry> entryWithIDPath(const IDVector& idPath_) const;
305
313 virtual void setEntries(const EntryVector& entries_);
314
331 virtual bool insertEntry(const TreeColumnEntry& entry_, const IDVector& idPath_);
332
345 virtual std::shared_ptr<TreeColumnEntry> removeEntry(const IDVector& idPath_);
346
363 virtual bool reorderEntry(const IDVector& targetID_, const IDVector& positionID_);
364
370 virtual void clearEntries();
371
379 virtual bool hasHeader() const;
380
388 virtual uint16_t columnCount() const;
389
400 virtual ColumnNameVector columnNames() const;
401
409 virtual ColumnWidthVector columnWidths() const;
410
418 virtual void setColumnWidths(const ColumnWidthVector& widths_);
419
427 virtual bool columnWidthsLocked() const;
428
436 virtual void setColumnWidthsLocked(const bool locked_);
437
447 virtual uint16_t outlineColumnIndex() const;
448
458 virtual void setOutlineColumnIndex(const uint16_t oc_);
459
470 virtual bool outlineColumnExpands() const;
471
482 virtual void setOutlineColumnExpands(const bool exp_);
483
489 virtual void valueChanged();
490
500 virtual Callback* const valueChangedCallback() const;
501
511 virtual void setValueChangedCallback(const Callback& callback_);
512
518 virtual void update();
519
527 virtual Callback* const cellClickCallback() const;
528
539 virtual void setCellClickCallback(const Callback& callback_);
540
551 virtual std::unique_ptr<TreeColumnEntry> clickedEntry() const;
552
563 virtual int32_t clickedColumnIndex() const;
564
572 virtual Callback* const expansionCallback() const;
573
584 virtual void setExpansionCallback(const Callback& callback_);
585
596 virtual std::unique_ptr<TreeColumnEntry> expansionEntry() const;
597
605 virtual Callback* const cellChangedCallback() const;
606
617 virtual void setCellChangedCallback(const Callback& callback_);
618
629 virtual std::unique_ptr<TreeColumnEntry> changedEntry() const;
630
641 virtual int32_t changedColumnIndex() const;
642
650 virtual bool reorderable() const;
651
659 virtual void setReorderable(const bool enable_);
660
668 virtual Callback* const potentialReorderCallback() const;
669
681 virtual void setPotentialReorderCallback(const Callback& callback_);
682
693 virtual std::vector<std::string> potentialReorderSource() const;
694
708 virtual std::vector<std::string> potentialReorderPosition() const;
709
721 virtual bool potentialReorderGood() const;
722
741 virtual void setPotentialReorderGood(const bool good_);
742
750 virtual Callback* const reorderCallback() const;
751
762 virtual void setReorderCallback(const Callback& callback_);
763
774 virtual std::vector<std::string> reorderSource() const;
775
789 virtual std::vector<std::string> reorderPosition() const;
790 };
791
792 typedef std::unique_ptr<HierarchicalColumnView> HierarchicalColumnViewUP;
793 typedef std::shared_ptr<HierarchicalColumnView> HierarchicalColumnViewSP;
794 typedef std::weak_ptr<HierarchicalColumnView> HierarchicalColumnViewWP;
795 }
796}
797
798#endif
799// __HDI_CORE_HIERARCHICAL_COLUMN_VIEW__
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
Base class for all interface widgets; handles many common needs, e.g. text, position,...
Definition: hdicoreWidget.h:30
Header file for a variety of plugin convenience macros.
Header file for plugin user interface widgets.