Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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.
 
 Annotator (const Annotator &a_)
 Constructs a new Annotator object from an existing Annotator object (copy constructor)
 
 Annotator (const std::string &name_, const Callback &responder_)
 Constructs an Annotator object, with a unique name and callback.
 
virtual ~Annotator ()
 Annotator destructor; deactivates the annotator and deletes the registered callback.
 
virtual Annotatoroperator= (const Annotator &rhs_)
 Assigns one Annotator object to another.
 
virtual bool operator== (const Annotator &rhs_) const
 Tests whether a given Annotator object is the same as another.
 
virtual bool operator!= (const Annotator &rhs_) const
 Tests whether a given Annotator object is not the same as another.
 
virtual bool isEmpty () const
 Gets whether the target Annotator object is empty (constructed with the default ctor)
 
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)
 
virtual AIAnnotatorHandle aiAnnotatorHandle () const
 Gets the annotator handle around which the target object is wrapped.
 
virtual std::string name () const
 Gets the annotator's unique name.
 
virtual bool active () const
 Gets whether the annotator is active.
 
virtual void setActive (const bool active_)
 Sets whether the annotator is active.
 
virtual void activate ()
 Activates (enables) the annotator.
 
virtual void deactivate ()
 Deactivates (disables) the annotator.
 
virtual Options options () const
 Gets the options that have been applied to the target annotator.
 
virtual void setOptions (const Options flags_)
 Sets the options for the target annotator.
 
virtual Callback *const callback () const
 Gets the registered drawing callback for the annotator.
 
virtual void setCallback (const Callback &cb_)
 Sets the callback for the annotator.
 

Friends

aip::Annotator * __accessImpl (const Annotator &)
 

Detailed Description

Deals with annotator registration and drawing callbacks.

Constructor & Destructor Documentation

◆ Annotator() [1/3]

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).

◆ Annotator() [2/3]

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

◆ Annotator() [3/3]

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

◆ ~Annotator()

virtual hdi::core::Annotator::~Annotator ( )
virtual

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

Author
GW
Date
08/2013

Member Function Documentation

◆ activate()

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

Activates (enables) the annotator.

Author
GW
Date
08/2013

◆ active()

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

◆ aiAnnotatorHandle()

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.

◆ callback()

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

◆ deactivate()

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

Deactivates (disables) the annotator.

Author
GW
Date
08/2013

◆ destroy()

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.

◆ isEmpty()

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

◆ name()

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

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

◆ options()

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

◆ setActive()

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

◆ setCallback()

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

◆ setOptions()

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