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

Public Types

typedef std::vector< TextPara * > TextParaVector
 
typedef std::vector< TextRange * > TextRangeVector
 
typedef std::vector< TextWord * > TextWordVector
 

Public Member Functions

 TextRangeSet ()
 Creates a new TextRangeSet object. More...
 
 TextRangeSet (const TextRangeSet &rs_)
 TextRangeSet copy constructor. More...
 
virtual ~TextRangeSet ()
 Destructs a TextRangeSet object. More...
 
virtual TextRangeSetoperator= (const TextRangeSet &rhs_)
 Overloaded assignment operator for TextRangeSet objects. More...
 
virtual bool operator== (const TextRangeSet &rhs_) const
 Tests whether a given TextRangeSet object is the same as another. More...
 
virtual bool operator!= (const TextRangeSet &rhs_) const
 Tests whether a given TextRangeSet object is not the same as another. More...
 
virtual std::auto_ptr< ATE::ITextRanges > ateTextRangeSet () const
 Gets the ATE range set ref around which the target object is wrapped. More...
 
virtual bool isEmpty () const
 Gets whether the target TextRangeSet object is empty. More...
 
virtual int32_t size () const
 Retrieves the number of members of the target set. More...
 
virtual std::auto_ptr< TextRangeSetselections () const
 Retrieves the selected text within the target text range set. More...
 
virtual TextParaVector paragraphs () const
 Retrieves a vector of paragraphs contained in the target text range set. More...
 
virtual TextWordVector words () const
 Retrieves a vector of words contained in the target text range set. More...
 
virtual TextRangeVector runs () const
 Retrieves a vector of runs (ranges) contained in the target text range set. More...
 
virtual std::auto_ptr< TextCharInspectorcharInspector () const
 Creates an inspector with which to access the character features of all characters in the target text range set. More...
 
virtual std::auto_ptr< TextParaInspectorparaInspector () const
 Creates an inspector with which to access the paragraph features of all paragraphs in the target text range set. More...
 
virtual void clearNamedCharStyle ()
 Removes the association of the target text range set and its character style. Copies the feature values of the character style into local override values in the contained characters. More...
 
virtual void clearNamedParaStyle ()
 Removes the association of the target text range set and its paragraph style. Copies the feature values of the paragraph style into local override values in the contained paragraphs. More...
 
virtual std::auto_ptr< TextCharFeaturesuniqueCharFeatures () const
 Retrieves the unique character features used in the target text range set. Unique features are those which have the same value in all text runs in the ranges. More...
 
virtual std::auto_ptr< TextParaFeaturesuniqueParaFeatures () const
 Retrieves the unique paragraph features used in the target text range set. Unique features are those which have the same value in all text runs in the ranges. More...
 
virtual bool hasLocalCharFeatures ()
 Reports whether there any local character feature overrides for characters contained in the target text range set. More...
 
virtual bool hasLocalParaFeatures ()
 Reports whether there any local paragraph feature overrides for paragraphs contained in the target text range set. More...
 
virtual std::auto_ptr< TextCharFeatureslocalCharFeatures ()
 Retrieves the character features that have local overrides in the target text range set, and whose local values are the same in all text runs in the ranges. More...
 
virtual void setLocalCharFeatures (const TextCharFeatures &feat_)
 Replaces all of the local overrides for all characters in the target text range set with a new set of feature values. All values that are assigned become local values, replacing any previous local value. These local values override any specified in a style associated with a character or a text range. All values that are unassigned remove any previous local values, so that those values are inherited. More...
 
virtual void replaceOrAddLocalCharFeatures (const TextCharFeatures &feat_)
 Modifies the local overrides for all characters in the target text range set. All values that are assigned become local values, replacing any previous local value. Values that are unassigned leave any previous local values unchanged. More...
 
virtual void clearLocalCharFeatures ()
 Removes all local overrides for all characters in the target text range set. All character features are then inherited from styles associated with the character or text range, or from the Normal style. More...
 
