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

Flyout menu, which can be added to a Panel for additional options. More...

#include <hdicoreFlyout.h>

Public Types

typedef std::vector< ListEntryEntryVector
 

Public Member Functions

 Flyout ()
 Constructs an empty Flyout menu, to which entries may be added later. More...
 
 Flyout (const Flyout &fo_)
 Constructs a new Flyout object from an existing Flyout object (copy constructor) More...
 
 Flyout (const EntryVector &entries_)
 Constructs a Flyout menu with a list of entries. More...
 
virtual ~Flyout ()
 Flyout destructor. More...
 
virtual Flyoutoperator= (const Flyout &rhs_)
 Overloaded assigment operator to copy one Flyout object's values to another. More...
 
virtual int32_t currentIndex () const
 Gets the index of the currently selected entry. More...
 
virtual std::string currentID () const
 Gets the ID of the currently selected entry. More...
 
virtual std::string currentValue () const
 Gets the string value of the currently selected entry. More...
 
virtual std::auto_ptr< ListEntrycurrentEntry () const
 Gets the current entry object. More...
 
virtual bool currentUserData (void *&data__) const
 Gets the user data for the current entry. More...
 
virtual const std::vector< ListEntry * > *const entries () const
 Gets the entries vector. More...
 
virtual void setEntries (const EntryVector &entries_)
 Allows the entries in an flyout menu to be changed out entirely. More...
 
virtual bool hasEntry (const std::string &id_) const
 Gets whether the entries vector already contains an entry, based on its ID. More...
 
virtual bool pushEntry (const ListEntry &entry_)
 Pushes an entry onto the list (i.e. at the end) More...
 
virtual bool popEntry (ListEntry &entry__)
 Pops an entry off the list (i.e. from the end) More...
 
virtual bool insertEntry (const std::string &id_, const ListEntry &entry_)
 Inserts an entry into the list of entries at a given position. More...
 
virtual bool removeEntry (const std::string &id_, ListEntry &entry__)
 Removes a specific entry from the list of entries. More...
 
virtual void clearEntries ()
 Clears all entries contained by the flyout. More...
 
virtual Panel *const panel () const
 Gets the parent panel of the flyout. More...
 
virtual void selectionMade ()
 Simulates the flyout menu having one of its entries selected. More...
 
virtual Callback *const selectionMadeCallback () const
 Gets the flyout entry selection callback. More...
 
virtual void setSelectionMadeCallback (const Callback &callback_)
 Sets the flyout entry selection callback. More...
 
virtual Callback *const showingCallback () const
 Gets the showing callback for the flyout menu. More...
 
virtual void setShowingCallback (const Callback &callback_)
 Sets the showing callback for the flyout menu. More...
 
virtual bool entryChecked (const int32_t index_)
 Gets whether the specified flyout entry is checked. More...
 
virtual bool checkEntry (const int32_t index_, const bool check_)
 Sets whether the specified flyout entry is checked. More...
 
virtual bool entryChecked (const std::string &id_)
 Gets whether the specified flyout entry is checked. More...
 
virtual bool checkEntry (const std::string &id_, const bool check_)
 Sets whether the specified flyout entry is checked. More...
 
virtual void update ()
 Forces the flyout menu to update its entries. More...
 

Friends

class Panel
 
plugin::PopupMenu * __accessImpl (const Flyout &)
 

Detailed Description

Flyout menu, which can be added to a Panel for additional options.

Constructor & Destructor Documentation

hdi::core::Flyout::Flyout ( )

Constructs an empty Flyout menu, to which entries may be added later.

Author
GW
Date
09/2013
hdi::core::Flyout::Flyout ( const Flyout fo_)

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

Author
GW
Date
09/2013
Parameters
fo_Existing Flyout object
hdi::core::Flyout::Flyout ( const EntryVector &  entries_)

Constructs a Flyout menu with a list of entries.

Author
GW
Date
09/2013
Parameters
entries_Vector of string entries, whose order in the flyout will match the vector
virtual hdi::core::Flyout::~Flyout ( )
virtual

Flyout destructor.

Author
GW
Date
09/2013

Member Function Documentation

virtual bool hdi::core::Flyout::checkEntry ( const int32_t  index_,
const bool  check_ 
)
virtual

Sets whether the specified flyout entry is checked.

Author
GW
Date
03/2014
Parameters
index_The index number of the entry in question
check_true to check the entry, false to uncheck
Returns
true if the entry's checkmark state is set, false otherwise
virtual bool hdi::core::Flyout::checkEntry ( const std::string &  id_,
const bool  check_ 
)
virtual

Sets whether the specified flyout entry is checked.

Author
GW
Date
03/2014
Parameters
id_ID string of the entry in question, as UTF-8
check_true to check the entry, false to uncheck
Returns
true if the entry's checkmark state is set, false otherwise
virtual void hdi::core::Flyout::clearEntries ( )
virtual

Clears all entries contained by the flyout.

Author
GW
Date
09/2013
virtual std::auto_ptr<ListEntry> hdi::core::Flyout::currentEntry ( ) const
virtual

Gets the current entry object.

Author
GW
Date
09/2013
Returns
The ListEntry object for the currently selected item
virtual std::string hdi::core::Flyout::currentID ( ) const
virtual

Gets the ID of the currently selected entry.

Author
GW
Date
09/2013
Returns
UTF-8 ID string of the currently selected entry, or "" if no entry is currently selected
virtual int32_t hdi::core::Flyout::currentIndex ( ) const
virtual

Gets the index of the currently selected entry.

Author
GW
Date
09/2013
Returns
The index number of the currently selected entry, or -1 if no entry is selected
virtual bool hdi::core::Flyout::currentUserData ( void *&  data__) const
virtual

