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

Handles general pattern-related functionality. More...

#include <hdicorePattern.h>

Inheritance diagram for hdi::core::Pattern:
Inheritance graph
[legend]

Public Types

enum  Type { UnknownPatternType = 0, NormalPatternType = 10, SymbolPatternType = 20, BrushPatternType = 30 }
 Indicates the type of "pattern" an object is representing.
 

Public Member Functions

 Pattern ()
 Constructs an empty Pattern object. More...
 
 Pattern (const Pattern &patt_)
 Constructs a new Pattern object from an existing Pattern object (copy constructor) More...
 
virtual ~Pattern ()
 Pattern object destructor. More...
 
virtual Patternoperator= (const Pattern &rhs_)
 Assigns one Pattern object to another. More...
 
virtual bool dispose ()
 Removes the pattern from its document. More...
 
virtual AIPatternHandle aiPatternHandle () const
 Gets the pattern handle around which the target object is wrapped. More...
 
virtual bool isEmpty () const
 Gets whether the target Pattern object is empty (constructed with the default ctor) More...
 
virtual bool valid () const
 Tests the validity of the target pattern by searching for it in the document. More...
 
virtual Type patternType () const
 Gets the type of pattern the target object is representing. More...
 
virtual bool operator== (const Pattern &rhs_) const
 Tests whether a given Pattern object is the same as another. More...
 
virtual bool operator!= (const Pattern &rhs_) const
 Tests whether a given Pattern object is not the same as another. More...
 
virtual std::auto_ptr< ArtsourceArt () const
 Gets the Art object that defines the source art for the pattern. More...
 
virtual void setSourceArt (const Art &art_)
 Sets the Art object that defines the source art for the pattern. More...
 
virtual std::string name () const
 Gets the name of the pattern. More...
 
virtual void setName (const std::string &name_)
 Sets the name of the pattern. More...
 
virtual ArtboardRect bounds () const
 Gets the bounds rect for the target pattern. More...
 
virtual bool isBeingEdited () const
 Gets whether the target pattern is currently being edited in pattern editing mode. More...
 
virtual bool setBeingEdited (const Art *const inst_=NULL)
 Puts the document into pattern editing mode, with the target pattern being the one to edit. More...
 

Static Public Member Functions

static Pattern create ()
 Creates a new Pattern object (and Illustrator pattern); set the source art for it with the setSourceArt() method. More...
 

Protected Member Functions

void * _impl () const
 Internal use only. More...
 

Protected Attributes

void * _data
 Private implementation data.
 

Friends

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

Detailed Description

Handles general pattern-related functionality.

Constructor & Destructor Documentation

hdi::core::Pattern::Pattern ( )

Constructs an empty Pattern object.

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

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

Author
GW
Date
11/2013
Parameters
patt_Existing Pattern object
virtual hdi::core::Pattern::~Pattern ( )
virtual

Pattern object destructor.

Author
GW
Date
11/2013

Member Function Documentation

void* hdi::core::Pattern::_impl ( ) const
protected

Internal use only.

Author
GW
Date
11/2013
virtual AIPatternHandle hdi::core::Pattern::aiPatternHandle ( ) const
virtual

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

Author
GW
Date
11/2013
Returns
AIPatternHandle for this 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 ArtboardRect hdi::core::Pattern::bounds ( ) const
virtual

Gets the bounds rect for the target pattern.

Author
GW
Date
11/2013
Returns
A rect object describing the pattern's bounds
static Pattern hdi::core::Pattern::create ( )
static

Creates a new Pattern object (and Illustrator pattern); set the source art for it with the setSourceArt() method.

Author
GW
Date
11/2013
Returns
A new Pattern object
virtual bool hdi::core::Pattern::dispose ( )
virtual

Removes the pattern from its document.

Author
GW
Date
11/2013
Returns
true for successful disposal, false otherwise
Note
After calling dispose(), this object is basically useless! The actual pattern is gone, so obviously none of these methods will work after that.

Reimplemented in hdi::core::Symbol.

virtual bool hdi::core::Pattern::isBeingEdited ( ) const
virtual

Gets whether the target pattern is currently being edited in pattern editing mode.

Author
GW
Date
11/2015
Returns
true if currently being edited, false otherwise

Reimplemented in hdi::core::Symbol.

virtual bool hdi::core::Pattern::isEmpty ( ) const
virtual

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

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

Gets the name of the pattern.

Author
GW
Date
11/2013
Returns
The pattern's name, as UTF-8
virtual bool hdi::core::Pattern::operator!= ( const Pattern rhs_) const
virtual

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

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

Assigns one Pattern object to another.

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

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

Author
GW
Date
11/2013
Parameters
rhs_Pattern to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same pattern, false otherwise
virtual Type hdi::core::Pattern::patternType ( ) const
virtual

Gets the type of pattern the target object is representing.

Author
GW
Date
12/2013
Returns
A Type enum value indicating the type of the underlying pattern
Note
Typically, when SymbolPatternType is returned, you can cast the target to a Symbol object for more refined manipulation. However, it is recommended that you still use dynamic_cast() to be certain the cast is warranted.
virtual bool hdi::core::Pattern::setBeingEdited ( const Art *const  inst_ = NULL)
virtual

Puts the document into pattern editing mode, with the target pattern being the one to edit.

Author
GW
Date
11/2015
Parameters
inst_Ignored
Returns
true if pattern editing mode was entered successfully, false otherwise

Reimplemented in hdi::core::Symbol.

virtual void hdi::core::Pattern::setName ( const std::string &  name_)
virtual

Sets the name of the pattern.

Author
GW
Date
11/2013
Parameters
name_New name for the pattern, as UTF-8
virtual void hdi::core::Pattern::setSourceArt ( const Art art_)
virtual

Sets the Art object that defines the source art for the pattern.

Author
GW
Date
11/2013
Parameters
art_New source art for the target Pattern object

Reimplemented in hdi::core::Symbol.

virtual std::auto_ptr<Art> hdi::core::Pattern::sourceArt ( ) const
virtual

Gets the Art object that defines the source art for the pattern.

Author
GW
Date
11/2013
Returns
An Art object for the source definition of the pattern

Reimplemented in hdi::core::Symbol.

virtual bool hdi::core::Pattern::valid ( ) const
virtual

Tests the validity of the target pattern by searching for it in the document.

Author
GW
Date
11/2013
Returns
true for a valid pattern, false otherwise

Reimplemented in hdi::core::Symbol.