Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Types | Public Member Functions | List of all members
hdi::core::HierarchicalColumnView Class Reference

Hierarchical column view widget, much like a list view but allowing for entries with multiple columns presented in a hierarchical fashion. More...

#include <hdicoreHierarchicalColumnView.h>

Inheritance diagram for hdi::core::HierarchicalColumnView:
Inheritance graph
[legend]
Collaboration diagram for hdi::core::HierarchicalColumnView:
Collaboration graph
[legend]

Public Types

typedef std::vector< TreeColumnEntryEntryVector
 
typedef std::vector< std::string > ColumnNameVector
 
typedef std::vector< double > ColumnWidthVector
 
typedef std::vector< int32_t > IndexVector
 
typedef std::vector< std::string > IDVector
 
typedef std::vector< std::string > ValueVector
 
- Public Types inherited from hdi::core::Widget
enum  Type {
  UnknownType = 0, BoxType = 10, ButtonType = 20, CheckboxType = 30,
  ColumnViewType = 40, ComboBoxType = 50, ColorWellType = 60, CustomType = 70,
  DividerType = 80, HierarchicalColumnViewType = 85, HierarchicalViewType = 90, LabelType = 100,
  ListViewType = 110, PopupMenuType = 120, RadioButtonType = 130, SliderType = 140,
  StepperType = 150, TextFieldType = 160, TextViewType = 170, WebViewType = 180
}
 Supported widget types.
 
typedef std::auto_ptr< ImageIDsImageIDsAP
 

Public Member Functions

 HierarchicalColumnView ()
 Constructs an empty HierarchicalColumnView object. More...
 
 HierarchicalColumnView (const HierarchicalColumnView &hcView_)
 Constructs a new HierarchicalColumnView object from an existing HierarchicalColumnView object (copy constructor) More...
 
 HierarchicalColumnView (const Rect &frame_, const uint16_t numCols_)
 Constructs a hierarchical column view with a frame only, no contents. More...
 
 HierarchicalColumnView (const Rect &frame_, const ColumnNameVector &colNames_)
 Constructs a hierarchical column view with a frame only, no contents. More...
 
 HierarchicalColumnView (const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const IndexVector &indexPath_)
 Constructs a hierarchical column view. More...
 
 HierarchicalColumnView (const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const IndexVector &indexPath_)
 Constructs a hierarchical column view. More...
 
 HierarchicalColumnView (const Rect &frame_, const uint16_t numCols_, const EntryVector &entries_, const IDVector &idPath_)
 Constructor for a hierarchical column view with an initial ID selected. More...
 
 HierarchicalColumnView (const Rect &frame_, const ColumnNameVector &colNames_, const EntryVector &entries_, const IDVector &idPath_)
 Constructor for a hierarchical column view with an initial ID selected. More...
 
virtual HierarchicalColumnViewoperator= (const HierarchicalColumnView &rhs_)
 Allows one HierarchicalColumnView object to be assigned from another. More...
 
virtual ~HierarchicalColumnView ()
 HierarchicalColumnView destructor. More...
 
virtual HierarchicalColumnViewclone () const
 Convenience method to clone a HierarchicalColumnView object on the heap. More...
 
virtual HierarchicalColumnViewduplicate () const
 Convenience method to duplicate a HierarchicalColumnView object, creating a new and identical UI element to the target (but not belonging to the same containing window) More...
 
virtual void deselectAll ()
 Deselects all currently selected entries in the list. More...
 
virtual std::string text () const
 Gets the current text value of the list. More...
 
virtual void setText (const std::string &)
 Does nothing. More...
 
virtual IndexVector currentIndexPath () const
 Gets the index path of the currently selected entry. More...
 
virtual bool setCurrentIndexPath (const IndexVector &indexPath_)
 Sets the currently selected entry by index path. More...
 
virtual IDVector currentIDPath () const
 Gets the ID path of the currently selected entry. More...
 
virtual bool setCurrentIDPath (const IDVector &idPath_)
 Sets the currently selected entry by ID path. More...
 
virtual std::auto_ptr< TreeColumnEntrycurrentEntry () const
 Gets the current entry object. More...
 
