Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreDocument.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_DOCUMENT__
8 #define __HDI_CORE_DOCUMENT__
9 
10 #include "hdicoreSize.h"
11 #include "hdicoreTypes.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class Document;
18  }
19 
20  namespace core
21  {
22  class ArtStyle;
23  class Symbol;
24 
28  class Document
29  {
30  public:
34  class Preset
35  {
36  public:
41  {
42  PreviewModeDefault = 10,
43  PreviewModePixel = 20,
44  PreviewModeOverprint = 30
45  };
46 
51  {
52  TransparencyGridNone = 0,
53  TransparencyGridLightGray = 10,
54  TransparencyGridGray = 20,
55  TransparencyGridDarkGray = 30,
56  TransparencyGridRed = 40,
57  TransparencyGridOrange = 50,
58  TransparencyGridGreen = 60,
59  TransparencyGridBlue = 70,
60  TransparencyGridPurple = 80
61  };
62 
67  {
68  RasterResolutionScreen = 10, // 72 ppi
69  RasterResolutionMedium = 20, // 150 ppi
70  RasterResolutionHigh = 30 // 300 ppi
71  };
72 
80  {
81  ArtboardLayoutColumn = 10,
82  ArtboardLayoutRowLR = 20,
83  ArtboardLayoutRowRL = 30,
84  ArtboardLayoutGridByRowLR = 40,
85  ArtboardLayoutGridByColumnLR = 50,
86  ArtboardLayoutGridByRowRL = 60,
87  ArtboardLayoutGridByColumnRL = 70
88  };
89 
93  static const uint32_t maxArtboardCount = 100;
94 
98  std::string title;
99 
104 
108  uint32_t artboardCount;
109 
114 
119 
131 
135  DocumentColorModel colorModel;
136 
140  RulerUnits rulerUnits;
141 
146 
151 
156 
162  Preset();
163 
169  virtual ~Preset();
170  };
171 
182  Document();
183 
191  Document(const Document& doc_);
192 
200  Document(const AIDocumentHandle aiDoc_);
201 
210  Document(const std::string& preset_, const bool showDialog_);
211 
220  Document(const Preset& preset_, const bool showDialog_);
221 
227  virtual ~Document();
228 
237  virtual Document& operator=(const Document& rhs_);
238 
250  virtual AIDocumentHandle aiDocumentHandle() const;
251 
259  virtual bool isEmpty() const;
260 
266  virtual void save() const;
267 
273  virtual void close() const;
274 
280  virtual void activate() const;
281 
289  virtual void print(const bool showDialog_) const;
290 
298  virtual std::string url() const;
299 
307  virtual bool exists() const;
308 
317  virtual bool operator==(const Document& rhs_) const;
318 
328  virtual bool operator!=(const Document& rhs_) const;
329 
337  uint32_t artStyleCount() const;
338 
347  std::auto_ptr<ArtStyle> artStyleAtIndex(const uint32_t index_) const;
348 
356  uint32_t symbolDefCount() const;
357 
366  std::auto_ptr<Symbol> symbolDefAtIndex(const uint32_t index_) const;
367 
368 
369  private:
370  friend plugin::Document* __accessImpl(const Document&);
371  friend Document __accessCtor(plugin::Document*&);
372 
376  void* __data;
377 
383  void* __impl() const;
384 
390  Document(plugin::Document*&);
391  };
392 
393  typedef std::auto_ptr<Document> DocumentAP;
394 
395  extern plugin::Document* __accessImpl(const Document&);
396  extern Document __accessCtor(plugin::Document*&);
397  }
398 }
399 
400 #endif
401 // __HDI_CORE_DOCUMENT__
virtual Document & operator=(const Document &rhs_)
Assigns one Document object to another.
virtual void print(const bool showDialog_) const
Prints the target document.
RasterResolution rasterResolution
Controls the raster resolution of the document.
Definition: hdicoreDocument.h:155
virtual bool operator!=(const Document &rhs_) const
Checks whether one Document object does not represent the same Illustrator document as another...
TransparencyGrid transparencyGrid
Controls the transparency grid color of the document.
Definition: hdicoreDocument.h:150
PreviewMode
Controls the preview mode of a new document.
Definition: hdicoreDocument.h:40
static const uint32_t maxArtboardCount
Maximum number of artboards that Illustrator documents will support.
Definition: hdicoreDocument.h:93
RulerUnits rulerUnits
Controls the ruler units of the document.
Definition: hdicoreDocument.h:140
Represents options when creating a new Illustrator document.
Definition: hdicoreDocument.h:34
Size size
Width and height of the document artboard.
Definition: hdicoreDocument.h:103
ArtboardLayout
Controls how artboards are placed when creating a new document.
Definition: hdicoreDocument.h:79
virtual void save() const
Saves the target document.
std::auto_ptr< Symbol > symbolDefAtIndex(const uint32_t index_) const
Gets a given symbol definition, by its index, in the target doc.
virtual void close() const
Closes the target document.
virtual ~Document()
Document destructor.
virtual AIDocumentHandle aiDocumentHandle() const
Gets the document handle around which the target object is wrapped.
RasterResolution
Controls the raster resolution of a new document.
Definition: hdicoreDocument.h:66
virtual void activate() const
Activates (makes current) the target document.
uint32_t artStyleCount() const
Gets the number of art styles in the document.
PreviewMode previewMode
Controls the preview mode of the document.
Definition: hdicoreDocument.h:145
DocumentColorModel colorModel
Controls the color model of the document.
Definition: hdicoreDocument.h:135
uint32_t symbolDefCount() const
Gets the number of symbol definitions in the document.
Allows one to interact with a document and its metadata (differs from CurrentDocument class) ...
Definition: hdicoreDocument.h:28
Header file for describing 2D dimensions (width and height)
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual bool operator==(const Document &rhs_) const
Checks whether one Document object represents the same Illustrator document as another.
Preset()
Constructs a new Preset object with default values.
TransparencyGrid
Controls the transparency grid color of a new document.
Definition: hdicoreDocument.h:50
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
uint32_t artboardCount
Number of artboards in the document. Cannot exceed maxArtboardCount.
Definition: hdicoreDocument.h:108
Definition: hdicoreaiArray.h:12
virtual ~Preset()
Destructs a Preset object.
virtual bool isEmpty() const
Gets whether the target Document object is empty (constructed with the default ctor) ...
uint32_t artboardRowOrColumnSize
How many artboards should appear in each row or column before wrapping occurs.
Definition: hdicoreDocument.h:130
std::auto_ptr< ArtStyle > artStyleAtIndex(const uint32_t index_) const
Gets a given art style, by its index, in the target doc.
Document()
Constructs an empty Document object.
double artboardSpacing
How many points each artboard should be spaced from its neighbor.
Definition: hdicoreDocument.h:118
std::string title
UTF-8 title of the document. Empty ("") will result in a title like "Untitled-1", etc...
Definition: hdicoreDocument.h:98
virtual std::string url() const
Gets the document URL.
virtual bool exists() const
Gets whether the document exists (is open or in the clipboard)
ArtboardLayout artboardLayout
Controls how the artboards are placed.
Definition: hdicoreDocument.h:113