Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
hdi::core::TextRangeSet Class Reference

Public Types

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

Public Member Functions

 TextRangeSet ()
 Creates a new TextRangeSet object.
 
 TextRangeSet (const TextRangeSet &rs_)
 TextRangeSet copy constructor.
 
virtual ~TextRangeSet ()
 Destructs a TextRangeSet object.
 
virtual TextRangeSetoperator= (const TextRangeSet &rhs_)
 Overloaded assignment operator for TextRangeSet objects.
 
virtual bool operator== (const TextRangeSet &rhs_) const
 Tests whether a given TextRangeSet object is the same as another.
 
virtual bool operator!= (const TextRangeSet &rhs_) const
 Tests whether a given TextRangeSet object is not the same as another.
 
virtual std::unique_ptr< ATE::ITextRanges > ateTextRangeSet () const
 Gets the ATE range set ref around which the target object is wrapped.
 
virtual bool isEmpty () const
 Gets whether the target TextRangeSet object is empty.
 
virtual int32_t size () const
 Retrieves the number of members of the target set.
 
virtual std::unique_ptr< TextRangeSetselections () const
 Retrieves the selected text within the target text range set.
 
virtual TextParaVector paragraphs () const
 Retrieves a vector of paragraphs contained in the target text range set.
 
virtual TextWordVector words () const
 Retrieves a vector of words contained in the target text range set.
 
virtual TextRangeVector runs () const
 Retrieves a vector of runs (ranges) contained in the target text range set.
 
virtual std::unique_ptr< TextCharInspectorcharInspector () const
 Creates an inspector with which to access the character features of all characters in the target text range set.
 
virtual std::unique_ptr< TextParaInspectorparaInspector () const
 Creates an inspector with which to access the paragraph features of all paragraphs in the target text range set.
 
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.
 
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.
 
virtual std::unique_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.
 
virtual std::unique_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.
 
virtual bool hasLocalCharFeatures ()
 Reports whether there any local character feature overrides for characters contained in the target text range set.
 
virtual bool hasLocalParaFeatures ()
 Reports whether there any local paragraph feature overrides for paragraphs contained in the target text range set.
 
virtual std::unique_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.
 
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.
 
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.
 
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.
 
virtual std::unique_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.
 
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.
 
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.
 
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.
 
virtual void select (const bool addToCurrSelection_=false)
 Selects the text in the target text range set.
 
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.
 
virtual std::string contents (const std::string &le_="\n") const
 Gets the value (contents) of the text range.
 
virtual void changeCase (const CaseChangeType type_)
 Changes the case of the text in the target text range set.
 
virtual void add (const TextRange &range_)
 Adds a text range as a member of this set.
 
virtual std::unique_ptr< TextRangetextRange (const int32_t index_) const
 Retrieves a member of this set by position index.
 
virtual void remove (const int32_t index_)
 Removes a member from the set.
 
virtual void removeAll ()
 Removes all members from the set.
 

Friends

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

Constructor & Destructor Documentation

◆ TextRangeSet() [1/2]

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.

◆ TextRangeSet() [2/2]

hdi::core::TextRangeSet::TextRangeSet ( const TextRangeSet rs_)

TextRangeSet copy constructor.

Author
GW
Date
08/2014
Parameters
rs_TextRangeSet object to copy values from

◆ ~TextRangeSet()

virtual hdi::core::TextRangeSet::~TextRangeSet ( )
virtual

Destructs a TextRangeSet object.

Author
GW
Date
08/2014

Member Function Documentation

◆ add()

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

◆ ateTextRangeSet()

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

◆ changeCase()

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

◆ charInspector()

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

◆ clearLocalCharFeatures()

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

◆ clearLocalParaFeatures()

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

◆ clearNamedCharStyle()

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

◆ clearNamedParaStyle()

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

◆ contents()

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.

◆ deselect()

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

◆ hasLocalCharFeatures()

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

◆ hasLocalParaFeatures()

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

◆ isEmpty()

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

◆ localCharFeatures()

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

◆ localParaFeatures()

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

◆ operator!=()

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

◆ operator=()

virtual TextRangeSet & hdi::core::TextRangeSet::operator= ( const TextRangeSet rhs_)
virtual

Overloaded assignment operator for TextRangeSet objects.

Author
GW
Date
08/2014

◆ operator==()

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

◆ paragraphs()

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

◆ paraInspector()

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

◆ remove()

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

◆ removeAll()

virtual void hdi::core::TextRangeSet::removeAll ( )
virtual

Removes all members from the set.

Author
GW
Date
08/2014

◆ replaceOrAddLocalCharFeatures()

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

◆ replaceOrAddLocalParaFeatures()

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

◆ runs()

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

◆ select()

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

◆ selections()

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

◆ setLocalCharFeatures()

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

◆ setLocalParaFeatures()

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

◆ size()

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

◆ textRange()

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

◆ uniqueCharFeatures()

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

◆ uniqueParaFeatures()

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

◆ words()

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