virtual const std::vector< TreeColumnEntry * > *const entries () const
 Gets the entries vector. More...
 
virtual bool hasEntry (const IDVector &idPath_) const
 Gets whether the entries vector already contains an entry, based on its ID path. More...
 
virtual void setEntries (const EntryVector &entries_)
 Allows the entries in a hierarchical column view to be changed out entirely. More...
 
virtual void clearEntries ()
 Clears all entries contained by the widget. More...
 
virtual bool hasHeader () const
 Gets whether the widget has a header component to show the names of the columns. More...
 
virtual uint16_t columnCount () const
 Gets the number of columns in the widget. More...
 
virtual ColumnNameVector columnNames () const
 Gets the column names vector. More...
 
virtual ColumnWidthVector columnWidths () const
 Gets the widths of each column in the view. More...
 
virtual void setColumnWidths (const ColumnWidthVector &widths_)
 Sets the widths of each column in the view. More...
 
virtual bool columnWidthsLocked () const
 Gets whether the column widths are locked (i.e. the user cannot change them) More...
 
virtual void setColumnWidthsLocked (const bool locked_)
 Sets whether the column widths are locked (i.e. the user cannot change them) More...
 
virtual uint16_t outlineColumnIndex () const
 Gets which column is the outline column (shows disclosure triangles) More...
 
virtual void setOutlineColumnIndex (const uint16_t oc_)
 Sets which column is the outline column (shows disclosure triangles) More...
 
virtual bool outlineColumnExpands () const
 Gets whether the outline column automatically expands in width when its children are shown. More...
 
virtual void setOutlineColumnExpands (const bool exp_)
 Sets whether the outline column automatically expands in width when its children are shown. More...
 
virtual void valueChanged ()
 Simulates the hierarchical column view having its value changed. More...
 
virtual Callback *const valueChangedCallback () const
 Gets the value changed callback for the hierarchical column view. More...
 
virtual void setValueChangedCallback (const Callback &callback_)
 Sets the value changed callback. More...
 
virtual void update ()
 Force the hierarchical column view to update its entries. More...
 
virtual Callback *const imageClickCallback () const
 Gets the callback set for when an image entry is clicked. More...
 
virtual void setImageClickCallback (const Callback &callback_)
 Sets/updates the callback for when an image entry is clicked. More...
 
virtual std::auto_ptr< TreeColumnEntryclickedImageEntry () const
 Gets the image entry that was last clicked. More...
 
virtual int32_t clickedImageColumnIndex () const
 Gets the column index of the image in the entry that was last clicked. More...
 
virtual Callback *const expansionCallback () const
 Gets the callback set for when an entry is expanded/collapsed. More...
 
virtual void setExpansionCallback (const Callback &callback_)
 Sets/updates the callback for when an entry is expanded/collapsed. More...
 
virtual std::auto_ptr< TreeColumnEntryexpansionEntry () const
 Gets the entry that was last expanded/collapsed. More...
 
- Public Member Functions inherited from hdi::core::Widget
(virtual) - ~Widget
 Destructs a Widget. More...
 
(virtual PlatformWidgetPtr) - platformWidget
 Gets the platform-specific widget, around which the target object is wrapped. More...
 
(virtual bool) - isEmpty
 Gets whether the target Widget object is empty (constructed with the default ctor) More...
 
(virtual bool) - operator==
 Tests whether a given Widget object is the same as another. More...
 
(virtual bool) - operator!=
 Tests whether a given Widget object is not the same as another. More...
 
