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

Allows for easy UID acquisition, art access, etc. More...

#include <hdicoreUID.h>

Public Member Functions

 UID ()
 Creates an empty UID object. More...
 
 UID (const UID &u_)
 UID copy constructor. More...
 
 UID (const std::string &name_)
 Constructs a new UID object from a UID name. More...
 
 UID (const AIUIDRef aiUID_)
 Constructs a new UID object from an AIUIDRef. More...
 
virtual ~UID ()
 Destructs a UID object. More...
 
virtual UIDoperator= (const UID &rhs_)
 Overloaded assignment operator for UID objects. More...
 
virtual bool operator== (const UID &rhs_) const
 Tests whether a given UID object is the same as another. More...
 
virtual bool operator!= (const UID &rhs_) const
 Tests whether a given UID object is not the same as another. More...
 
virtual AIUIDRef aiUIDRef () const
 Gets the UID ref around which the target object is wrapped. More...
 
virtual bool isEmpty () const
 Gets whether the target UID object is empty (constructed with the default ctor) More...
 
virtual std::auto_ptr< Artart () const
 Gets an Art object for the target UID. More...
 
virtual std::string name () const
 Gets the unique name of the target UID object. More...
 
void setName (const std::string &name_)
 Sets the name of the target UID object. More...
 

Friends

plugin::UID * __accessImpl (const UID &)
 
UID __accessCtor (const plugin::UID &)
 

Detailed Description

Allows for easy UID acquisition, art access, etc.

Note
Be aware that even though Adobe advertises UIDs as uniquely identifying a piece of art, they can change and become invalid at times [e.g. if the user moves a piece of art])

Constructor & Destructor Documentation

hdi::core::UID::UID ( )

Creates an empty UID object.

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

UID copy constructor.

Author
GW
Date
08/2013
Parameters
u_UID object to copy values from
hdi::core::UID::UID ( const std::string &  name_)

Constructs a new UID object from a UID name.

Author
GW
Date
09/2016
Parameters
name_Unique UID name (see name() method in this class)
hdi::core::UID::UID ( const AIUIDRef  aiUID_)

Constructs a new UID object from an AIUIDRef.

Author
GW
Date
08/2015
Parameters
aiUID_Raw Illustrator AIUIDRef
virtual hdi::core::UID::~UID ( )
virtual

Destructs a UID object.

Author
GW
Date
08/2013

Member Function Documentation

virtual AIUIDRef hdi::core::UID::aiUIDRef ( ) const
virtual

Gets the UID ref around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIUIDRef for the target object
Note
The caller should not release the returned AIUIDRef (its reference count is not increased before being returned).
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 std::auto_ptr<Art> hdi::core::UID::art ( ) const
virtual

Gets an Art object for the target UID.

Author
GW
Date
08/2013
Returns
The Art object for the target UID object, or NULL for none
virtual bool hdi::core::UID::isEmpty ( ) const
virtual

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

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

Gets the unique name of the target UID object.

Author
GW
Date
08/2013
Returns
A string for the name/identifier of the UID object, as UTF-8
virtual bool hdi::core::UID::operator!= ( const UID rhs_) const
virtual

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

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

Overloaded assignment operator for UID objects.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the assignment operator; UID object to copy values from
Returns
The lefthand side of the assignment operator, but with its values updated
virtual bool hdi::core::UID::operator== ( const UID rhs_) const
virtual

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

Author
GW
Date
08/2013
Parameters
rhs_UID to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same UID, false otherwise
void hdi::core::UID::setName ( const std::string &  name_)

Sets the name of the target UID object.

Author
GW
Date
01/2014
Parameters
name_Desired name for the UID object, as UTF-8
Note
You can pass in any name (aside from "") because the internal UID suite will make it unique for you. For example, if a piece of art is already named "Hello", then trying to name another piece of art "Hello" will simply cause it to be named something similar (e.g. "Hello_2_"). If the user has chosen to show art names as their XML ID value (configurable in the Illustrator preferences), then the first piece of art will show "Hello" and the second will show "Hello_2_". However, if the user changes the setting to show art display names, then they will both show "Hello" (but the second is still called "Hello_2_" internally by Illustrator). If you are curious how your name_ parameter has been transformed, then just call the name() method afterwards.