Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreColumnView.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_COLUMN_VIEW__
8 #define __HDI_CORE_COLUMN_VIEW__
9 
10 #include <vector>
11 
12 #include "hdicoreMacros.h"
13 
14 #include "hdicoreWidget.h"
15 
16 namespace hdi
17 {
18  namespace core
19  {
20  class Callback;
21  class ColumnEntry;
22 
26  class ColumnView : public Widget
27  {
28  public:
29  typedef std::vector<ColumnEntry> EntryVector;
30  typedef std::vector<std::string> ColumnNameVector;
31  typedef std::vector<double> ColumnWidthVector;
32 
44  ColumnView();
45 
53  ColumnView(const ColumnView& colView_);
54 
63  ColumnView(const Rect& frame_, const uint16_t numCols_);
64 
73  ColumnView(const Rect& frame_, const ColumnNameVector& colNames_);
74 
85  ColumnView(
86  const Rect& frame_,
87  const uint16_t numCols_,
88  const EntryVector& entries_,
89  const int32_t index_
90  );
91 
102  ColumnView(
103  const Rect& frame_,
104  const ColumnNameVector& colNames_,
105  const EntryVector& entries_,
106  const int32_t index_
107  );
108 
120  ColumnView(
121  const Rect& frame_,
122  const uint16_t numCols_,
123  const EntryVector& entries_,
124  const std::string& initialID_
125  );
126 
138  ColumnView(
139  const Rect& frame_,
140  const ColumnNameVector& colNames_,
141  const EntryVector& entries_,
142  const std::string& initialID_
143  );
144 
153  virtual ColumnView& operator=(const ColumnView& rhs_);
154 
160  virtual ~ColumnView();
161 
175  virtual ColumnView* clone() const;
176 
192  virtual ColumnView* duplicate() const;
193 
199  virtual void deselectAll();
200 
208  virtual std::string text() const;
209 
219  virtual void setText(const std::string&);
220 
228  virtual int32_t currentIndex() const;
229 
238  virtual bool setCurrentIndex(const int32_t index_);
239 
247  virtual std::string currentID() const;
248 
257  virtual bool setCurrentID(const std::string& id_);
258 
266  virtual std::auto_ptr<ColumnEntry> currentEntry() const;
267 
278  virtual const std::vector< ColumnEntry* >* const entries() const;
279 
288  virtual bool hasEntry(const std::string& id_) const;
289 
297  virtual void setEntries(const EntryVector& entries_);
298 
299  // TODO methods to insert and remove specific entries
300 
306  virtual void clearEntries();
307 
315  virtual bool hasHeader() const;
316 
324  virtual uint16_t columnCount() const;
325 
336  virtual ColumnNameVector columnNames() const;
337 
345  virtual ColumnWidthVector columnWidths() const;
346 
354  virtual void setColumnWidths(const ColumnWidthVector& widths_);
355 
363  virtual bool columnWidthsLocked() const;
364 
372  virtual void setColumnWidthsLocked(const bool locked_);
373 
379  virtual void valueChanged();
380 
388  virtual Callback* const valueChangedCallback() const;
389 
397  virtual void setValueChangedCallback(const Callback& callback_);
398 
404  virtual void update();
405 
413  virtual Callback* const imageClickCallback() const;
414 
425  virtual void setImageClickCallback(const Callback& callback_);
426 
437  virtual std::auto_ptr<ColumnEntry> clickedEntry() const;
438 
449  virtual int32_t clickedColumnIndex() const;
450  };
451 
452  typedef std::auto_ptr<ColumnView> ColumnViewAP;
453  }
454 }
455 
456 #endif
457 // __HDI_CORE_COLUMN_VIEW__
virtual void valueChanged()
Simulates the column view having its value changed.
virtual bool hasEntry(const std::string &id_) const
Gets whether the entries vector already contains an entry, based on its ID.
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
virtual void clearEntries()
Clears all entries contained by the widget.
virtual bool setCurrentIndex(const int32_t index_)
Sets the currently selected entry by index.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual bool setCurrentID(const std::string &id_)
Sets the currently selected entry by ID.
virtual const std::vector< ColumnEntry * > *const entries() const
Gets the entries vector.
virtual int32_t currentIndex() const
Gets the index of the currently selected entry.
virtual void deselectAll()
Deselects all currently selected entries in the list.
virtual uint16_t columnCount() const
Gets the number of columns in the widget.
virtual ColumnView * clone() const
Convenience method to clone a ColumnView object on the heap.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual std::auto_ptr< ColumnEntry > clickedEntry() const
Gets the image entry that was last clicked.
virtual void setText(const std::string &)
Does nothing.
virtual ColumnView & operator=(const ColumnView &rhs_)
Allows one ColumnView object to be assigned from another.
virtual bool hasHeader() const
Gets whether the widget has a header component to show the names of the columns.
virtual void setColumnWidths(const ColumnWidthVector &widths_)
Sets the widths of each column in the view.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a column view to be changed out entirely.
virtual void setImageClickCallback(const Callback &callback_)
Sets/updates the callback for when an image entry is clicked.
virtual std::string text() const
Gets the current text value of the list.
Column view widget, much like a list view but allowing for entries with multiple columns.
Definition: hdicoreColumnView.h:26
Header file for a variety of Illustrator plugin convenience macros.
virtual void update()
Force the column view to update its entries.
virtual Callback *const imageClickCallback() const
Gets the callback set for when an image entry is clicked.
virtual void setColumnWidthsLocked(const bool locked_)
Sets whether the column widths are locked (i.e. the user cannot change them)
Definition: hdicoreaiArray.h:12
ColumnView()
Constructs an empty ColumnView object.
Header file for Illustrator user interface widgets.
virtual int32_t clickedColumnIndex() const
Gets the column index of the image in the entry that was last clicked.
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 ~ColumnView()
ColumnView destructor.
virtual std::string currentID() const
Gets the ID of the currently selected entry.
virtual ColumnWidthVector columnWidths() const
Gets the widths of each column in the view.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the column view.
virtual ColumnNameVector columnNames() const
Gets the column names vector.
virtual std::auto_ptr< ColumnEntry > currentEntry() const
Gets the current entry object.