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

Describes an art style. More...

#include <hdicoreArtStyle.h>

Classes

class  BlendField
 Describes blending info for an art style or paint field of an art style. More...
 
class  Effect
 Effects are contained by art styles and are used to replace typical fill/stroke drawing. More...
 
struct  PaintData
 Stores art style gradient information. More...
 
class  PaintField
 Corresponds to either a fill or a stroke in an art style. Each paint field can also contain live effects and transparency information. More...
 

Public Types

enum  Type { UnknownType = 0, SimpleType = 10, ActiveType = 20 }
 Indicates the type of an art style.
 
enum  Attributes {
  NoAttributes = 0, HasFillAttribute = 1 << 0, HasStrokeAttribute = 1 << 1, PatternsAttribute = 1 << 2,
  CustomColorsAttribute = 1 << 3, FillGradientsAttribute = 1 << 4, FillRadialGradientsAttribute = 1 << 5, StrokeGradientsAttribute = 1 << 6,
  StrokeRadialGradientsAttribute = 1 << 7, TransparencyAttribute = 1 << 8, BrushesAttribute = 1 << 9, EffectsAttribute = 1 << 10,
  ScalableEffectsAttribute = 1 << 11
}
 Indicates the various attributes of an art style.
 
typedef std::auto_ptr< PaintDataPaintDataAP
 
typedef std::auto_ptr< BlendFieldBlendFieldAP
 
typedef std::auto_ptr< EffectEffectAP
 
typedef std::auto_ptr< PaintFieldPaintFieldAP
 

Public Member Functions

 ArtStyle ()
 Constructs an empty ArtStyle object. More...
 
 ArtStyle (const ArtStyle &a_)
 ArtStyle copy constructor. More...
 
 ArtStyle (const AIArtStyleHandle aiArtStyle_)
 Constructs a new ArtStyle object from an AIArtStyleHandle. More...
 
virtual ~ArtStyle ()
 Destructs an ArtStyle object. More...
 
virtual ArtStyleoperator= (const ArtStyle &rhs_)
 Overloaded ArtStyle assignment operator. More...
 
virtual bool operator== (const ArtStyle &rhs_) const
 Tests whether a given ArtStyle object is the same as another. More...
 
virtual bool operator!= (const ArtStyle &rhs_) const
 Tests whether a given ArtStyle object is not the same as another. More...
 
virtual AIArtStyleHandle aiArtStyleHandle () const
 Gets the art style handle around which the target object is wrapped. More...
 
virtual bool valid ()
 Tests the validity of the target style by searching for it in the document. More...
 
virtual std::string name () const
 Gets the name of the art style. More...
 
virtual void setName (const std::string &name_)
 Sets the name of the art style. More...
 
virtual bool isAnonymous () const
 Gets whether an art style is anonymous (named art styles appear in the styles panel) More...
 
virtual Type styleType () const
 Gets the type of the art style. More...
 
virtual Attributes attributes () const
 Gets the attributes of the art style. More...
 
virtual bool visible () const
 Gets whether the style is visible. More...
 
virtual bool hasFillOrStroke () const
 Gets whether the style has any fill or stroke. More...
 
virtual bool hasEffects () const
 Gets whether the style has any live effects. More...
 
virtual bool hasTransparency () const
 Gets whether the style has any transparency. More...
 
virtual int32_t paintFieldCount () const
 Gets the number of paint fields in the target style. More...
 
virtual std::auto_ptr< PaintFieldpaintFieldAtIndex (const int32_t index_) const
 Gets a paint field from the target style by position index. More...
 
virtual std::auto_ptr< PaintFieldfocusFill () const
 Gets the focus fill from the target style. More...
 
virtual std::auto_ptr< PaintFieldfocusStroke () const
 Gets the focus stroke from the target style. More...
 
virtual int32_t preEffectCount () const
 Gets the number of pre-effects in the target style. More...
 
virtual std::auto_ptr< EffectpreEffectAtIndex (const int32_t index_) const
 Gets a pre-effect from the target style by position index. More...
 
virtual int32_t postEffectCount () const
 Gets the number of post-effects in the target style. More...
 
virtual std::auto_ptr< EffectpostEffectAtIndex (const int32_t index_) const
 Gets a post-effect from the target style by position index. More...
 
virtual std::auto_ptr< BlendFieldblendField () const
 Gets the overall art style transparency in the form of a blend field. More...
 

Friends

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

Detailed Description

Describes an art style.

Constructor & Destructor Documentation

hdi::core::ArtStyle::ArtStyle ( )

Constructs an empty ArtStyle object.

Author
GW
Date
08/2013
Note
Empty ArtStyle objects do not relate to any art style in a document; they are designed to be "receivers" of some other ArtStyle object via the overloaded assignment operator. Empty ArtStyle objects are useless until such time (though it is safe to call any of their methods)
hdi::core::ArtStyle::ArtStyle ( const ArtStyle a_)

ArtStyle copy constructor.

Author
GW
Date
08/2013
Parameters
a_Existing ArtStyle object to copy
hdi::core::ArtStyle::ArtStyle ( const AIArtStyleHandle  aiArtStyle_)

Constructs a new ArtStyle object from an AIArtStyleHandle.

Author
GW
Date
08/2015
Parameters
aiArtStyle_Raw Illustrator AIArtStyleHandle
virtual hdi::core::ArtStyle::~ArtStyle ( )
virtual

