Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicorePlacedArt.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_PLACED_ART__
8#define __HDI_CORE_PLACED_ART__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreArtboardRect.h"
14
15namespace hdi
16{
17 namespace core
18 {
19 class Art;
20
25 {
26 public:
31 {
32 PlacedTypeUnknown = 0,
33 PlacedTypeEPS = 10,
34 PlacedTypeOther = 20
35 };
36
41 {
42 PlaceMethodUnknown = 0,
43
44 // Preserve original dimensions regardless of bounding box size and transformations
45 PlaceMethodAsIs = 10,
46
47 // Fill bounding box while preserving proportions. Can overlap edges in one dimension.
48 PlaceMethodFill = 20,
49
50 // Fit fully inside bounding box while preserving proportions
51 PlaceMethodFit = 30,
52
53 // Fit to bounding box; replaced file preserves bounds but not proportions
54 PlaceMethodConform = 40,
55
56 // Fit to bounding box; replaced file preserves transformations and tries to preserve size
57 PlaceMethodReconform = 50
58 };
59
60 enum PlaceMode
61 {
62 // If the file can be read, it's simply placed
63 PlaceModeVanilla = 0,
64
65 // Consult selection for whether to place or replace. If exactly one placed object is selected, show
66 // "File.Place" dialog to query user on whether to simply place the new art, or use it to replace
67 // the selection.
68 PlaceModeQueryReplace = 10,
69
70 // Replaces the existing art
71 PlaceModeForceReplace = 20,
72
73 // Replace placed art with its parsed contents
74 PlaceModeUnlinkPlaced = 30,
75
76 // Unsupported by this library
77// PlaceModeCreateNewArt = 40,
78
79 // Like PlaceModeForceReplace, but validates the given file first
80 PlaceModeForceReplaceValidate = 50,
81
82 // Replace placed art with its parsed contents, querying user for parameters
83 PlaceModeQueryUnlinkPlaced = 60
84 };
85
92
105 static bool Create(
106 const PlaceMode mode_,
107 const std::string& path_,
108 const bool link_,
109 core::Art* const oldArt_,
110 core::Art& newArt__
111 );
112
121
129 std::string filePath() const;
130
138 void setFilePath(const std::string& path_);
139
149
157 void setMatrix(const core::TransformMatrix& matrix_);
158
168
177
188 bool options(PlaceMethod& method__, BoundsPinPointType& align__, bool& clip__);
189
199 void setOptions(const PlaceMethod method_, const BoundsPinPointType align_, const bool clip_);
200
201
202 private:
203 // Only Art can construct a new PlacedArt object
204 friend class Art;
205
209 void* __data;
210
216 PlacedArt();
217
225 PlacedArt(void* const art_);
226
232 PlacedArt(const PlacedArt&);
233
239 PlacedArt& operator=(const PlacedArt&);
240 };
241 }
242}
243
244#endif
245// HDI_CORE_AIP_MODE
246
247#endif
248// __HDI_CORE_PLACED_ART__
Handles general art-related functionality.
Definition: hdicoreArt.h:51
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:28
Allows for placed art manipulation, metadata access, etc.
Definition: hdicorePlacedArt.h:25
core::ArtboardRect bounds() const
Retrieves the boundary dimensions of placed art, regardless of the transformations applied to it.
PlacedType placedType() const
Gets the type of placed art.
core::TransformMatrix matrix() const
Retrieves the transformation matrix that positions the content of a placed art object's linked file i...
void setOptions(const PlaceMethod method_, const BoundsPinPointType align_, const bool clip_)
Sets the placement options for a placed object.
~PlacedArt()
Destructs a PlacedArt object.
void setBounds(const core::ArtboardRect &b_)
Sets the preliminary bounding box information for a placed object.
void setMatrix(const core::TransformMatrix &matrix_)
Sets the transformation matrix of the target placed art object.
PlacedType
Describes what type of data is placed.
Definition: hdicorePlacedArt.h:31
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.
PlaceMethod
Describes how the data has been placed.
Definition: hdicorePlacedArt.h:41
void setFilePath(const std::string &path_)
Sets the file path for the placed art.
std::string filePath() const
Gets the file path for the placed art.
bool options(PlaceMethod &method__, BoundsPinPointType &align__, bool &clip__)
Retrieves the placement options for a placed object.
Allows for 2-dimensional transformations in a single application via matrix math.
Definition: hdicoreTransformMatrix.h:34
Header file for geometric rectangle manipulation on the Illustrator artboard.
Header file for describing a 2D transformation matrix.
BoundsPinPointType
These allow for simpler art transformation/bounds metadata access.
Definition: hdicoreTypes.h:794