virtual std::auto_ptr< TextParaFeatureslocalParaFeatures ()
 Retrieves the paragraph features that have local overrides in the target text range set, and whose local values are the same in all text runs in the ranges. More...
 
virtual void setLocalParaFeatures (const TextParaFeatures &feat_)
 Replaces all of the local overrides for all paragraphs in the target text range set with a new set of feature values. All values that are assigned become local values, replacing any previous local value. These local values override any specified in a style associated with a paragraph or a text range. All values that are unassigned remove any previous local values, so that those values are inherited. More...
 
virtual void replaceOrAddLocalParaFeatures (const TextParaFeatures &feat_)
 Modifies the local overrides for all paragraphs in the target text range set. All values that are assigned become local values, replacing any previous local value. Values that are unassigned leave any previous local values unchanged. More...
 
virtual void clearLocalParaFeatures ()
 Removes all local overrides for all paragraphs in this text range set. All paragraph features are then inherited from styles associated with the paragraph or text range, or from the Normal style. More...
 
virtual void select (const bool addToCurrSelection_=false)
 Selects the text in the target text range set. More...
 
virtual void deselect ()
 Deselects the text in the target text range set. This can result in a discontiguous selection, if this text is a subset of the selected text. More...
 
virtual std::string contents (const std::string &le_="\n") const
 Gets the value (contents) of the text range. More...
 
virtual void changeCase (const CaseChangeType type_)
 Changes the case of the text in the target text range set. More...
 
virtual void add (const TextRange &range_)
 Adds a text range as a member of this set. More...
 
virtual std::auto_ptr< TextRangetextRange (const int32_t index_) const
 Retrieves a member of this set by position index. More...
 
virtual void remove (const int32_t index_)
 Removes a member from the set. More...
 
virtual void removeAll ()
 Removes all members from the set. More...
 

Friends

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

Constructor & Destructor Documentation

hdi::core::TextRangeSet::TextRangeSet ( )

Creates a new TextRangeSet object.

Author
GW
Date
08/2014
Note
New TextRangeSet objects do not relate to any text range set on the Illustrator artboard; they are designed to be "receivers" of some other TextRangeSet object via the overloaded assignment operator or assigned to some other existent text art.
hdi::core::TextRangeSet::TextRangeSet ( const TextRangeSet rs_)

TextRangeSet copy constructor.

Author
GW
Date
08/2014
Parameters
rs_TextRangeSet object to copy values from
virtual hdi::core::TextRangeSet::~TextRangeSet ( )
virtual

Destructs a TextRangeSet object.

Author
GW
Date
08/2014

Member Function Documentation

virtual void hdi::core::TextRangeSet::add ( const TextRange range_)
virtual

Adds a text range as a member of this set.

Author
GW
Date
08/2014
Parameters
range_The text range object to add
virtual std::auto_ptr<ATE::ITextRanges> hdi::core::TextRangeSet::ateTextRangeSet ( ) const
virtual

Gets the ATE range set ref around which the target object is wrapped.

Author
GW
Date
08/2014
Returns
ATE::ITextRangesRef 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 void hdi::core::TextRangeSet::changeCase ( const CaseChangeType  type_)
virtual

Changes the case of the text in the target text range set.

Author
GW
Date
08/2014
Parameters
Thecase type enum value
virtual std::auto_ptr<TextCharInspector> hdi::core::TextRangeSet::charInspector ( ) const
virtual

Creates an inspector with which to access the character features of all characters in the target text range set.

Author
GW
Date
08/2014
Returns
The character inspector object
virtual void hdi::core::TextRangeSet::clearLocalCharFeatures ( )
virtual

Removes all local overrides for all characters in the target text range set. All character features are then inherited from styles associated with the character or text range, or from the Normal style.

Author
GW
Date
08/2014
virtual void hdi::core::TextRangeSet::clearLocalParaFeatures ( )
virtual

Removes all local overrides for all paragraphs in this text range set. All paragraph features are then inherited from styles associated with the paragraph or text range, or from the Normal style.

Author
GW
Date
08/2014
virtual void hdi::core::TextRangeSet::clearNamedCharStyle ( )
virtual

