Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreTextRange.h
Go to the documentation of this file.
1
6
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;
28 class TextCharStyleSet;
29 class TextPara;
30 class TextParaFeatures;
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
90 virtual TextRange& operator=(const TextRange& rhs_);
91
100 virtual bool operator==(const TextRange& rhs_) const;
101
110 virtual bool operator!=(const TextRange& rhs_) const;
111
123 virtual std::unique_ptr<ATE::ITextRange> ateTextRange() const;
124
132 virtual bool isEmpty() const;
133
141 virtual std::unique_ptr<TextRange> duplicate() const;
142
150 virtual int32_t start() const;
151
159 virtual void setStart(const int32_t start_);
160
168 virtual int32_t end() const;
169
177 virtual void setEnd(const int32_t end_);
178
186 virtual int32_t size() const;
187
196 virtual void setRange(const int32_t start_, const int32_t end_);
197
207 virtual void collapse(const CollapseDirection dir_ = CollapseEndDir);
208
222 virtual int32_t move(const int32_t unit_);
223
231 virtual std::unique_ptr<TextStory> story() const;
232
240 virtual void setStory(const TextStory& story_);
241
249 virtual std::unique_ptr<TextRangeSet> selections() const;
250
258 virtual TextArtVector textFrames() const;
259
267 virtual TextParaVector paragraphs() const;
268
276 virtual TextWordVector words() const;
277
286 virtual TextRangeVector runs() const;
287
296 virtual std::unique_ptr<TextCharInspector> charInspector() const;
297
306 virtual std::unique_ptr<TextParaInspector> paraInspector() const;
307
315 virtual std::unique_ptr<TextCharStyleSet> namedCharStyles() const;
316
328 virtual bool setNamedCharStyle(const std::string& name_);
329
336 virtual void clearNamedCharStyle();
337
345 virtual std::unique_ptr<TextParaStyleSet> namedParaStyles() const;
346
358 virtual bool setNamedParaStyle(const std::string& name_);
359
366 virtual void clearNamedParaStyle();
367
377 virtual std::unique_ptr<TextCharFeatures> uniqueCharFeatures() const;
378
388 virtual std::unique_ptr<TextParaFeatures> uniqueParaFeatures() const;
389
398 virtual bool hasLocalCharFeatures() const;
399
410 virtual std::unique_ptr<TextCharFeatures> localCharFeatures() const;
411
425 virtual void setLocalCharFeatures(const TextCharFeatures& feat_);
426
439
448
457 virtual bool hasLocalParaFeatures() const;
458
469 virtual std::unique_ptr<TextParaFeatures> localParaFeatures() const;
470
484 virtual void setLocalParaFeatures(const TextParaFeatures& feat_);
485
498
507
518 virtual void insertBefore(const std::string& text_);
519
530 virtual void insertAfter(const std::string& text_);
531
542 virtual void insertBefore(const TextRange& otherRange_);
543
554 virtual void insertAfter(const TextRange& otherRange_);
555
569 virtual std::string contents(const std::string& le_ = "\n") const;
570
579 virtual void select(const bool addToCurrSelection_ = false);
580
587 virtual void deselect();
588
596 virtual void changeCase(const CaseChangeType type_);
597
607 virtual void fitHeadlines();
608
617 virtual void remove();
618
619
620 private:
621 friend aip::TextRange* __accessImpl(const TextRange&);
622 friend TextRange __accessCtor(const aip::TextRange&);
623
627 aip::TextRange* __impl;
628
634 TextRange(const aip::TextRange&);
635 };
636
637 typedef std::unique_ptr<TextRange> TextRangeUP;
638 typedef std::shared_ptr<TextRange> TextRangeSP;
639 typedef std::weak_ptr<TextRange> TextRangeWP;
640
641 extern aip::TextRange* __accessImpl(const TextRange&);
642 extern TextRange __accessCtor(const aip::TextRange&);
643 }
644}
645
646#endif
647// HDI_CORE_AIP_MODE
648
649#endif
650// __HDI_CORE_TEXT_RANGE__
Allows for text frame manipulation, selection, metadata access, etc.
Definition hdicoreTextArt.h:29
Allows for easy manipulation of Illustrator text character features.
Definition hdicoreTextCharFeatures.h:34
Allows for easy inspection of Illustrator text characters.
Definition hdicoreTextCharInspector.h:33
Encapsulates character style set functionality from the Illustrator SDK.
Definition hdicoreTextCharStyleSet.h:30
Allows for easy manipulation of Illustrator text paragraph features.
Definition hdicoreTextParaFeatures.h:30
Encapsulates text paragraph functionality from the Illustrator SDK.
Definition hdicoreTextPara.h:34
Allows for easy inspection of Illustrator text characters.
Definition hdicoreTextParaInspector.h:29
Encapsulates paragraph style set functionality from the Illustrator SDK.
Definition hdicoreTextParaStyleSet.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...
Encapsulates text range set functionality from the Illustrator SDK.
Definition hdicoreTextRangeSet.h:37
Encapsulates story functionality from the Illustrator SDK.
Definition hdicoreTextStory.h:36
Encapsulates text word functionality from the Illustrator SDK.
Definition hdicoreTextWord.h:29
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