Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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 
16 namespace 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 
55  HierarchicalView(const HierarchicalView& hierView_);
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 
105  virtual HierarchicalView& operator=(const HierarchicalView& rhs_);
106 
112  virtual ~HierarchicalView();
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::auto_ptr<TreeEntry> currentEntry() const;
238 
247  virtual bool currentUserData(void*& data__) const;
248 
259  virtual const std::vector< TreeEntry* >* const entries() const;
260 
269  virtual bool hasEntry(const IDVector& idPath_) const;
270 
278  virtual void setEntries(const EntryVector& entries_);
279 
285  virtual void clearEntries();
286 
292  virtual void valueChanged();
293 
301  virtual Callback* const valueChangedCallback() const;
302 
310  virtual void setValueChangedCallback(const Callback& callback_);
311 
317  virtual void update();
318 
326  virtual Callback* const imageClickCallback() const;
327 
338  virtual void setImageClickCallback(const Callback& callback_);
339 
350  virtual std::auto_ptr<TreeEntry> clickedImageEntry() const;
351 
359  virtual Callback* const expansionCallback() const;
360 
371  virtual void setExpansionCallback(const Callback& callback_);
372 
383  virtual std::auto_ptr<TreeEntry> expansionEntry() const;
384  };
385 
386  typedef std::auto_ptr<HierarchicalView> HierarchicalViewAP;
387  }
388 }
389 
390 #endif
391 // __HDI_CORE_HIERARCHICAL_VIEW__
virtual IndexVector currentIndexPath() const
Gets the index path 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 setImageClickCallback(const Callback &callback_)
Sets/updates the callback for when an image entry is clicked.
virtual ValueVector currentValuePath() const
Gets the string value path of the currently selected entry.
virtual HierarchicalView & operator=(const HierarchicalView &rhs_)
Allows one HierarchicalView object to be assigned from another.
virtual bool setCurrentIndexPath(const IndexVector &indexPath_)
Sets the currently selected entry by index path.
virtual void update()
Force the hierarchical view to update its entries.
virtual IDVector currentIDPath() const
Gets the ID path of the currently selected entry.
HierarchicalView()
Constructs an empty HierarchicalView object.
virtual Callback *const expansionCallback() const
Gets the callback set for when an entry is expanded/collapsed.
virtual void setEntries(const EntryVector &entries_)
Allows the entries in a hierarchical view to be changed out entirely.
virtual std::auto_ptr< TreeEntry > clickedImageEntry() const
Gets the image entry that was last clicked.
virtual HierarchicalView * clone() const
Convenience method to clone a HierarchicalView object on the heap.
virtual void deselectAll()
Deselects all currently selected entries in the list.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual std::auto_ptr< TreeEntry > currentEntry() const
Gets the current entry object.
virtual bool currentUserData(void *&data__) const
Gets the user data for the current entry.
virtual bool setCurrentIDPath(const IDVector &idPath_)
Sets the currently selected entry by ID path.
Header file for a variety of Illustrator plugin convenience macros.
Definition: hdicoreaiArray.h:12
virtual Callback *const imageClickCallback() const
Gets the callback set for when an image entry is clicked.
Header file for Illustrator user interface widgets.
virtual void setText(const std::string &)
Does nothing.
virtual ~HierarchicalView()
HierarchicalView destructor.
virtual const std::vector< TreeEntry * > *const entries() const
Gets the entries vector.
virtual void valueChanged()
Simulates the hierarchical view having its value changed.
virtual void clearEntries()
Clears all entries contained by the widget.
Hierarchical view widget, much like a list view but allowing for a tree-like structure of entries...
Definition: hdicoreHierarchicalView.h:26
virtual bool setCurrentValuePath(const ValueVector &valuePath_)
Sets the currently selected entry by value path.
virtual void setExpansionCallback(const Callback &callback_)
Sets/updates the callback for when an entry is expanded/collapsed.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the hierarchical view.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual HierarchicalView * duplicate() const
Convenience method to duplicate a HierarchicalView object, creating a new and identical UI element to...
virtual bool hasEntry(const IDVector &idPath_) const
Gets whether the entries vector already contains an entry, based on its ID path.
virtual std::string text() const
Gets the current text value of the list.
virtual std::auto_ptr< TreeEntry > expansionEntry() const
Gets the entry that was last expanded/collapsed.