Removes the association of the target text range set and its character style. Copies the feature values of the character style into local override values in the contained characters.

Author
GW
Date
08/2014
virtual void hdi::core::TextRangeSet::clearNamedParaStyle ( )
virtual

Removes the association of the target text range set and its paragraph style. Copies the feature values of the paragraph style into local override values in the contained paragraphs.

Author
GW
Date
08/2014
virtual std::string hdi::core::TextRangeSet::contents ( const std::string &  le_ = "\n") const
virtual

Gets the value (contents) of the text range.

Author
GW
Date
12/2013
Parameters
le_Indicates the desired line ending for the output string
Returns
A string for the value of the text art, as UTF-8
Note
Illustrator forces text art to utilize the "\r" character for line endings; if this behavior is unexpected or undesired for your application (as most systems use either "\n" or "\r\n" these days), you can specify what you'd prefer with the optional le_ argument.
virtual void hdi::core::TextRangeSet::deselect ( )
virtual

Deselects the text in the target text range set. This can result in a discontiguous selection, if this text is a subset of the selected text.

Author
GW
Date
08/2014
virtual bool hdi::core::TextRangeSet::hasLocalCharFeatures ( )
virtual

Reports whether there any local character feature overrides for characters contained in the target text range set.

Author
GW
Date
08/2014
Returns
true if there are local overrides
virtual bool hdi::core::TextRangeSet::hasLocalParaFeatures ( )
virtual

Reports whether there any local paragraph feature overrides for paragraphs contained in the target text range set.

Author
GW
Date
08/2014
Returns
true if there are local overrides
virtual bool hdi::core::TextRangeSet::isEmpty ( ) const
virtual

Gets whether the target TextRangeSet object is empty.

Author
GW
Date
08/2014
Returns
true if the target TextRangeSet object is empty, false otherwise
virtual std::auto_ptr<TextCharFeatures> hdi::core::TextRangeSet::localCharFeatures ( )
virtual

Retrieves the character features that have local overrides in the target text range set, and whose local values are the same in all text runs in the ranges.

Author
GW
Date
08/2014
Returns
The character features object containing the unique local feature values. Other features are unassigned. If all features are unassigned, either there are no local overrides, or the local overrides have no common values.
virtual std::auto_ptr<TextParaFeatures> hdi::core::TextRangeSet::localParaFeatures ( )
virtual

Retrieves the paragraph features that have local overrides in the target text range set, and whose local values are the same in all text runs in the ranges.

Author
GW
Date
08/2014
Returns
The paragraph features object containing the unique local feature values. Other features are unassigned. If all features are unassigned, either there are no local overrides, or the local overrides have no common values.
virtual bool hdi::core::TextRangeSet::operator!= ( const TextRangeSet rhs_) const
virtual

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

Author
GW
Date
08/2014
Parameters
rhs_TextRangeSet to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different text range set, false otherwise
virtual TextRangeSet& hdi::core::TextRangeSet::operator= ( const TextRangeSet rhs_)
virtual

Overloaded assignment operator for TextRangeSet objects.

Author
GW
Date
08/2014
virtual bool hdi::core::TextRangeSet::operator== ( const TextRangeSet rhs_) const
virtual

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

Author
GW
Date
08/2014
Parameters
rhs_TextRangeSet to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same text range set, false otherwise
virtual TextParaVector hdi::core::TextRangeSet::paragraphs ( ) const
virtual

Retrieves a vector of paragraphs contained in the target text range set.

Author
GW
Date
08/2014
Returns
The paragraph vector object
Warning
The caller assumes responsibility for the memory of the contained TextPara objects.
virtual std::auto_ptr<TextParaInspector> hdi::core::TextRangeSet::paraInspector ( ) const
virtual

Creates an inspector with which to access the paragraph features of all paragraphs in the target text range set.

Author
GW
Date
08/2014
Returns
The paragraph inspector object
virtual void hdi::core::TextRangeSet::remove ( const int32_t  index_)
virtual

Removes a member from the set.

