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

Deals with annotator registration and drawing callbacks. More...

#include <hdicoreAnnotator.h>

Public Types

enum  Options { DrawBeforeAllOthers = 1 << 0, DrawOnInactiveDocuments = 1 << 1, DontDrawOnInactiveViews = 1 << 2 }
 Options for how an annotator should behave.
 

Public Member Functions

 Annotator ()
 Constructs an empty Annotator object. More...
 
 Annotator (const Annotator &a_)
 Constructs a new Annotator object from an existing Annotator object (copy constructor) More...
 
 Annotator (const std::string &name_, const Callback &responder_)
 Constructs an Annotator object, with a unique name and callback. More...
 
virtual ~Annotator ()
 Annotator destructor; deactivates the annotator and deletes the registered callback. More...
 
virtual Annotatoroperator= (const Annotator &rhs_)
 Assigns one Annotator object to another. More...
 
virtual bool operator== (const Annotator &rhs_) const
 Tests whether a given Annotator object is the same as another. More...
 
virtual bool operator!= (const Annotator &rhs_) const
 Tests whether a given Annotator object is not the same as another. More...
 
virtual bool isEmpty () const
 Gets whether the target Annotator object is empty (constructed with the default ctor) More...
 
virtual void destroy ()
 Destroys the annotator, converting the target object to an empty Annotator object (see the default constructor for more info on empty Annotator objects) More...
 
virtual AIAnnotatorHandle aiAnnotatorHandle () const
 Gets the annotator handle around which the target object is wrapped. More...
 
virtual std::string name () const
 Gets the annotator's unique name. More...
 
virtual bool active () const
 Gets whether the annotator is active. More...
 
virtual void setActive (const bool active_)
 Sets whether the annotator is active. More...
 
virtual void activate ()
 Activates (enables) the annotator. More...
 
virtual void deactivate ()
 Deactivates (disables) the annotator. More...
 
virtual Options options () const
 Gets the options that have been applied to the target annotator. More...
 
virtual void setOptions (const Options flags_)
 Sets the options for the target annotator. More...
 
virtual Callback *const callback () const
 Gets the registered drawing callback for the annotator. More...
 
virtual void setCallback (const Callback &cb_)
 Sets the callback for the annotator. More...
 

Friends

plugin::Annotator * __accessImpl (const Annotator &)
 

Detailed Description

Deals with annotator registration and drawing callbacks.

Constructor & Destructor Documentation

hdi::core::Annotator::Annotator ( )

Constructs an empty Annotator object.

Author
GW
Date
08/2013
Note
To test if an Annotator object is empty, call isEmpty() on it
Empty Annotator objects do not relate to any Illustrator annotator; they are designed to be "receivers" of some other Annotator object via the overloaded assignment operator. Empty Annotator objects are useless until such time (though it is safe to call any of their methods).
hdi::core::Annotator::Annotator ( const Annotator a_)

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

Author
GW
Date
08/2013
Parameters
a_Existing Annotator object
hdi::core::Annotator::Annotator ( const std::string &  name_,
const Callback responder_ 
)

Constructs an Annotator object, with a unique name and callback.

Author
GW
Date
08/2013
Parameters
name_Unique string to identify the annotator, as UTF-8
responder_Callback to perform when notified by Illustrator that it's time to annotate
virtual hdi::core::Annotator::~Annotator ( )
virtual

Annotator destructor; deactivates the annotator and deletes the registered callback.

Author
GW
Date
08/2013

Member Function Documentation

virtual void hdi::core::Annotator::activate ( )
virtual

Activates (enables) the annotator.

Author
GW
Date
08/2013
virtual bool hdi::core::Annotator::active ( ) const
virtual

Gets whether the annotator is active.

Author
GW
Date
08/2013
Returns
true if the annotator is enabled, false otherwise
virtual AIAnnotatorHandle hdi::core::Annotator::aiAnnotatorHandle ( ) const
virtual

Gets the annotator handle around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIAnnotatorHandle for the target object
Note
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of functionality provided by Illustrator is not handled by this class (or related classes), then it should probably be added to the hdi_core library.
virtual Callback* const hdi::core::Annotator::callback ( ) const
virtual

Gets the registered drawing callback for the annotator.

Author
GW
Date
08/2013
Returns
Currently registered annotator callback
virtual void hdi::core::Annotator::deactivate ( )
virtual

Deactivates (disables) the annotator.

Author
GW
Date
08/2013
virtual void hdi::core::Annotator::destroy ( )
virtual

Destroys the annotator, converting the target object to an empty Annotator object (see the default constructor for more info on empty Annotator objects)

Author
GW
Date
03/2014
Precondition
If you have registered the annotator with Dispatcher::registerAnnotator(), then be sure to unregister the annotator before calling the destroy() method.
Note
This method must be called for any existing annotators by the time the plugin is shutting down. If you no longer retain any of your own references to an annotator then the lib will call this method for you as it is shutting down.
virtual bool hdi::core::Annotator::isEmpty ( ) const
virtual

Gets whether the target Annotator object is empty (constructed with the default ctor)

Author
GW
Date
08/2013
Returns
true if the target Annotator object is empty, false otherwise
virtual std::string hdi::core::Annotator::name ( ) const
virtual

Gets the annotator's unique name.

Author
GW
Date
08/2013
Returns
Name of the annotator, as UTF-8
virtual bool hdi::core::Annotator::operator!= ( const Annotator rhs_) const
virtual

Tests whether a given Annotator object is not the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Annotator to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different annotators, false otherwise
virtual Annotator& hdi::core::Annotator::operator= ( const Annotator rhs_)
virtual

Assigns one Annotator object to another.

Author
GW
Date
08/2013
Parameters
rhs_Existing Annotator object to copy values from
Returns
The target Annotator object, but with its values updated to match that of the rhs_ argument
virtual bool hdi::core::Annotator::operator== ( const Annotator rhs_) const
virtual

Tests whether a given Annotator object is the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Annotator to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same annotator, false otherwise
virtual Options hdi::core::Annotator::options ( ) const
virtual

Gets the options that have been applied to the target annotator.

Author
GW
Date
08/2013
Returns
Bitwise OR of options for this annotator
virtual void hdi::core::Annotator::setActive ( const bool  active_)
virtual

Sets whether the annotator is active.

Author
GW
Date
08/2013
Parameters
active_true to enable the annotator, false to disable
Note
This method simply calls activate() or deactivate() as appropriate
virtual void hdi::core::Annotator::setCallback ( const Callback cb_)
virtual

Sets the callback for the annotator.

Author
GW
Date
08/2013
Parameters
cb_New callback to be performed when the annotator needs to draw
virtual void hdi::core::Annotator::setOptions ( const Options  flags_)
virtual

Sets the options for the target annotator.

Author
GW
Date
08/2013
Parameters
flags_New bitwise OR of annotator options