Gets the user data for the current entry.

Author
GW
Date
09/2013
Parameters
data__Return-by-reference for the current user data; ignore if false is returned
Returns
true if the method succeeds in acquiring the contained entry data, false otherwise
virtual std::string hdi::core::Flyout::currentValue ( ) const
virtual

Gets the string value of the currently selected entry.

Author
GW
Date
09/2013
Returns
Value string of the flyout menu, as UTF-8
virtual const std::vector< ListEntry* >* const hdi::core::Flyout::entries ( ) const
virtual

Gets the entries vector.

Author
GW
Date
09/2013
Returns
The entries vector for the target flyout, containing all currently known entries
Note
Modifying any value in an entry will not cause the menu to update automatically; call setEntries() to update changes to entry data, or call update() to update the UI for changes made to entry string values.
virtual bool hdi::core::Flyout::entryChecked ( const int32_t  index_)
virtual

Gets whether the specified flyout entry is checked.

Author
GW
Date
03/2014
Parameters
index_The index number of the entry in question
Returns
true if the entry is checked, false otherwise
virtual bool hdi::core::Flyout::entryChecked ( const std::string &  id_)
virtual

Gets whether the specified flyout entry is checked.

Author
GW
Date
03/2014
Parameters
id_ID string of the entry in question, as UTF-8
Returns
true if the entry is checked, false otherwise
virtual bool hdi::core::Flyout::hasEntry ( const std::string &  id_) const
virtual

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

Author
GW
Date
09/2013
Parameters
id_ID of the entry to search for, as UTF-8
Returns
true if the menu already contains an entry with the given ID, false otherwise
virtual bool hdi::core::Flyout::insertEntry ( const std::string &  id_,
const ListEntry entry_ 
)
virtual

Inserts an entry into the list of entries at a given position.

Author
GW
Date
09/2013
Parameters
id_Existing entry immediately before the position at which the new entry will be inserted, as UTF-8
entry_New entry object to insert into the list of entries
Returns
true if the entry is inserted successfully, false otherwise
Note
If the entry for id_ doesn't exist in the list, the new entry will not be inserted.
If the passed entry is already present in the list (based on its ID), it will not be inserted.
virtual Flyout& hdi::core::Flyout::operator= ( const Flyout rhs_)
virtual

Overloaded assigment operator to copy one Flyout object's values to another.

Author
GW
Date
12/2014
Parameters
rhs_Righthand side of the assignment operator
Returns
The lefthand side of the assignment operator, but with values updated to match that of the rhs_ parameter
virtual Panel* const hdi::core::Flyout::panel ( ) const
virtual

Gets the parent panel of the flyout.

Author
GW
Date
09/2013
Returns
Parent panel object pointer (NULL if the flyout hasn't been added to one yet)
virtual bool hdi::core::Flyout::popEntry ( ListEntry entry__)
virtual

Pops an entry off the list (i.e. from the end)

Author
GW
Date
09/2013
Parameters
entry__Return-by-reference for the popped entry, so the caller can inspect which one was removed
Returns
true if an entry was popped and acquired, false otherwise
virtual bool hdi::core::Flyout::pushEntry ( const ListEntry entry_)
virtual

Pushes an entry onto the list (i.e. at the end)

Author
GW
Date
09/2013
Parameters
entry_New entry object to insert into the list of entries
Returns
true if the entry is pushed successfully, false otherwise
Note
If the entry is already present in the list (based on its ID), it will not be inserted.
virtual bool hdi::core::Flyout::removeEntry ( const std::string &  id_,
ListEntry entry__ 
)
virtual

Removes a specific entry from the list of entries.

Author
GW
Date
09/2013
Parameters
id_ID of the entry to be removed, as UTF-8
entry__Return-by-reference for the removed entry, so the caller can inspect which one was removed
Returns
true if an entry was removed and acquired, false otherwise
virtual void hdi::core::Flyout::selectionMade ( )
virtual

Simulates the flyout menu having one of its entries selected.

Author
GW
Date
09/2013
Note
When the callback (registered with the setSelectionMadeCallback() method) is called, you can determine what entry was selected by using any of the current*() methods (e.g. currentID(), currentEntry(), etc.)
virtual Callback* const hdi::core::Flyout::selectionMadeCallback ( ) const
virtual

Gets the flyout entry selection callback.

Author
GW
Date
09/2013
Returns
A pointer to the currently registered selection callback
virtual void hdi::core::Flyout::setEntries ( const EntryVector &  entries_)
virtual

Allows the entries in an flyout menu to be changed out entirely.

Author
GW
Date
09/2013
Parameters
entries_New set of entries that the menu will contain
virtual void hdi::core::Flyout::setSelectionMadeCallback ( const Callback callback_)
virtual

Sets the flyout entry selection callback.

Author
GW
Date
09/2013
Parameters
callback_New callback for when a flyout menu entry is selected
virtual void hdi::core::Flyout::setShowingCallback ( const Callback callback_)
virtual

Sets the showing callback for the flyout menu.

Author
GW
Date
04/2015
Parameters
callback_New callback for when a the flyout is about to be shown
Precondition
The flyout must already be set on its associated panel for this method to function.
virtual Callback* const hdi::core::Flyout::showingCallback ( ) const
virtual

Gets the showing callback for the flyout menu.

Author
GW
Date
04/2015
Returns
A pointer to the currently registered flyout-about-to-show callback
virtual void hdi::core::Flyout::update ( )
virtual

Forces the flyout menu to update its entries.

Author
GW
Date
04/2015
Precondition
The flyout must already be set on its associated panel for this method to function.