Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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 
14 namespace 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 
39  ListView();
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 
136  virtual void deselectAll();
137 
145  virtual int32_t currentIndex() const;
146 
155  virtual bool setCurrentIndex(const int32_t index_);
156 
164  virtual std::string currentID() const;
165 
174  virtual bool setCurrentID(const std::string& id_);
175 
183  virtual std::string currentValue() const;
184 
193  virtual bool setCurrentValue(const std::string& value_);
194 
202  virtual std::auto_ptr<ListEntry> currentEntry() const;
203 
212  virtual bool currentUserData(void*& data__) const;
213 
224  virtual const std::vector< ListEntry* >* const entries() const;
225 
234  virtual bool hasEntry(const std::string& id_) const;
235 
243  virtual void setEntries(const EntryVector& entries_);
244 
255  virtual bool pushEntry(const ListEntry& entry_);
256 
266  virtual bool popEntry(ListEntry& entry__);
267 
282  virtual bool insertEntry(const std::string& id_, const ListEntry& entry_);
283 
294  virtual bool removeEntry(const std::string& id_, ListEntry& entry__);
295 
301  virtual void clearEntries();
302 
308  virtual void valueChanged();
309 
317  virtual Callback* const valueChangedCallback() const;
318 
326  virtual void setValueChangedCallback(const Callback& callback_);
327 
333  virtual void update();
334  };
335 
336  typedef std::auto_ptr<ListView> ListViewAP;
337  }
338 }
339 
340 #endif
341 // __HDI_CORE_LIST_VIEW__
List view widget, much like a popup menu but allowing for multiple entries to be seen at a time...
Definition: hdicoreListView.h:24
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::string currentID() const
Gets the ID of the currently selected entry.
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
virtual void valueChanged()
Simulates the list view having its value changed.
virtual bool setCurrentIndex(const int32_t index_)
Sets the currently selected entry by index.
virtual bool setCurrentValue(const std::string &value_)
Sets the currently selected entry by string value.
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< ListEntry * > *const entries() const
Gets the entries vector.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a list view to be changed out entirely.
virtual bool pushEntry(const ListEntry &entry_)
Pushes an entry onto the list (i.e. at the end)
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual void update()
Force the list view to update its entries.
Allows combo boxes, popups, and lists to store more data than simply strings and indices.
Definition: hdicoreListEntry.h:24
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual std::auto_ptr< ListEntry > currentEntry() const
Gets the current entry object.
virtual std::string currentValue() const
Gets the string value of the currently selected entry.
virtual bool popEntry(ListEntry &entry__)
Pops an entry off the list (i.e. from the end)
virtual ~ListView()
ListView destructor.
virtual void deselectAll()
Deselects all currently selected entries in the list.
Definition: hdicoreaiArray.h:12
virtual ListView * clone() const
Convenience method to clone a ListView object on the heap.
Header file for Illustrator user interface widgets.
virtual ListView * duplicate() const
Convenience method to duplicate a ListView object, creating a new and identical UI element to the tar...
ListView()
Constructs an empty ListView object.
virtual bool setCurrentID(const std::string &id_)
Sets the currently selected entry by ID.
virtual void clearEntries()
Clears all entries contained by the widget.
virtual bool insertEntry(const std::string &id_, const ListEntry &entry_)
Inserts an entry into the list of entries at a given position.
virtual bool currentUserData(void *&data__) const
Gets the user data for the current entry.
virtual bool removeEntry(const std::string &id_, ListEntry &entry__)
Removes a specific entry from the list of entries.
virtual int32_t currentIndex() const
Gets the index of the currently selected entry.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the list view.