(virtual Type- type
 Gets the type of the widget. More...
 
(virtual Window *const) - window
 Gets the parent window of the widget. More...
 
(virtual Rect- frame
 Gets the widget frame. More...
 
(virtual void) - setFrame
 Sets the widget frame. More...
 
(virtual void) - offset
 Offsets the widget from its current location by the given amounts. More...
 
(virtual bool) - enabled
 Gets whether the widget is enabled. More...
 
(virtual void) - setEnabled
 Enables or disables the widget. More...
 
(virtual bool) - visible
 Gets whether the widget is visible. More...
 
(virtual void) - setVisible
 Shows or hides the widget. More...
 
(virtual void) - setOrigin
 Convenience method to set just the origin of the target widget's frame. More...
 
(virtual void) - setSize
 Convenience method to set just the size of the target widget's frame. More...
 
(virtual void) - setWidth
 Convenience method to set just the width of the target widget's frame. More...
 
(virtual void) - setHeight
 Convenience method to set just the height of the target widget's frame. More...
 
(virtual bool) - hasFocus
 Gets whether the widget currently has focus. More...
 
(virtual void) - focus
 Forces the widget to have focus, taking it from any other focused widget of the same window. More...
 
(virtual void) - blur
 Removes focus from the widget. More...
 
(virtual std::string) - tooltip
 Gets the tool tip string for the widget. More...
 
(virtual void) - setTooltip
 Sets the tool tip string for the widget. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from hdi::core::Widget
(static bool) + isCoreWidget
 Gets whether the given platform widget is a hdi_core widget. More...
 
(static std::auto_ptr< Widget >) + lastClickedWidget
 Gets the last widget that received a click event (either by the user or programmatically) More...
 
(static std::auto_ptr< Widget >) + lastValueChangingWidget
 Gets the last widget that received a value changing event (either by the user or programmatically) More...
 
(static std::auto_ptr< Widget >) + lastValueChangedWidget
 Gets the last widget that received a value changed event (either by the user or programmatically) More...
 
(static bool) + forceIdeographicFontSize
 Gets whether widgets should use an ideographically appropriate font size for widget text on Windows (whether or not the Illustrator locale dictates one should be used) More...
 
(static void) + setForceIdeographicFontSize
 Sets whether widgets should use an ideographically appropriate font size for widget text on Windows (whether or not the Illustrator locale dictates one should be used) More...
 
- Protected Member Functions inherited from hdi::core::Widget
(void *) - _impl
 Internal use only. More...
 
() - Widget
 Constructs an empty Widget object. More...
 
() - Widget
 Constructs a new Widget object from an existing Widget object (copy constructor) More...
 
() - Widget
 Internal use only. More...
 
(virtual Widget &) - operator=
 Internal use only. More...
 
- Protected Attributes inherited from hdi::core::Widget
void * _data
 Private implementation data.
 

Detailed Description

Hierarchical column view widget, much like a list view but allowing for entries with multiple columns presented in a hierarchical fashion.

Constructor & Destructor Documentation

hdi::core::HierarchicalColumnView::HierarchicalColumnView ( )

Constructs an empty HierarchicalColumnView object.

Author
GW
Date
01/2015
Note
To test if a HierarchicalColumnView object is empty, call isEmpty (hdi::core::Widget) on it
Empty HierarchicalColumnView objects do not relate to any actual UI widget; they are designed to be "receivers" of some other HierarchicalColumnView object via the overloaded assignment operator. Empty HierarchicalColumnView objects are useless until such time (though it is safe to call any of their methods).
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const HierarchicalColumnView hcView_)

Constructs a new HierarchicalColumnView object from an existing HierarchicalColumnView object (copy constructor)

Author
GW
Date
01/2015
Parameters
hcView_Existing HierarchicalColumnView object
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const uint16_t  numCols_ 
)

Constructs a hierarchical column view with a frame only, no contents.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
numCols_The number of columns in the list
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const ColumnNameVector &  colNames_ 
)

Constructs a hierarchical column view with a frame only, no contents.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
colNames_Names of each of the columns - also controls the number of columns in the list
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const uint16_t  numCols_,
const EntryVector &  entries_,
const IndexVector &  indexPath_ 
)

Constructs a hierarchical column view.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
numCols_The number of columns in the list
entries_Vector of entries
indexPath_Initial index path to select (must exist in entries_, or be an empty vector)
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const ColumnNameVector &  colNames_,
const EntryVector &  entries_,
const IndexVector &  indexPath_ 
)

