Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreHierarchicalView.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_HIERARCHICAL_VIEW__
8#define __HDI_CORE_HIERARCHICAL_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 TreeEntry;
22
26 class HierarchicalView : public Widget
27 {
28 public:
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;
33
46
56
64 HierarchicalView(const Rect& frame_);
65
76 const Rect& frame_,
77 const EntryVector& entries_,
78 const IndexVector& indexPath_
79 );
80
92 const Rect& frame_,
93 const EntryVector& entries_,
94 const IDVector& idPath_
95 );
96
106
113
127 virtual HierarchicalView* clone() const;
128
144 virtual HierarchicalView* duplicate() const;
145
151 virtual void deselectAll();
152
160 virtual std::string text() const;
161
170 virtual void setText(const std::string&);
171
179 virtual IndexVector currentIndexPath() const;
180
189 virtual bool setCurrentIndexPath(const IndexVector& indexPath_);
190
198 virtual IDVector currentIDPath() const;
199
208 virtual bool setCurrentIDPath(const IDVector& idPath_);
209
217 virtual ValueVector currentValuePath() const;
218
228 virtual bool setCurrentValuePath(const ValueVector& valuePath_);
229
237 virtual std::unique_ptr<TreeEntry> currentEntry() const;
238
247 virtual bool currentUserData(void*& data__) const;
248
259 virtual const std::vector< std::shared_ptr<TreeEntry> >* const entries() const;
260
269 virtual bool hasEntry(const IDVector& idPath_) const;
270
279 virtual std::shared_ptr<TreeEntry> entryWithIDPath(const IDVector& idPath_) const;
280
288 virtual void setEntries(const EntryVector& entries_);
289
306 virtual bool insertEntry(const TreeEntry& entry_, const IDVector& idPath_);
307
320 virtual std::shared_ptr<TreeEntry> removeEntry(const IDVector& idPath_);
321
338 virtual bool reorderEntry(const IDVector& targetID_, const IDVector& positionID_);
339
345 virtual void clearEntries();
346
352 virtual void valueChanged();
353
363 virtual Callback* const valueChangedCallback() const;
364
374 virtual void setValueChangedCallback(const Callback& callback_);
375
381 virtual void update();
382
390 virtual Callback* const expansionCallback() const;
391
402 virtual void setExpansionCallback(const Callback& callback_);
403
414 virtual std::unique_ptr<TreeEntry> expansionEntry() const;
415
423 virtual Callback* const cellChangedCallback() const;
424
435 virtual void setCellChangedCallback(const Callback& callback_);
436
447 virtual std::unique_ptr<TreeEntry> changedEntry() const;
448
456 virtual bool reorderable() const;
457
465 virtual void setReorderable(const bool enable_);
466
474 virtual Callback* const potentialReorderCallback() const;
475
487 virtual void setPotentialReorderCallback(const Callback& callback_);
488
499 virtual std::vector<std::string> potentialReorderSource() const;
500
514 virtual std::vector<std::string> potentialReorderPosition() const;
515
527 virtual bool potentialReorderGood() const;
528
547 virtual void setPotentialReorderGood(const bool good_);
548
556 virtual Callback* const reorderCallback() const;
557
568 virtual void setReorderCallback(const Callback& callback_);
569
580 virtual std::vector<std::string> reorderSource() const;
581
595 virtual std::vector<std::string> reorderPosition() const;
596 };
597
598 typedef std::unique_ptr<HierarchicalView> HierarchicalViewUP;
599 typedef std::shared_ptr<HierarchicalView> HierarchicalViewSP;
600 typedef std::weak_ptr<HierarchicalView> HierarchicalViewWP;
601 }
602}
603
604#endif
605// __HDI_CORE_HIERARCHICAL_VIEW__
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
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.