Author
GW
Date
08/2014
Parameters
index_The 0-based position index of the member to remove
virtual void hdi::core::TextRangeSet::removeAll ( )
virtual

Removes all members from the set.

Author
GW
Date
08/2014
virtual void hdi::core::TextRangeSet::replaceOrAddLocalCharFeatures ( const TextCharFeatures feat_)
virtual

Modifies the local overrides for all characters in the target text range set. All values that are assigned become local values, replacing any previous local value. Values that are unassigned leave any previous local values unchanged.

Author
GW
Date
08/2014
Parameters
feat_The new feature set object
virtual void hdi::core::TextRangeSet::replaceOrAddLocalParaFeatures ( const TextParaFeatures feat_)
virtual

Modifies the local overrides for all paragraphs in the target text range set. All values that are assigned become local values, replacing any previous local value. Values that are unassigned leave any previous local values unchanged.

Author
GW
Date
08/2014
Parameters
feat_The new feature set object
virtual TextRangeVector hdi::core::TextRangeSet::runs ( ) const
virtual

Retrieves a vector of runs (ranges) contained in the target text range set.

Author
GW
Date
08/2014
Returns
The ranges vector object
Warning
The caller assumes responsibility for the memory of the contained TextRange objects.
virtual void hdi::core::TextRangeSet::select ( const bool  addToCurrSelection_ = false)
virtual

Selects the text in the target text range set.

Author
GW
Date
08/2014
Parameters
addToCurrSelection_true to add this text to the current selection, false to clear the current selection before selecting this text
virtual std::auto_ptr<TextRangeSet> hdi::core::TextRangeSet::selections ( ) const
virtual

Retrieves the selected text within the target text range set.

Author
GW
Date
08/2014
Returns
The text ranges object containing the selected text
virtual void hdi::core::TextRangeSet::setLocalCharFeatures ( const TextCharFeatures feat_)
virtual

Replaces all of the local overrides for all characters in the target text range set with a new set of feature values. All values that are assigned become local values, replacing any previous local value. These local values override any specified in a style associated with a character or a text range. All values that are unassigned remove any previous local values, so that those values are inherited.

Author
GW
Date
08/2014
Parameters
feat_The new feature set object
virtual void hdi::core::TextRangeSet::setLocalParaFeatures ( const TextParaFeatures feat_)
virtual

Replaces all of the local overrides for all paragraphs in the target text range set with a new set of feature values. All values that are assigned become local values, replacing any previous local value. These local values override any specified in a style associated with a paragraph or a text range. All values that are unassigned remove any previous local values, so that those values are inherited.

Author
GW
Date
08/2014
Parameters
feat_The new feature set object
virtual int32_t hdi::core::TextRangeSet::size ( ) const
virtual

Retrieves the number of members of the target set.

Author
GW
Date
08/2014
Returns
The number of members, or -1 for error
virtual std::auto_ptr<TextRange> hdi::core::TextRangeSet::textRange ( const int32_t  index_) const
virtual

Retrieves a member of this set by position index.

Author
GW
Date
08/2014
Parameters
index_The 0-based position index
Returns
The member object
virtual std::auto_ptr<TextCharFeatures> hdi::core::TextRangeSet::uniqueCharFeatures ( ) const
virtual

Retrieves the unique character features used in the target text range set. Unique features are those which have the same value in all text runs in the ranges.

Author
GW
Date
08/2014
Returns
The character features object containing the unique feature values
virtual std::auto_ptr<TextParaFeatures> hdi::core::TextRangeSet::uniqueParaFeatures ( ) const
virtual

Retrieves the unique paragraph features used in the target text range set. Unique features are those which have the same value in all text runs in the ranges.

Author
GW
Date
08/2014
Returns
The paragraph features object containing the unique feature values
virtual TextWordVector hdi::core::TextRangeSet::words ( ) const
virtual

Retrieves a vector of words contained in the target text range set.

Author
GW
Date
08/2014
Returns
The words vector object
Warning
The caller assumes responsibility for the memory of the contained TextWord objects.