Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreCurrentDocument.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_CURRENT_DOCUMENT__
8 #define __HDI_CORE_CURRENT_DOCUMENT__
9 
10 #include <vector>
11 
12 #include "hdicoreTypes.h"
13 #include "hdicoreArtboardPoint.h"
14 #include "hdicoreArtboardRect.h"
15 #include "hdicoreFileFormat.h"
16 #include "hdicorePathStyle.h"
17 #include "hdicoreSize.h"
18 
19 namespace hdi
20 {
21  namespace core
22  {
23  class Art;
24  class Artboard;
25  class ArtStyle;
26  class DocumentView;
27  class Font;
28  class Grid;
29  class Layer;
30  class Pattern;
31  class Symbol;
32  class TextRangeSet;
33  class TextStory;
34 
35  namespace ai
36  {
37  class Dictionary;
38  }
39 
40  #if defined(MAC_ENV)
41  typedef NSWindow* PlatformDocWindowPtr;
42  #elif defined(WIN_ENV)
43  typedef HWND PlatformDocWindowPtr;
44  #endif
45 
51  {
52  public:
53  typedef std::vector< Art* > ArtVector;
54  typedef std::vector<MatchArtSpec> MatchArtSpecVector;
55 
59  class Setup
60  {
61  public:
66 
71 
75  double resolution;
76 
82 
86  bool printTiles;
87 
93 
99  Setup();
100 
106  virtual ~Setup();
107  };
108 
109  typedef std::auto_ptr<Setup> SetupAP;
110 
118  std::auto_ptr<ai::Dictionary> dictionary();
119 
131  AIDocumentHandle aiDocumentHandle() const;
132 
144  PlatformDocWindowPtr platformWindow() const;
145 
155  std::string filePath() const;
156 
164  std::string fileName() const;
165 
173  ArtboardRect maxBounds() const;
174 
182  RulerUnits rulerUnits() const;
183 
191  std::auto_ptr<Setup> setup() const;
192 
200  bool hasTextFocus() const;
201 
209  std::auto_ptr<TextStory> focusedText() const;
210 
220  bool setFocusedText(const TextStory& story_);
221 
227  void loseTextFocus();
228 
241  std::auto_ptr<TextRangeSet> selectedText() const;
242 
250  bool modified() const;
251 
262  void setModified(const bool mod_);
263 
274  void sync() const;
275 
283  void redraw() const;
284 
301  void syncAndRedraw() const;
302 
310  bool save() const;
311 
326  bool save(const std::string& path_, const FileFormat& ff_, const bool prompt_ = true) const;
327 
343  bool save(
344  const std::string& path_,
345  const FileFormat& ff_,
346  const FileFormat::Options opt_,
347  const bool prompt_ = true
348  ) const;
349 
357  bool close() const;
358 
369  void undo() const;
370 
381  void redo() const;
382 
393  bool anyArtSelected() const;
394 
404  ArtVector selectedArt() const;
405 
411  void deselectAllArt() const;
412 
427  ArtVector matchingArt(const MatchArtSpecVector& specs_) const;
428 
439  ArtVector artOfType(const MatchArtType type_) const;
440 
448  PathStyle selectedArtPathStyle() const;
449 
465  bool selectedArtPathStyle(PathStyle& style__, PathStyle::Map& map__) const;
466 
474  void setSelectedArtPathStyle(const PathStyle& style_);
475 
484  void setSelectedArtPathStyle(const PathStyle& style_, const PathStyle::Map& map_);
485 
493  uint32_t viewCount() const;
494 
503  std::auto_ptr<DocumentView> viewAtIndex(const uint32_t index_) const;
504 
512  std::auto_ptr<DocumentView> currentView() const;
513 
521  uint32_t layerCount() const;
522 
530  std::auto_ptr<Layer> firstLayer() const;
531 
539  std::auto_ptr<Layer> lastLayer() const;
540 
549  std::auto_ptr<Layer> layerByTitle(const std::string& title_) const;
550 
559  std::auto_ptr<Layer> layerAtIndex(const uint32_t index_) const;
560 
568  std::auto_ptr<Layer> currentLayer() const;
569 
577  void setCurrentLayer(const Layer& layer_);
578 
586  bool inIsolationMode() const;
587 
595  std::auto_ptr<Art> isolatedArt() const;
596 
610  bool enterIsolationMode(const Art& art_, const bool hideOtherArt_);
611 
619  void exitIsolationMode() const;
620 
632  bool inPatternEditingMode() const;
633 
642  bool enterPatternEditingMode(const Pattern& toEdit_);
643 
656  bool applyPatternEditingModeChanges(const Pattern& editPatt_);
657 
665  void exitPatternEditingMode() const;
666 
678  bool inSymbolEditingMode() const;
679 
693  bool enterSymbolEditingMode(const Symbol& toEdit_, const Art* const inst_ = NULL);
694 
708  bool applySymbolEditingModeChanges(const Symbol& editSym_);
709 
717  void exitSymbolEditingMode() const;
718 
726  uint32_t artboardCount() const;
727 
736  std::auto_ptr<Artboard> artboardByTitle(const std::string& title_) const;
737 
746  std::auto_ptr<Artboard> artboardAtIndex(const uint32_t index_) const;
747 
758  bool insertArtboard(const uint32_t index_, Artboard& ab__) const;
759 
767  std::auto_ptr<Artboard> currentArtboard() const;
768 
776  void setCurrentArtboard(const Artboard& artboard_);
777 
785  uint32_t artStyleCount() const;
786 
795  std::auto_ptr<ArtStyle> artStyleAtIndex(const uint32_t index_) const;
796 
804  uint32_t patternCount() const;
805 
814  std::auto_ptr<Pattern> patternAtIndex(const uint32_t index_) const;
815 
823  uint32_t symbolDefCount() const;
824 
833  std::auto_ptr<Symbol> symbolDefAtIndex(const uint32_t index_) const;
834 
842  Grid* const grid() const;
843 
851  DocumentColorModel colorModel() const;
852 
861  PathStyle defaultPathStyle() const;
862 
871  void setDefaultPathStyle(const PathStyle& style_);
872 
880  PathStyle defaultTextStyle() const;
881 
889  void setDefaultTextStyle(const PathStyle& style_);
890 
898  std::auto_ptr<Font> currentFont() const;
899 
907  void setCurrentFont(const Font& font_);
908 
921  ArtVector artAtPoint(const ArtboardPoint& pt_, const HitRequest request_) const;
922 
923 
924  private:
925  // Only the Illustrator class can construct a CurrentDocument object
926  friend class Illustrator;
927 
931  void* __data;
932 
938  CurrentDocument();
939 
946 
952  ~CurrentDocument();
953 
959  CurrentDocument& operator=(const CurrentDocument&);
960  };
961  }
962 }
963 
964 #endif
965 // __HDI_CORE_CURRENT_DOCUMENT__
Handles general art-related functionality.
Definition: hdicoreArt.h:48
bool tileFullPages
Ignored when printTiles is false; otherwise, controls whether many tiles are created to print the ent...
Definition: hdicoreCurrentDocument.h:92
HitRequest
Describes the types of hit tests that can be performed (AKA a hit request)
Definition: hdicoreTypes.h:326
Handles general pattern-related functionality.
Definition: hdicorePattern.h:27
Describes all styling attributes of a path.
Definition: hdicorePathStyle.h:427
MatchArtType
Indicates a type of art (when searching the document artwork tree for art objects) ...
Definition: hdicoreTypes.h:118
Header file for Illustrator file format manipulation.
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
Definition: hdicoreTextStory.h:30
Header file for geometric rectangle manipulation on the Illustrator artboard.
RulerUnits
Indicates the ruler units of a document.
Definition: hdicoreTypes.h:594
Handles general symbol-related functionality.
Definition: hdicoreSymbol.h:24
Header file for describing 2D dimensions (width and height)
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Describes a file format that Illustrator can either read or write.
Definition: hdicoreFileFormat.h:21
Size size
Document dimensions.
Definition: hdicoreCurrentDocument.h:65
Acts as a StrokeStyle value map, indicating which values are "known".
Definition: hdicorePathStyle.h:433
Font class to allow for easy font manipulation.
Definition: hdicoreFont.h:170
Allows for layer metadata access, visibility manipulation, locking, sibling access, etc.
Definition: hdicoreLayer.h:27
Header file for path style-related classes.
Header file for geometric point manipulation on the Illustrator artboard.
Current (focused) document class to allow for metadata access, updating, dictionary access...
Definition: hdicoreCurrentDocument.h:50
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
Describes the setup options of an existing document.
Definition: hdicoreCurrentDocument.h:59
Definition: hdicoreaiArray.h:12
bool showPlacedImages
Indicates whether placed images are shown.
Definition: hdicoreCurrentDocument.h:70
Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc.
Definition: hdicoreIllustrator.h:48
bool printTiles
Controls whether multiple tiled pages are printed (or just a single page)
Definition: hdicoreCurrentDocument.h:86
bool splitLongPaths
Controls whether long paths are split. Which paths are affected also depends on the bezier resolution...
Definition: hdicoreCurrentDocument.h:81
double resolution
Bezier resolution in dpi.
Definition: hdicoreCurrentDocument.h:75
Represents an individual artboard in the current document.
Definition: hdicoreArtboard.h:31
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
DocumentColorModel
Indicates the color model of new document.
Definition: hdicoreTypes.h:356
Allows manipulation of Illustrator&#39;s built-in grids.
Definition: hdicoreGrid.h:20
Options
Used to specify the capabilities of a file format.
Definition: hdicoreFileFormat.h:40