Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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.
 
 UID (const UID &u_)
 UID copy constructor.
 
 UID (const std::string &name_)
 Constructs a new UID object from a UID name.
 
 UID (const AIUIDRef aiUID_)
 Constructs a new UID object from an AIUIDRef.
 
virtual ~UID ()
 Destructs a UID object.
 
virtual UIDoperator= (const UID &rhs_)
 Overloaded assignment operator for UID objects.
 
virtual bool operator== (const UID &rhs_) const
 Tests whether a given UID object is the same as another.
 
virtual bool operator!= (const UID &rhs_) const
 Tests whether a given UID object is not the same as another.
 
virtual AIUIDRef aiUIDRef () const
 Gets the UID ref around which the target object is wrapped.
 
virtual bool isEmpty () const
 Gets whether the target UID object is empty (constructed with the default ctor)
 
virtual std::unique_ptr< Artart () const
 Gets an Art object for the target UID.
 
virtual std::string name () const
 Gets the unique name of the target UID object.
 
void setName (const std::string &name_)
 Sets the name of the target UID object.
 

Friends

aip::UID * __accessImpl (const UID &)
 
UID __accessCtor (const aip::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

◆ UID() [1/4]

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)

◆ UID() [2/4]

hdi::core::UID::UID ( const UID u_)

UID copy constructor.

Author
GW
Date
08/2013
Parameters
u_UID object to copy values from

◆ UID() [3/4]

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)

◆ UID() [4/4]

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

◆ ~UID()

virtual hdi::core::UID::~UID ( )
virtual

Destructs a UID object.

Author
GW
Date
08/2013

Member Function Documentation

◆ aiUIDRef()

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.

◆ art()

virtual std::unique_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

◆ isEmpty()

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

◆ name()

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

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

◆ setName()

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.