Hot Door CORE 0.8.3
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreDocument.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_DOCUMENT__
8#define __HDI_CORE_DOCUMENT__
9
10#include "hdicorePoint.h"
11#include "hdicoreSize.h"
12#include "hdicoreTypes.h"
13
14namespace hdi
15{
16 #if defined(HDI_CORE_AIP_MODE)
17 namespace aip
18 {
19 class Document;
20 }
21 #elif defined(HDI_CORE_PSP_MODE)
22 namespace psp
23 {
24 class Document;
25 }
26 #endif
27
28 namespace core
29 {
30 class Layer;
31
32 #if defined(HDI_CORE_AIP_MODE)
33 class ArtStyle;
34 class Symbol;
35 #elif defined(HDI_CORE_PSP_MODE)
36 class XMPMeta;
37 #endif
38
43 {
44 public:
45 #if defined(HDI_CORE_AIP_MODE)
49 class Preset
50 {
51 public:
56 {
57 PreviewModeDefault = 10,
58 PreviewModePixel = 20,
59 PreviewModeOverprint = 30
60 };
61
66 {
67 TransparencyGridNone = 0,
68 TransparencyGridLightGray = 10,
69 TransparencyGridGray = 20,
70 TransparencyGridDarkGray = 30,
71 TransparencyGridRed = 40,
72 TransparencyGridOrange = 50,
73 TransparencyGridGreen = 60,
74 TransparencyGridBlue = 70,
75 TransparencyGridPurple = 80
76 };
77
82 {
83 RasterResolutionScreen = 10, // 72 ppi
84 RasterResolutionMedium = 20, // 150 ppi
85 RasterResolutionHigh = 30 // 300 ppi
86 };
87
95 {
96 ArtboardLayoutColumn = 10,
97 ArtboardLayoutRowLR = 20,
98 ArtboardLayoutRowRL = 30,
99 ArtboardLayoutGridByRowLR = 40,
100 ArtboardLayoutGridByColumnLR = 50,
101 ArtboardLayoutGridByRowRL = 60,
102 ArtboardLayoutGridByColumnRL = 70
103 };
104
108 static const uint32_t maxArtboardCount = 1000;
109
113 std::string title;
114
119
124
129
134
146
151
156
161
166
171
178
184 virtual ~Preset();
185 };
186 #endif
187 // HDI_CORE_AIP_MODE
188
200
208 Document(const Document& doc_);
209
210 #if defined(HDI_CORE_AIP_MODE)
218 Document(const AIDocumentHandle aiDoc_);
219
228 Document(const std::string& preset_, const bool showDialog_);
229
238 Document(const Preset& preset_, const bool showDialog_);
239 #elif defined(HDI_CORE_PSP_MODE)
247 Document(const int32_t psDoc_);
248 #endif
249
255 virtual ~Document();
256
265 virtual Document& operator=(const Document& rhs_);
266
267 #if defined(HDI_CORE_AIP_MODE)
279 virtual AIDocumentHandle aiDocumentHandle() const;
280 #elif defined(HDI_CORE_PSP_MODE)
292 virtual int32_t psDocumentID() const;
293 #endif
294
302 virtual bool isEmpty() const;
303
309 virtual void save() const;
310
316 virtual void close() const;
317
323 virtual void activate() const;
324
332 virtual void print(const bool showDialog_) const;
333
341 virtual std::string url() const;
342
350 virtual bool exists() const;
351
360 virtual bool operator==(const Document& rhs_) const;
361
370 virtual bool operator!=(const Document& rhs_) const;
371
372 #if defined(HDI_CORE_AIP_MODE)
380 uint32_t artStyleCount() const;
381
390 std::unique_ptr<ArtStyle> artStyleAtIndex(const uint32_t index_) const;
391
399 uint32_t symbolDefCount() const;
400
409 std::unique_ptr<Symbol> symbolDefAtIndex(const uint32_t index_) const;
410 #endif
411 // HDI_CORE_AIP_MODE
412
413 #if defined(HDI_CORE_PSP_MODE)
421 virtual Point center() const;
422
430 virtual Size dimensions() const;
431
440 virtual void setDimensions(const Size& s_, const ImageInterpolation ii_);
441
449 virtual ColorSpace colorSpace() const;
450
459 virtual void setColorSpace(const ColorSpace cs_, const bool ml_);
460
468 virtual double resolution() const;
469
478 virtual void setResolution(const double res_, const ImageInterpolation ii_);
479
487 virtual int16_t depth() const;
488
496 virtual void setDepth(const int16_t d_);
497
505 virtual Point rulerOrigin() const;
506
514 virtual bool smartGuidesVisible() const;
515
523 virtual bool guidesVisible() const;
524
532 virtual bool rulersVisible() const;
533
541 virtual bool hasBackgroundLayer() const;
542
550 virtual std::unique_ptr<Layer> backgroundLayer() const;
551
559 virtual double zoomLevel() const;
560
568 virtual double pixelScaleFactor() const;
569
577 virtual std::string colorProfile() const;
578
586 virtual std::string formatName() const;
587
595 virtual uint32_t layerCount() const;
596
604 virtual std::unique_ptr<Layer> firstLayer() const;
605
613 virtual std::unique_ptr<Layer> lastLayer() const;
614
623 virtual std::unique_ptr<Layer> layerByTitle(const std::string& title_) const;
624
633 virtual std::unique_ptr<Layer> layerAtIndex(const uint32_t index_) const;
634
643 virtual std::unique_ptr<Layer> insertLayer(const uint32_t pos_);
644
654 virtual std::unique_ptr<Layer> currentLayer();
655
663 virtual void setCurrentLayer(const Layer& layer_);
664
672 virtual uint32_t channelCount() const;
673
682 virtual std::string channelName(const uint32_t ci_) const;
683
692 virtual bool channelVisible(const uint32_t ci_) const;
693
701 virtual void setCurrentChannel(const uint32_t ci_);
702
712 virtual std::unique_ptr<XMPMeta> getXMP() const;
713
723 virtual void setXMP(const XMPMeta& xmp_);
724 #endif
725 // HDI_CORE_PSP_MODE
726
727
728 private:
729 #if defined(HDI_CORE_AIP_MODE)
730 friend aip::Document* __accessImpl(const Document&);
731 friend Document __accessCtor(aip::Document*&);
732
738 Document(aip::Document*&);
739 #elif defined(HDI_CORE_PSP_MODE)
740 friend psp::Document* __accessImpl(const Document&);
741 friend Document __accessCtor(psp::Document*&);
742
748 Document(psp::Document*&);
749 #endif
750
754 void* __data;
755
761 void* __impl() const;
762 };
763
764 typedef std::unique_ptr<Document> DocumentUP;
765 typedef std::shared_ptr<Document> DocumentSP;
766 typedef std::weak_ptr<Document> DocumentWP;
767
768 #if defined(HDI_CORE_AIP_MODE)
769 extern aip::Document* __accessImpl(const Document&);
770 extern Document __accessCtor(aip::Document*&);
771 #elif defined(HDI_CORE_PSP_MODE)
772 extern psp::Document* __accessImpl(const Document&);
773 extern Document __accessCtor(psp::Document*&);
774 #endif
775 }
776}
777
778#endif
779// __HDI_CORE_DOCUMENT__
Represents options when creating a new Illustrator document.
Definition: hdicoreDocument.h:50
ArtboardLayout
Controls how artboards are placed when creating a new document.
Definition: hdicoreDocument.h:95
RulerUnits rulerUnits
Controls the ruler units of the document.
Definition: hdicoreDocument.h:155
double artboardSpacing
How many points each artboard should be spaced from its neighbor.
Definition: hdicoreDocument.h:133
PreviewMode
Controls the preview mode of a new document.
Definition: hdicoreDocument.h:56
std::string title
UTF-8 title of the document. Empty ("") will result in a title like "Untitled-1", etc.
Definition: hdicoreDocument.h:113
uint32_t artboardCount
Number of artboards in the document. Cannot exceed maxArtboardCount.
Definition: hdicoreDocument.h:123
TransparencyGrid transparencyGrid
Controls the transparency grid color of the document.
Definition: hdicoreDocument.h:165
RasterResolution
Controls the raster resolution of a new document.
Definition: hdicoreDocument.h:82
ArtboardLayout artboardLayout
Controls how the artboards are placed.
Definition: hdicoreDocument.h:128
RasterResolution rasterResolution
Controls the raster resolution of the document.
Definition: hdicoreDocument.h:170
virtual ~Preset()
Destructs a Preset object.
PreviewMode previewMode
Controls the preview mode of the document.
Definition: hdicoreDocument.h:160
Preset()
Constructs a new Preset object with default values.
uint32_t artboardRowOrColumnSize
How many artboards should appear in each row or column before wrapping occurs.
Definition: hdicoreDocument.h:145
DocumentColorModel colorModel
Controls the color model of the document.
Definition: hdicoreDocument.h:150
static const uint32_t maxArtboardCount
Maximum number of artboards that Illustrator documents will support.
Definition: hdicoreDocument.h:108
Size size
Width and height of the document artboard.
Definition: hdicoreDocument.h:118
TransparencyGrid
Controls the transparency grid color of a new document.
Definition: hdicoreDocument.h:66
Allows one to interact with a document and its metadata (differs from CurrentDocument class)
Definition: hdicoreDocument.h:43
Document()
Constructs an empty Document object.
uint32_t artStyleCount() const
Gets the number of art styles in the document.
virtual void print(const bool showDialog_) const
Prints the target document.
virtual bool operator!=(const Document &rhs_) const
Checks whether one Document object does not represent the same document as another.
virtual bool isEmpty() const
Gets whether the target Document object is empty (constructed with the default ctor)
uint32_t symbolDefCount() const
Gets the number of symbol definitions in the document.
std::unique_ptr< ArtStyle > artStyleAtIndex(const uint32_t index_) const
Gets a given art style, by its index, in the target doc.
Document(const Preset &preset_, const bool showDialog_)
Creates a new document, and makes it current, from new document parameters.
virtual bool exists() const
Gets whether the document exists (is open or in the clipboard)
Document(const AIDocumentHandle aiDoc_)
Constructs a new Document object from an AIDocumentHandle.
virtual void activate() const
Activates (makes current) the target document.
virtual Document & operator=(const Document &rhs_)
Assigns one Document object to another.
virtual ~Document()
Document destructor.
Document(const std::string &preset_, const bool showDialog_)
Creates a new document, and makes it current, from a startup preset.
virtual AIDocumentHandle aiDocumentHandle() const
Gets the document handle around which the target object is wrapped.
virtual bool operator==(const Document &rhs_) const
Checks whether one Document object represents the same document as another.
Document(const Document &doc_)
Document copy constructor.
virtual std::string url() const
Gets the document URL.
std::unique_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 void save() const
Saves the target document.
Allows for layer metadata access, visibility manipulation, locking, etc.
Definition: hdicoreLayer.h:39
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Header file for describing 2D points.
Header file for describing 2D dimensions (width and height)
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
DocumentColorModel
Indicates the color model of new document.
Definition: hdicoreTypes.h:366
RulerUnits
Indicates the ruler units of a document.
Definition: hdicoreTypes.h:531