Constructs a hierarchical column view.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
colNames_Names of each of the columns - also controls the number of columns in the list
entries_Vector of entries
indexPath_Initial index path to select (must exist in entries_, or be an empty vector)
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const uint16_t  numCols_,
const EntryVector &  entries_,
const IDVector &  idPath_ 
)

Constructor for a hierarchical column view with an initial ID selected.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
numCols_The number of columns in the list
entries_Vector of entries
idPath_Initial ID path to select, as UTF-8 (must exist in entries_, or be an empty vector)
hdi::core::HierarchicalColumnView::HierarchicalColumnView ( const Rect frame_,
const ColumnNameVector &  colNames_,
const EntryVector &  entries_,
const IDVector &  idPath_ 
)

Constructor for a hierarchical column view with an initial ID selected.

Author
GW
Date
01/2015
Parameters
frame_Position and size of the list
colNames_Names of each of the columns - also controls the number of columns in the list
entries_Vector of entries
idPath_Initial ID path to select, as UTF-8 (must exist in entries_, or be an empty vector)
virtual hdi::core::HierarchicalColumnView::~HierarchicalColumnView ( )
virtual

HierarchicalColumnView destructor.

Author
GW
Date
01/2015

Member Function Documentation

virtual void hdi::core::HierarchicalColumnView::clearEntries ( )
virtual

Clears all entries contained by the widget.

Author
GW
Date
01/2015
virtual int32_t hdi::core::HierarchicalColumnView::clickedImageColumnIndex ( ) const
virtual

Gets the column index of the image in the entry that was last clicked.

Author
GW
Date
01/2015
Returns
The column index of the clicked image, or -1 for none/error
Note
The return value of this method is only guaranteed to be valid during the execution of the "image click" callback.
virtual std::auto_ptr<TreeColumnEntry> hdi::core::HierarchicalColumnView::clickedImageEntry ( ) const
virtual

Gets the image entry that was last clicked.

Author
GW
Date
01/2015
Returns
The clicked entry object
Note
The return value of this method is only guaranteed to be valid during the execution of the "image click" callback.
virtual HierarchicalColumnView* hdi::core::HierarchicalColumnView::clone ( ) const
virtual

Convenience method to clone a HierarchicalColumnView object on the heap.

Author
GW
Date
01/2015
Returns
A pointer to the new HierarchicalColumnView object
Note
If you subclass HierarchicalColumnView, you MUST overload this method yourself! If you don't and/or your clone() method does not return an instance of your HierarchicalColumnView subclass, you will experience "object slicing" when adding the widget to a window.
Warning
The caller must manage the memory for the returned HierarchicalColumnView object.

Implements hdi::core::Widget.

virtual uint16_t hdi::core::HierarchicalColumnView::columnCount ( ) const
virtual

Gets the number of columns in the widget.

Author
GW
Date
02/2015
Returns
The column count for the target widget, as defined when the widget was created
virtual ColumnNameVector hdi::core::HierarchicalColumnView::columnNames ( ) const
virtual

Gets the column names vector.

Author
GW
Date
12/2014
Returns
The column names vector for the target widget, containing all column names as defined when the widget was created
Note
If the hasHeader() method returns false, this method will return an empty vector.
virtual ColumnWidthVector hdi::core::HierarchicalColumnView::columnWidths ( ) const
virtual

Gets the widths of each column in the view.

Author
GW
Date
01/2015
Returns
A vector populated with the pixels widths of each column
virtual bool hdi::core::HierarchicalColumnView::columnWidthsLocked ( ) const
virtual

Gets whether the column widths are locked (i.e. the user cannot change them)

Author
GW
Date
02/2015
Returns
true for locked widths, false otherwise
virtual std::auto_ptr<TreeColumnEntry> hdi::core::HierarchicalColumnView::currentEntry ( ) const
virtual

Gets the current entry object.

Author
GW
Date
01/2015
Returns
The TreeColumnEntry object for the currently selected item
virtual IDVector hdi::core::HierarchicalColumnView::currentIDPath ( ) const
virtual

Gets the ID path of the currently selected entry.

Author
GW
Date
01/2015
Returns
UTF-8 ID path of the currently selected entry, or empty if no entry is currently selected
virtual IndexVector hdi::core::HierarchicalColumnView::currentIndexPath ( ) const
virtual

