Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreListView.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_LIST_VIEW__
8#define __HDI_CORE_LIST_VIEW__
9
10#include <vector>
11
12#include "hdicoreWidget.h"
13
14namespace hdi
15{
16 namespace core
17 {
18 class Callback;
19 class ListEntry;
20
24 class ListView : public Widget
25 {
26 public:
27 typedef std::vector<ListEntry> EntryVector;
28
40
48 ListView(const ListView& listView_);
49
57 ListView(const Rect& frame_);
58
68 ListView(const Rect& frame_, const EntryVector& entries_, const int32_t index_);
69
80 ListView(const Rect& frame_, const EntryVector& entries_, const std::string& initialID_);
81
90 virtual ListView& operator=(const ListView& rhs_);
91
97 virtual ~ListView();
98
112 virtual ListView* clone() const;
113
129 virtual ListView* duplicate() const;
130
138 virtual Type type() const;
139
145 virtual void deselectAll();
146
154 virtual int32_t currentIndex() const;
155
164 virtual bool setCurrentIndex(const int32_t index_);
165
173 virtual std::string currentID() const;
174
183 virtual bool setCurrentID(const std::string& id_);
184
192 virtual std::string currentValue() const;
193
202 virtual bool setCurrentValue(const std::string& value_);
203
211 virtual std::unique_ptr<ListEntry> currentEntry() const;
212
221 virtual bool currentUserData(void*& data__) const;
222
233 virtual const std::vector< std::shared_ptr<ListEntry> >* const entries() const;
234
243 virtual bool hasEntry(const std::string& id_) const;
244
253 virtual std::shared_ptr<ListEntry> entryWithID(const std::string& id_) const;
254
262 virtual void setEntries(const EntryVector& entries_);
263
274 virtual bool pushEntry(const ListEntry& entry_);
275
285 virtual bool popEntry(ListEntry& entry__);
286
301 virtual bool insertEntry(const std::string& id_, const ListEntry& entry_);
302
313 virtual bool removeEntry(const std::string& id_, ListEntry& entry__);
314
330 virtual bool reorderEntry(const std::string& targetID_, const std::string& positionID_);
331
337 virtual void clearEntries();
338
344 virtual void valueChanged();
345
355 virtual Callback* const valueChangedCallback() const;
356
366 virtual void setValueChangedCallback(const Callback& callback_);
367
373 virtual void update();
374
382 virtual Callback* const cellChangedCallback() const;
383
394 virtual void setCellChangedCallback(const Callback& callback_);
395
406 virtual std::unique_ptr<ListEntry> changedEntry() const;
407
415 virtual bool reorderable() const;
416
424 virtual void setReorderable(const bool enable_);
425
433 virtual Callback* const potentialReorderCallback() const;
434
446 virtual void setPotentialReorderCallback(const Callback& callback_);
447
458 virtual std::vector<std::string> potentialReorderSource() const;
459
472 virtual std::vector<std::string> potentialReorderPosition() const;
473
485 virtual bool potentialReorderGood() const;
486
505 virtual void setPotentialReorderGood(const bool good_);
506
514 virtual Callback* const reorderCallback() const;
515
526 virtual void setReorderCallback(const Callback& callback_);
527
538 virtual std::vector<std::string> reorderSource() const;
539
552 virtual std::vector<std::string> reorderPosition() const;
553 };
554
555 typedef std::unique_ptr<ListView> ListViewUP;
556 typedef std::shared_ptr<ListView> ListViewSP;
557 typedef std::weak_ptr<ListView> ListViewWP;
558 }
559}
560
561#endif
562// __HDI_CORE_LIST_VIEW__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Allows combo boxes, popups, and lists to store more data than simply strings and indices.
Definition: hdicoreListEntry.h:25
List view widget, much like a popup menu but allowing for multiple entries to be seen at a time.
Definition: hdicoreListView.h:25
ListView(const Rect &frame_)
Constructs a list view with a frame only, no contents.
ListView(const ListView &listView_)
Constructs a new ListView object from an existing ListView object (copy constructor)
virtual void setCellChangedCallback(const Callback &callback_)
Sets the callback for when a cell is modified via double-click inline editing.
virtual void deselectAll()
Deselects all currently selected entries in the list.
virtual int32_t currentIndex() const
Gets the index of the currently selected entry.
virtual void setPotentialReorderCallback(const Callback &callback_)
Sets the potential-reorder callback for the widget.
virtual Callback *const cellChangedCallback() const
Gets the callback for when a cell is modified via double-click inline editing.
virtual ~ListView()
ListView destructor.
virtual std::vector< std::string > reorderSource() const
Gets the source item involved in the reorder, i.e. the entry being dropped.
virtual bool setCurrentIndex(const int32_t index_)
Sets the currently selected entry by index.
ListView(const Rect &frame_, const EntryVector &entries_, const std::string &initialID_)
Constructor for a list view with an initial ID selected.
ListView()
Constructs an empty ListView object.
virtual bool setCurrentID(const std::string &id_)
Sets the currently selected entry by ID.
virtual std::unique_ptr< ListEntry > changedEntry() const
Gets the entry that was last modified via double-click inline editing.
virtual bool pushEntry(const ListEntry &entry_)
Pushes an entry onto the list (i.e. at the end)
virtual std::vector< std::string > potentialReorderPosition() const
Gets the position for the reorder, i.e. the entry just before the proposed reposition.
virtual ListView * clone() const
Convenience method to clone a ListView object on the heap.
virtual std::string currentID() const
Gets the ID of the currently selected entry.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a list view to be changed out entirely.
virtual bool currentUserData(void *&data__) const
Gets the user data for the current entry.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual std::unique_ptr< ListEntry > currentEntry() const
Gets the current entry object.
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...
virtual ListView * duplicate() const
Convenience method to duplicate a ListView object, creating a new and identical UI element to the tar...
virtual void valueChanged()
Simulates the list view having its value changed.
virtual std::string currentValue() const
Gets the string value of the currently selected entry.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the list view.
virtual bool hasEntry(const std::string &id_) const
Gets whether the entries vector already contains an entry, based on its ID.
virtual const std::vector< std::shared_ptr< ListEntry > > *const entries() const
Gets the entries vector.
virtual void update()
Force the list view to update its entries.
virtual bool setCurrentValue(const std::string &value_)
Sets the currently selected entry by string value.
virtual ListView & operator=(const ListView &rhs_)
Allows one ListView object to be assigned from another.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual std::shared_ptr< ListEntry > entryWithID(const std::string &id_) const
Gets the entry with the given ID, provided it exists within the widget.
virtual bool popEntry(ListEntry &entry__)
Pops an entry off the list (i.e. from the end)
virtual bool potentialReorderGood() const
Gets whether the potential reorder is acceptable; if not, the drag cursor will indicate the proposed ...
virtual Callback *const reorderCallback() const
Gets the current reorder callback for the widget.
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 > reorderPosition() const
Gets the position for the reorder, i.e. the entry just before the reposition.
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 void setReorderCallback(const Callback &callback_)
Sets the reorder callback for the widget.
ListView(const Rect &frame_, const EntryVector &entries_, const int32_t index_)
Constructs a list view.
virtual Callback *const potentialReorderCallback() const
Gets the current potential-reorder callback for the list.
virtual bool reorderable() const
Gets whether reordering support for the list is enabled.
virtual bool removeEntry(const std::string &id_, ListEntry &entry__)
Removes a specific entry from the list of entries.
virtual Type type() const
Gets the type of the widget.
virtual bool insertEntry(const std::string &id_, const ListEntry &entry_)
Inserts an entry into the list of entries at a given position.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Base class for all interface widgets; handles many common needs, e.g. text, position,...
Definition: hdicoreWidget.h:30
Type
Supported widget types.
Definition: hdicoreWidget.h:36
Header file for plugin user interface widgets.