Destructs an ArtStyle object.

Author
GW
Date
08/2013

Member Function Documentation

virtual AIArtStyleHandle hdi::core::ArtStyle::aiArtStyleHandle ( ) const
virtual

Gets the art style handle around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIArtStyleHandle 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 Attributes hdi::core::ArtStyle::attributes ( ) const
virtual

Gets the attributes of the art style.

Author
GW
Date
11/2013
Returns
A bitwise OR of the attributes present in the target style
virtual std::auto_ptr<BlendField> hdi::core::ArtStyle::blendField ( ) const
virtual

Gets the overall art style transparency in the form of a blend field.

Author
GW
Date
08/2014
Returns
The blend field object, or NULL for error
virtual std::auto_ptr<PaintField> hdi::core::ArtStyle::focusFill ( ) const
virtual

Gets the focus fill from the target style.

Author
GW
Date
08/2014
Returns
The focus fill paint field object, or NULL for error
Note
If the art style has multiple fills, the user can only edit one at a time. The one currently being edited is the focus fill, and it is shown in the fill/stroke proxies on the Tool and Color panels.
virtual std::auto_ptr<PaintField> hdi::core::ArtStyle::focusStroke ( ) const
virtual

Gets the focus stroke from the target style.

Author
GW
Date
08/2014
Returns
The focus stroke paint field object, or NULL for error
Note
If the art style has multiple stroke, the user can only edit one at a time. The one currently being edited is the focus stroke, and it is shown in the fill/stroke proxies on the Tool and Color panels.
virtual bool hdi::core::ArtStyle::hasEffects ( ) const
virtual

Gets whether the style has any live effects.

Author
GW
Date
08/2014
Returns
true if any live effects are present, false otherwise
virtual bool hdi::core::ArtStyle::hasFillOrStroke ( ) const
virtual

Gets whether the style has any fill or stroke.

Author
GW
Date
08/2014
Returns
true if a fill or stroke is present, false otherwise
virtual bool hdi::core::ArtStyle::hasTransparency ( ) const
virtual

Gets whether the style has any transparency.

Author
GW
Date
08/2014
Returns
true if any non-default transparency info is present, false otherwise
virtual bool hdi::core::ArtStyle::isAnonymous ( ) const
virtual

Gets whether an art style is anonymous (named art styles appear in the styles panel)

Author
GW
Date
11/2016
Returns
true if anonymous, false if named
virtual std::string hdi::core::ArtStyle::name ( ) const
virtual

Gets the name of the art style.

Author
GW
Date
08/2013
Returns
The UTF-8 name of the art style, or "" (empty string) if none
virtual bool hdi::core::ArtStyle::operator!= ( const ArtStyle rhs_) const
virtual

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

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

Overloaded ArtStyle assignment operator.

Author
GW
Date
08/2013
Parameters
rhs_Exists ArtStyle object to copy values from
Returns
The target ArtStyle object, but with its values updated
virtual bool hdi::core::ArtStyle::operator== ( const ArtStyle rhs_) const
virtual

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

Author
GW
Date
08/2013
Parameters
rhs_ArtStyle to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same style, false otherwise
virtual std::auto_ptr<PaintField> hdi::core::ArtStyle::paintFieldAtIndex ( const int32_t  index_) const
virtual

Gets a paint field from the target style by position index.

Author
GW
Date
08/2014
Parameters
index_The position index
Returns
The paint field object, or NULL for error
virtual int32_t hdi::core::ArtStyle::paintFieldCount ( ) const
virtual

Gets the number of paint fields in the target style.

Author
GW
Date
08/2014
Returns
The number of paint fields, or -1 for error
virtual std::auto_ptr<Effect> hdi::core::ArtStyle::postEffectAtIndex ( const int32_t  index_) const
virtual

Gets a post-effect from the target style by position index.

Author
GW
Date
08/2014
Parameters
index_The position index
Returns
The effect object, or NULL for error
virtual int32_t hdi::core::ArtStyle::postEffectCount ( ) const
virtual

Gets the number of post-effects in the target style.

Author
GW
Date
08/2014
Returns
The number of post-effects, or -1 for error
virtual std::auto_ptr<Effect> hdi::core::ArtStyle::preEffectAtIndex ( const int32_t  index_) const
virtual

Gets a pre-effect from the target style by position index.

Author
GW
Date
08/2014
Parameters
index_The position index
Returns
The effect object, or NULL for error
virtual int32_t hdi::core::ArtStyle::preEffectCount ( ) const
virtual

Gets the number of pre-effects in the target style.

Author
GW
Date
08/2014
Returns
The number of pre-effects, or -1 for error
virtual void hdi::core::ArtStyle::setName ( const std::string &  name_)
virtual

Sets the name of the art style.

Author
GW
Date
08/2013
Parameters
name_New name for the art style, as UTF-8
virtual Type hdi::core::ArtStyle::styleType ( ) const
virtual

Gets the type of the art style.

Author
GW
Date
11/2013
Returns
A enum value for the style type
virtual bool hdi::core::ArtStyle::valid ( )
virtual

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

Author
GW
Date
11/2013
Returns
true for a valid art style, false otherwise
virtual bool hdi::core::ArtStyle::visible ( ) const
virtual

Gets whether the style is visible.

Author
GW
Date
08/2014
Returns
true if visible, false otherwise
Note
A style is considered invisible if there are no effects, all the paint fields have a color of none, and the overall transparency contains default values.