Gets the index path of the currently selected entry.

Author
GW
Date
01/2015
Returns
The index path of the currently selected entry, or empty if no entry is selected
virtual void hdi::core::HierarchicalColumnView::deselectAll ( )
virtual

Deselects all currently selected entries in the list.

Author
GW
Date
01/2015
virtual HierarchicalColumnView* hdi::core::HierarchicalColumnView::duplicate ( ) const
virtual

Convenience method to duplicate a HierarchicalColumnView object, creating a new and identical UI element to the target (but not belonging to the same containing window)

Author
GW
Date
01/2015
Returns
A pointer to the new HierarchicalColumnView object (and new UI element)
Note
The new hierarchical column view will have copies of all entries present in the target, but be aware that copies of the user data in each entry cannot be made (because they are simply void* variables). As such, the user data in the copies will simply be set to NULL by this method.
Warning
The caller must manage the memory for the returned HierarchicalColumnView object.

Implements hdi::core::Widget.

virtual const std::vector< TreeColumnEntry* >* const hdi::core::HierarchicalColumnView::entries ( ) const
virtual

Gets the entries vector.

Author
GW
Date
01/2015
Returns
The entries vector for the target widget, containing all currently known entries
Note
Modifying any value in an entry will not cause the widget to update automatically; call update() to update the UI for changes made to entry data.
virtual Callback* const hdi::core::HierarchicalColumnView::expansionCallback ( ) const
virtual

Gets the callback set for when an entry is expanded/collapsed.

Author
GW
Date
11/2015
Returns
A pointer to the currently registered expansion callback
virtual std::auto_ptr<TreeColumnEntry> hdi::core::HierarchicalColumnView::expansionEntry ( ) const
virtual

Gets the entry that was last expanded/collapsed.

Author
GW
Date
11/2015
Returns
The expanded entry object
Note
The return value of this method is only guaranteed to be valid during the execution of the expansion callback.
virtual bool hdi::core::HierarchicalColumnView::hasEntry ( const IDVector &  idPath_) const
virtual

Gets whether the entries vector already contains an entry, based on its ID path.

Author
GW
Date
09/2014
Parameters
idPath_ID path of the entry to search for, as UTF-8
Returns
true if the widget already contains an entry with the given ID path, false otherwise
virtual bool hdi::core::HierarchicalColumnView::hasHeader ( ) const
virtual

Gets whether the widget has a header component to show the names of the columns.

Author
GW
Date
02/2015
Returns
true if the widget was constructed with a header, false otherwise
virtual Callback* const hdi::core::HierarchicalColumnView::imageClickCallback ( ) const
virtual

Gets the callback set for when an image entry is clicked.

Author
GW
Date
02/2015
Returns
A pointer to the currently registered "image click" callback
virtual HierarchicalColumnView& hdi::core::HierarchicalColumnView::operator= ( const HierarchicalColumnView rhs_)
virtual

Allows one HierarchicalColumnView object to be assigned from another.

Author
GW
Date
01/2015
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target HierarchicalColumnView object, but with its value updated to match that of rhs_
virtual bool hdi::core::HierarchicalColumnView::outlineColumnExpands ( ) const
virtual

Gets whether the outline column automatically expands in width when its children are shown.

Author
GW
Date
03/2015
Returns
true if the outline column expands in width, false otherwise
Note
This method is only useful on Mac (the outline column does not expand at all on Windows).
virtual uint16_t hdi::core::HierarchicalColumnView::outlineColumnIndex ( ) const
virtual

Gets which column is the outline column (shows disclosure triangles)

Author
GW
Date
03/2015
Returns
The index of the outline column
Note
This method is only useful on Mac (the outline column cannot be changed on Windows).
virtual void hdi::core::HierarchicalColumnView::setColumnWidths ( const ColumnWidthVector &  widths_)
virtual

Sets the widths of each column in the view.

Author
GW
Date
01/2015
Parameters
widths_Vector of new column widths to set
virtual void hdi::core::HierarchicalColumnView::setColumnWidthsLocked ( const bool  locked_)
virtual

