Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreTextRange.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_TEXT_RANGE__
8 #define __HDI_CORE_TEXT_RANGE__
9 
10 #include <vector>
11 
12 #include "hdicoreTypes.h"
13 
14 namespace hdi
15 {
16  namespace plugin
17  {
18  class TextRange;
19  }
20 
21  namespace core
22  {
23  class TextArt;
24  class TextCharFeatures;
25  class TextCharInspector;
26  class TextCharStyleSet;
27  class TextPara;
28  class TextParaFeatures;
29  class TextParaInspector;
30  class TextParaStyleSet;
31  class TextRangeSet;
32  class TextStory;
33  class TextWord;
34 
38  class TextRange
39  {
40  public:
41  typedef std::vector< TextArt* > TextArtVector;
42  typedef std::vector< TextPara* > TextParaVector;
43  typedef std::vector< TextRange* > TextRangeVector;
44  typedef std::vector< TextWord* > TextWordVector;
45 
46  enum CollapseDirection
47  {
48  UnknownCollapseDir = 0,
49  CollapseEndDir = 10,
50  CollapseStartDir = 20
51  };
52 
62  TextRange();
63 
71  TextRange(const TextRange& tr_);
72 
78  virtual ~TextRange();
79 
85  virtual TextRange& operator=(const TextRange& rhs_);
86 
95  virtual bool operator==(const TextRange& rhs_) const;
96 
105  virtual bool operator!=(const TextRange& rhs_) const;
106 
118  virtual std::auto_ptr<ATE::ITextRange> ateTextRange() const;
119 
127  virtual bool isEmpty() const;
128 
136  virtual std::auto_ptr<TextRange> duplicate() const;
137 
145  virtual int32_t start() const;
146 
154  virtual void setStart(const int32_t start_);
155 
163  virtual int32_t end() const;
164 
172  virtual void setEnd(const int32_t end_);
173 
181  virtual int32_t size() const;
182 
191  virtual void setRange(const int32_t start_, const int32_t end_);
192 
202  virtual void collapse(const CollapseDirection dir_ = CollapseEndDir);
203 
217  virtual int32_t move(const int32_t unit_);
218 
226  virtual std::auto_ptr<TextStory> story() const;
227 
235  virtual void setStory(const TextStory& story_);
236 
244  virtual std::auto_ptr<TextRangeSet> selections() const;
245 
255  virtual TextArtVector textFrames() const;
256 
266  virtual TextParaVector paragraphs() const;
267 
277  virtual TextWordVector words() const;
278 
289  virtual TextRangeVector runs() const;
290 
299  virtual std::auto_ptr<TextCharInspector> charInspector() const;
300 
309  virtual std::auto_ptr<TextParaInspector> paraInspector() const;
310 
318  virtual std::auto_ptr<TextCharStyleSet> namedCharStyles() const;
319 
331  virtual bool setNamedCharStyle(const std::string& name_);
332 
339  virtual void clearNamedCharStyle();
340 
348  virtual std::auto_ptr<TextParaStyleSet> namedParaStyles() const;
349 
361  virtual bool setNamedParaStyle(const std::string& name_);
362 
369  virtual void clearNamedParaStyle();
370 
380  virtual std::auto_ptr<TextCharFeatures> uniqueCharFeatures() const;
381 
391  virtual std::auto_ptr<TextParaFeatures> uniqueParaFeatures() const;
392 
401  virtual bool hasLocalCharFeatures() const;
402 
413  virtual std::auto_ptr<TextCharFeatures> localCharFeatures() const;
414 
428  virtual void setLocalCharFeatures(const TextCharFeatures& feat_);
429 
441  virtual void replaceOrAddLocalCharFeatures(const TextCharFeatures& feat_);
442 
450  virtual void clearLocalCharFeatures();
451 
460  virtual bool hasLocalParaFeatures() const;
461 
472  virtual std::auto_ptr<TextParaFeatures> localParaFeatures() const;
473 
487  virtual void setLocalParaFeatures(const TextParaFeatures& feat_);
488 
500  virtual void replaceOrAddLocalParaFeatures(const TextParaFeatures& feat_);
501 
509  virtual void clearLocalParaFeatures();
510 
521  virtual void insertBefore(const std::string& text_);
522 
533  virtual void insertAfter(const std::string& text_);
534 
545  virtual void insertBefore(const TextRange& otherRange_);
546 
557  virtual void insertAfter(const TextRange& otherRange_);
558 
572  virtual std::string contents(const std::string& le_ = "\n") const;
573 
582  virtual void select(const bool addToCurrSelection_ = false);
583 
590  virtual void deselect();
591 
599  virtual void changeCase(const CaseChangeType type_);
600 
610  virtual void fitHeadlines();
611 
620  virtual void remove();
621 
622 
623  private:
624  friend plugin::TextRange* __accessImpl(const TextRange&);
625  friend TextRange __accessCtor(const plugin::TextRange&);
626 
630  plugin::TextRange* __impl;
631 
637  TextRange(const plugin::TextRange&);
638  };
639 
640  typedef std::auto_ptr<TextRange> TextRangeAP;
641 
642  extern plugin::TextRange* __accessImpl(const TextRange&);
643  extern TextRange __accessCtor(const plugin::TextRange&);
644  }
645 }
646 
647 #endif
648 // __HDI_CORE_TEXT_RANGE__
Allows for easy manipulation of Illustrator text ranges.
Definition: hdicoreTextRange.h:38
Allows for easy manipulation of Illustrator text character features.
Definition: hdicoreTextCharFeatures.h:31
Definition: hdicoreTextStory.h:30
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Allows for easy manipulation of Illustrator text paragraph features.
Definition: hdicoreTextParaFeatures.h:27
Definition: hdicoreaiArray.h:12
CaseChangeType
Indicates how the case of some text should be changed.
Definition: hdicoreTypes.h:497