Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreTextRange.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_TEXT_RANGE__
8#define __HDI_CORE_TEXT_RANGE__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <vector>
13
14#include "hdicoreTypes.h"
15
16namespace hdi
17{
18 namespace aip
19 {
20 class TextRange;
21 }
22
23 namespace core
24 {
25 class TextArt;
26 class TextCharFeatures;
27 class TextCharInspector;
28 class TextCharStyleSet;
29 class TextPara;
30 class TextParaFeatures;
31 class TextParaInspector;
32 class TextParaStyleSet;
33 class TextRangeSet;
34 class TextStory;
35 class TextWord;
36
41 {
42 public:
43 typedef std::vector< std::shared_ptr<TextArt> > TextArtVector;
44 typedef std::vector< std::shared_ptr<TextPara> > TextParaVector;
45 typedef std::vector< std::shared_ptr<TextRange> > TextRangeVector;
46 typedef std::vector< std::shared_ptr<TextWord> > TextWordVector;
47
48 enum CollapseDirection
49 {
50 UnknownCollapseDir = 0,
51 CollapseEndDir = 10,
52 CollapseStartDir = 20
53 };
54
65
73 TextRange(const TextRange& tr_);
74
80 virtual ~TextRange();
81
87 virtual TextRange& operator=(const TextRange& rhs_);
88
97 virtual bool operator==(const TextRange& rhs_) const;
98
107 virtual bool operator!=(const TextRange& rhs_) const;
108
120 virtual std::unique_ptr<ATE::ITextRange> ateTextRange() const;
121
129 virtual bool isEmpty() const;
130
138 virtual std::unique_ptr<TextRange> duplicate() const;
139
147 virtual int32_t start() const;
148
156 virtual void setStart(const int32_t start_);
157
165 virtual int32_t end() const;
166
174 virtual void setEnd(const int32_t end_);
175
183 virtual int32_t size() const;
184
193 virtual void setRange(const int32_t start_, const int32_t end_);
194
204 virtual void collapse(const CollapseDirection dir_ = CollapseEndDir);
205
219 virtual int32_t move(const int32_t unit_);
220
228 virtual std::unique_ptr<TextStory> story() const;
229
237 virtual void setStory(const TextStory& story_);
238
246 virtual std::unique_ptr<TextRangeSet> selections() const;
247
255 virtual TextArtVector textFrames() const;
256
264 virtual TextParaVector paragraphs() const;
265
273 virtual TextWordVector words() const;
274
283 virtual TextRangeVector runs() const;
284
293 virtual std::unique_ptr<TextCharInspector> charInspector() const;
294
303 virtual std::unique_ptr<TextParaInspector> paraInspector() const;
304
312 virtual std::unique_ptr<TextCharStyleSet> namedCharStyles() const;
313
325 virtual bool setNamedCharStyle(const std::string& name_);
326
333 virtual void clearNamedCharStyle();
334
342 virtual std::unique_ptr<TextParaStyleSet> namedParaStyles() const;
343
355 virtual bool setNamedParaStyle(const std::string& name_);
356
363 virtual void clearNamedParaStyle();
364
374 virtual std::unique_ptr<TextCharFeatures> uniqueCharFeatures() const;
375
385 virtual std::unique_ptr<TextParaFeatures> uniqueParaFeatures() const;
386
395 virtual bool hasLocalCharFeatures() const;
396
407 virtual std::unique_ptr<TextCharFeatures> localCharFeatures() const;
408
422 virtual void setLocalCharFeatures(const TextCharFeatures& feat_);
423
436
445
454 virtual bool hasLocalParaFeatures() const;
455
466 virtual std::unique_ptr<TextParaFeatures> localParaFeatures() const;
467
481 virtual void setLocalParaFeatures(const TextParaFeatures& feat_);
482
495
504
515 virtual void insertBefore(const std::string& text_);
516
527 virtual void insertAfter(const std::string& text_);
528
539 virtual void insertBefore(const TextRange& otherRange_);
540
551 virtual void insertAfter(const TextRange& otherRange_);
552
566 virtual std::string contents(const std::string& le_ = "\n") const;
567
576 virtual void select(const bool addToCurrSelection_ = false);
577
584 virtual void deselect();
585
593 virtual void changeCase(const CaseChangeType type_);
594
604 virtual void fitHeadlines();
605
614 virtual void remove();
615
616
617 private:
618 friend aip::TextRange* __accessImpl(const TextRange&);
619 friend TextRange __accessCtor(const aip::TextRange&);
620
624 aip::TextRange* __impl;
625
631 TextRange(const aip::TextRange&);
632 };
633
634 typedef std::unique_ptr<TextRange> TextRangeUP;
635 typedef std::shared_ptr<TextRange> TextRangeSP;
636 typedef std::weak_ptr<TextRange> TextRangeWP;
637
638 extern aip::TextRange* __accessImpl(const TextRange&);
639 extern TextRange __accessCtor(const aip::TextRange&);
640 }
641}
642
643#endif
644// HDI_CORE_AIP_MODE
645
646#endif
647// __HDI_CORE_TEXT_RANGE__
Allows for easy manipulation of Illustrator text character features.
Definition: hdicoreTextCharFeatures.h:34
Allows for easy manipulation of Illustrator text paragraph features.
Definition: hdicoreTextParaFeatures.h:30
Allows for easy manipulation of Illustrator text ranges.
Definition: hdicoreTextRange.h:41
virtual bool setNamedParaStyle(const std::string &name_)
Associates a named paragraph style to the target text range. The inherited values can be overridden b...
virtual std::unique_ptr< TextCharFeatures > uniqueCharFeatures() const
Retrieves the unique character features used in the target text range. Unique features are those whic...
virtual void setLocalCharFeatures(const TextCharFeatures &feat_)
Replaces all of the local overrides for all characters in the target text range with a new set of fea...
virtual std::unique_ptr< TextRange > duplicate() const
Duplicates the target text range, returning a new unique TextRange object.
virtual void clearLocalCharFeatures()
Removes all local overrides for all characters in the target text range. All character features are t...
virtual void clearNamedParaStyle()
Removes the association of the target text range and its character style. Copies the feature values o...
virtual void setStart(const int32_t start_)
Sets the start offset of the target text range.
virtual void insertAfter(const TextRange &otherRange_)
Inserts text into the target text range after the current end point.
virtual TextParaVector paragraphs() const
Gets a vector of the paragraphs contained in this text range.
virtual std::unique_ptr< TextParaFeatures > uniqueParaFeatures() const
Retrieves the unique paragraph features used in the target text range. Unique features are those whic...
virtual void fitHeadlines()
Adjusts the tracking of the text in the target range to fit on one line spanning the width of the are...
virtual std::unique_ptr< TextCharInspector > charInspector() const
Creates an inspector with which to access the character features of all characters in the target text...
virtual void collapse(const CollapseDirection dir_=CollapseEndDir)
Resets start or end point of the target range so that it contains only one character,...
virtual TextRange & operator=(const TextRange &rhs_)
Overloaded assignment operator for TextRange objects.
virtual int32_t size() const
Retrieves the number of characters in the target text range.
virtual void replaceOrAddLocalCharFeatures(const TextCharFeatures &feat_)
Modifies the local overrides for all characters in the target text range. All values that are assigne...
virtual bool setNamedCharStyle(const std::string &name_)
Associates a named character style to the target text range. The inherited values can be overridden b...
virtual std::string contents(const std::string &le_="\n") const
Gets the value (contents) of the text range.
virtual std::unique_ptr< TextParaStyleSet > namedParaStyles() const
Retrieves a set of all named paragraph styles used in the target text range.
virtual void select(const bool addToCurrSelection_=false)
Selects the text in the target text range.
virtual std::unique_ptr< TextStory > story() const
Retrieves the story that contains this text range.
virtual void setStory(const TextStory &story_)
Sets the story that contains this text range.
virtual std::unique_ptr< ATE::ITextRange > ateTextRange() const
Gets the ATE text range ref around which the target object is wrapped.
virtual TextArtVector textFrames() const
Gets a vector of the text frames contained in this text range.
virtual int32_t move(const int32_t unit_)
Moves the target text range by adding or subtracting a number of characters to or from the start and ...
virtual int32_t end() const
Gets the end offset of the target text range.
virtual void setLocalParaFeatures(const TextParaFeatures &feat_)
Replaces all of the local overrides for all paragraphs in the target text range with a new set of fea...
virtual void setRange(const int32_t start_, const int32_t end_)
Convenience method to set both the start and end points of the target text range.
virtual void setEnd(const int32_t end_)
Sets the end offset of the target text range.
virtual TextRangeVector runs() const
Gets a vector of the text ranges (that share character attributes) contained in this text range.
virtual std::unique_ptr< TextParaInspector > paraInspector() const
Creates an inspector with which to access the paragraph features of all paragraphs in the target text...
virtual bool hasLocalParaFeatures() const
Reports whether there any local paragraph feature overrides for paragraphs contained in the target te...
virtual void changeCase(const CaseChangeType type_)
Changes the case of the text in the target text range.
virtual std::unique_ptr< TextRangeSet > selections() const
Retrieves the selected text within this text range.
virtual void insertBefore(const TextRange &otherRange_)
Inserts text into the target text range before the current start point.
virtual bool operator==(const TextRange &rhs_) const
Tests whether a given TextRange object is the same as another.
virtual bool hasLocalCharFeatures() const
Reports whether there any local character feature overrides for characters contained in the target te...
virtual void deselect()
Deselects the text in the target text range; this can result in a discontiguous selection,...
virtual bool operator!=(const TextRange &rhs_) const
Tests whether a given TextRange object is not the same as another.
virtual void insertAfter(const std::string &text_)
Inserts text into the target text range after the current end point.
virtual bool isEmpty() const
Gets whether the target TextRange object is empty.
virtual std::unique_ptr< TextCharStyleSet > namedCharStyles() const
Retrieves a set of all named character styles used in the target text range.
virtual void remove()
Deletes all of the characters in the target text range.
virtual ~TextRange()
Destructs a TextRange object.
TextRange(const TextRange &tr_)
TextRange copy constructor.
virtual TextWordVector words() const
Gets a vector of the words contained in this text range.
virtual void insertBefore(const std::string &text_)
Inserts text into the target text range before the current start point.
virtual std::unique_ptr< TextParaFeatures > localParaFeatures() const
Retrieves the paragraph features that have local overrides in the target text range,...
virtual void clearNamedCharStyle()
Removes the association of the target text range and its character style. Copies the feature values o...
virtual std::unique_ptr< TextCharFeatures > localCharFeatures() const
Retrieves the character features that have local overrides in the target text range,...
TextRange()
Creates a new TextRange object.
virtual void clearLocalParaFeatures()
Removes all local overrides for all paragraphs in the target text range. All paragraph features are t...
virtual int32_t start() const
Gets the start offset of the target text range.
virtual void replaceOrAddLocalParaFeatures(const TextParaFeatures &feat_)
Modifies the local overrides for all paragraphs in the target text range. All values that are assigne...
Definition: hdicoreTextStory.h:33
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
CaseChangeType
Indicates how the case of some text should be changed.
Definition: hdicoreTypes.h:507