Sets whether the column widths are locked (i.e. the user cannot change them)

Author
GW
Date
02/2015
Parameters
locked_true to lock widths, false otherwise
virtual bool hdi::core::HierarchicalColumnView::setCurrentIDPath ( const IDVector &  idPath_)
virtual

Sets the currently selected entry by ID path.

Author
GW
Date
01/2015
Parameters
idPath_ID path of new value to select in the hierarchical column view, as UTF-8
Returns
true if the entry with the given ID path was selected, or false if invalid
virtual bool hdi::core::HierarchicalColumnView::setCurrentIndexPath ( const IndexVector &  indexPath_)
virtual

Sets the currently selected entry by index path.

Author
GW
Date
01/2015
Parameters
indexPath_New index path to select
Returns
true if the selection occurred successfully, or false if e.g. out of range
virtual void hdi::core::HierarchicalColumnView::setEntries ( const EntryVector &  entries_)
virtual

Allows the entries in a hierarchical column view to be changed out entirely.

Author
GW
Date
01/2015
Parameters
entries_New set of entries that the widget will contain
virtual void hdi::core::HierarchicalColumnView::setExpansionCallback ( const Callback callback_)
virtual

Sets/updates the callback for when an entry is expanded/collapsed.

Author
GW
Date
11/2015
Parameters
callback_New callback for a user expanding/collapsing an entry
Note
When your callback is executed, you can determine which entry was expanded/collapsed by calling the expansionEntry() method.
virtual void hdi::core::HierarchicalColumnView::setImageClickCallback ( const Callback callback_)
virtual

Sets/updates the callback for when an image entry is clicked.

Author
GW
Date
01/2015
Parameters
callback_New callback for a user clicking an image entry
Note
When your callback is executed, you can determine which entry was clicked by calling the clickedEntry() method and which column by calling the clickedColumnIndex() method.
virtual void hdi::core::HierarchicalColumnView::setOutlineColumnExpands ( const bool  exp_)
virtual

Sets whether the outline column automatically expands in width when its children are shown.

Author
GW
Date
03/2015
Parameters
exp_true if the outline column should expand in width, false otherwise
Note
This method is only useful on Mac (the outline column does not expand at all on Windows).
virtual void hdi::core::HierarchicalColumnView::setOutlineColumnIndex ( const uint16_t  oc_)
virtual

Sets which column is the outline column (shows disclosure triangles)

Author
GW
Date
03/2015
Parameters
oc_New outline column index
Note
This method is only useful on Mac (the outline column cannot be changed on Windows).
virtual void hdi::core::HierarchicalColumnView::setText ( const std::string &  )
virtual

Does nothing.

Author
GW
Date
01/2015
Note
Since a HierarchicalColumnView inherently stores multiple text values per row, setting the text value has potentially no meaning or an ambiguous meaning. Therefore, this method performs no action.

Reimplemented from hdi::core::Widget.

virtual void hdi::core::HierarchicalColumnView::setValueChangedCallback ( const Callback callback_)
virtual

Sets the value changed callback.

Author
GW
Date
01/2015
Parameters
callback_New callback for when the hierarchical column view's value has changed
virtual std::string hdi::core::HierarchicalColumnView::text ( ) const
virtual

Gets the current text value of the list.

Author
GW
Date
01/2015
Returns
"", as a multi-column list has no specific text value

Reimplemented from hdi::core::Widget.

virtual void hdi::core::HierarchicalColumnView::update ( )
virtual

Force the hierarchical column view to update its entries.

Author
GW
Date
01/2015

Reimplemented from hdi::core::Widget.

virtual void hdi::core::HierarchicalColumnView::valueChanged ( )
virtual

Simulates the hierarchical column view having its value changed.

Author
GW
Date
01/2015
virtual Callback* const hdi::core::HierarchicalColumnView::valueChangedCallback ( ) const
virtual

Gets the value changed callback for the hierarchical column view.

Author
GW
Date
01/2015
Returns
A pointer to the currently registered value changed callback