Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicorePlacedArt.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_PLACED_ART__
8 #define __HDI_CORE_PLACED_ART__
9 
10 #include "hdicoreArtboardRect.h"
11 #include "hdicoreTransformMatrix.h"
12 
13 namespace hdi
14 {
15  namespace core
16  {
17  class Art;
18 
22  class PlacedArt
23  {
24  public:
29  {
30  PlacedTypeUnknown = 0,
31  PlacedTypeEPS = 10,
32  PlacedTypeOther = 20
33  };
34 
39  {
40  PlaceMethodUnknown = 0,
41 
42  // Preserve original dimensions regardless of bounding box size and transformations
43  PlaceMethodAsIs = 10,
44 
45  // Fill bounding box while preserving proportions. Can overlap edges in one dimension.
46  PlaceMethodFill = 20,
47 
48  // Fit fully inside bounding box while preserving proportions
49  PlaceMethodFit = 30,
50 
51  // Fit to bounding box; replaced file preserves bounds but not proportions
52  PlaceMethodConform = 40,
53 
54  // Fit to bounding box; replaced file preserves transformations and tries to preserve size
55  PlaceMethodReconform = 50
56  };
57 
58  enum PlaceMode
59  {
60  // If the file can be read, it's simply placed
61  PlaceModeVanilla = 0,
62 
63  // Consult selection for whether to place or replace. If exactly one placed object is selected, show
64  // "File.Place" dialog to query user on whether to simply place the new art, or use it to replace
65  // the selection.
66  PlaceModeQueryReplace = 10,
67 
68  // Replaces the existing art
69  PlaceModeForceReplace = 20,
70 
71  // Replace placed art with its parsed contents
72  PlaceModeUnlinkPlaced = 30,
73 
74  // Unsupported by CORE
75 // PlaceModeCreateNewArt = 40,
76 
77  // Like PlaceModeForceReplace, but validates the given file first
78  PlaceModeForceReplaceValidate = 50,
79 
80  // Replace placed art with its parsed contents, querying user for parameters
81  PlaceModeQueryUnlinkPlaced = 60
82  };
83 
89  ~PlacedArt();
90 
103  static bool Create(
104  const PlaceMode mode_,
105  const std::string& path_,
106  const bool link_,
107  core::Art* const oldArt_,
108  core::Art& newArt__
109  );
110 
118  PlacedType placedType() const;
119 
127  std::string filePath() const;
128 
136  void setFilePath(const std::string& path_);
137 
147 
155  void setMatrix(const core::TransformMatrix& matrix_);
156 
165  core::ArtboardRect bounds() const;
166 
174  void setBounds(const core::ArtboardRect& b_);
175 
186  bool options(PlaceMethod& method__, BoundsPinPointType& align__, bool& clip__);
187 
197  void setOptions(const PlaceMethod method_, const BoundsPinPointType align_, const bool clip_);
198 
199 
200  private:
201  // Only Art can construct a new PlacedArt object
202  friend class Art;
203 
207  Art* __art;
208 
214  PlacedArt();
215 
223  PlacedArt(Art* const art_);
224 
230  PlacedArt(const PlacedArt&);
231 
237  PlacedArt& operator=(const PlacedArt&);
238  };
239  }
240 }
241 
242 #endif
243 // __HDI_CORE_PLACED_ART__
void setFilePath(const std::string &path_)
Sets the file path for the placed art.
void setOptions(const PlaceMethod method_, const BoundsPinPointType align_, const bool clip_)
Sets the placement options for a placed object.
Handles general art-related functionality.
Definition: hdicoreArt.h:47
core::ArtboardRect bounds() const
Retrieves the boundary dimensions of placed art, regardless of the transformations applied to it...
bool options(PlaceMethod &method__, BoundsPinPointType &align__, bool &clip__)
Retrieves the placement options for a placed object.
PlaceMethod
Describes how the data has been placed.
Definition: hdicorePlacedArt.h:38
Header file for describing a 2D transformation matrix.
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
Header file for geometric rectangle manipulation on the Illustrator artboard.
Allows for 2-dimensional transformations in a single application via matrix math. ...
Definition: hdicoreTransformMatrix.h:26
PlacedType
Describes what type of data is placed.
Definition: hdicorePlacedArt.h:28
std::string filePath() const
Gets the file path for the placed art.
Definition: hdicoreaiArray.h:12
core::TransformMatrix matrix() const
Retrieves the transformation matrix that positions the content of a placed art object's linked file i...
Allows for placed art manipulation, metadata access, etc.
Definition: hdicorePlacedArt.h:22
static bool Create(const PlaceMode mode_, const std::string &path_, const bool link_, core::Art *const oldArt_, core::Art &newArt__)
Creates a new piece of art of type ArtTypePlaced.
void setMatrix(const core::TransformMatrix &matrix_)
Sets the transformation matrix of the target placed art object.
PlacedType placedType() const
Gets the type of placed art.
void setBounds(const core::ArtboardRect &b_)
Sets the preliminary bounding box information for a placed object.
~PlacedArt()
Destructs a PlacedArt object.