Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreFileFormat.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_FILE_FORMAT__
8#define __HDI_CORE_FILE_FORMAT__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <vector>
13
14#include "hdicoreTypes.h"
15
16namespace hdi
17{
18 namespace core
19 {
24 {
25 public:
26 typedef std::vector<std::string> ExtVector;
27
43 {
44 UnknownOptions = 0,
45
46 // Read the file, creating artwork in a new document. The format is included in the File > Open file
47 // types. Use when adding a format.
48 ReadOption = 1 << 0,
49
50 // Write the documentís contents to a file in a non-Illustrator format. The format is included in
51 // the File > Export file types. Use when adding a format.
52 ExportOption = 1 << 1,
53
54 // Write the documentís contents to a file in a format from which is can be read back into
55 // Illustrator without loss of data. The format is included in the File > Save As file types. Use
56 // when adding a format.
57 WriteOption = 1 << 9,
58
59 // Read the file and embed artwork to the current document. The format is included in the File >
60 // Import file types. Use when adding a format.
61 ImportArtOption = 1 << 2,
62
63 // Read the file and embed artwork to the current document. This is the same as ImportArtOption. Use
64 // when adding a format.
65 PlaceArtOption = 1 << 3,
66
67 // Allows "Template" to be checked in the Place dialog when linking or embedding a file of this type,
68 // so the art is placed in a template layer. Use when adding a format.
69 ConvertTemplateOption = 1 << 7,
70
71 // Make a link from the contents of a file to an Illustrator document. Use when adding a format.
72 LinkArtOption = 1 << 8,
73
74 // Unused!
75 ImportStylesOption = 1 << 4,
76
77 // Unused!
78 SuppliesPrintRecordOptionOption = 1 << 5,
79
80 // Makes this the default format for all documents. If specified by more than one plug-in, the last
81 // one becomes the default. Use when adding a format.
82 IsDefaultOptionOption = 1 << 6,
83
84 // The plug-in will not respond to the FileFormatCheckMessageType message. (For example, the
85 // PhotoShop adapter plug-in always returns that no error occurred. Use when adding a format.
86 NoAutoCheckFormatOption = 1 << 10,
87
88 // Read the file, creating artwork in a new template layer in the current document. Not used for
89 // adding a format.
90 CreateTemplateLayerOption = 1 << 11,
91
92 // Handle the extended data passed in a FileFormatGoMessageType message for a placement request. Use
93 // when adding a format.
94 HasExtendedDataOption = 1 << 12,
95
96 // This file format supplies its own startup objects (colors, patterns, and so on), Illustrator does
97 // not copy the startup file. Use when adding a format.
98 SkipStartupObjectsOptionOption = 1 << 13,
99
100 // Disable warning dialogs upon read and write. Not used for adding a format.
101 NoWarningOptionOption = 1 << 14,
102
103 // Write the current document to a copy of the file it was loaded from. Not used for adding a format.
104 SaveCopyOptionOption = 1 << 15,
105
106 // Prevents this file format from appearing in the file selection menu of the Open and Place dialogs.
107 // Use when adding a format.
108 SuppressUIOption = 1 << 21,
109
110 // Set in combination with \c #kFileFormatWrite for a Save As operation, to distinguish it from Save.
111 // Not used for adding a format.
112 WriteAsOption = 1 << 22,
113
114 // Always receive the Check message, even for operations this plug-in does not support. Allows an
115 // opportunity to explicitly reject operations on files matching this plug-in's type. Use when
116 // adding a format.
117 CheckAlwaysOption = 1 << 23,
118
119 // Handle additional parameters passed in the FileFormatMessage::actionParam() method. These
120 // supplement the usual parameters of the file format, and may not be complete. Can be used, for
121 // instance, for scripting or optimizing. If set in the FileFormatGoMessageType message for a plug-in
122 // that does not handle the option, you can ignore it. Not used for adding a format.
123 ContainsPartialParametersOption = 1 << 24,
124
125 // Import only the SLO composite fonts. Do not import artwork or other global objects, and do not
126 // perform font fauxing. Not used for adding a format.
127 ImportCompositeFontsOption = 1 << 25,
128
129 // Treat the file as stationary - that is, open a copy with an Untitled name. Use only in conjunction
130 // with ReadOption. Not used for adding a format.
131 OpenUntitledCopyOption = 1 << 26,
132
133 // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
134 // palettes and the global objects, directly or indirectly. Not used for adding a format.
135 WriteSwatchLibraryOption = 1 << 27,
136
137 // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
138 // palettes and the global objects, directly or indirectly. Not used for adding a format.
139 WriteBrushLibraryOption = 1 << 28,
140
141 // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
142 // palettes and the global objects, directly or indirectly. Not used for adding a format.
143 WriteStyleLibraryOption = 1 << 29,
144
145 // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
146 // palettes and the global objects, directly or indirectly. Not used for adding a format.
147 WriteSymbolLibraryOption = 1 << 30
148 };
149
154 {
155 NoExtendedOptions = 0,
156 SaveMultiArtboardsExtendedOption = 1 << 0
157 };
158
162 struct AddData
163 {
167 int32_t type;
168
172 std::string title;
173
179 int32_t titleOrder;
180
191 ExtVector extensions;
192
199
207 AddData(const AddData& d_);
208
214 virtual ~AddData();
215
224 AddData& operator=(const AddData& rhs_);
225 };
226
227 typedef std::unique_ptr<AddData> AddDataUP;
228 typedef std::shared_ptr<AddData> AddDataSP;
229 typedef std::weak_ptr<AddData> AddDataWP;
230
243
252
260 FileFormat(const AIFileFormatHandle aiFileFormat_);
261
274 const std::string& name_,
275 const AddData& data_,
276 const Options opt_,
277 const ExtendedOptions extOpt_
278 );
279
285 virtual ~FileFormat();
286
296 virtual FileFormat& operator=(const FileFormat& rhs_);
297
305 virtual bool isEmpty() const;
306
318 virtual AIFileFormatHandle aiFileFormatHandle() const;
319
328 virtual bool operator==(const FileFormat& rhs_) const;
329
338 virtual bool operator!=(const FileFormat& rhs_) const;
339
347 std::string name() const;
348
356 std::string title() const;
357
365 int32_t macType() const;
366
374 ExtVector extensions() const;
375
384
392 void setOptions(const Options opt_);
393
394
395 private:
396 friend class Illustrator;
397 friend void* __accessImpl(const FileFormat&);
398
402 void* __data;
403
409 void* __impl() const;
410
416 bool __add(std::string&, AddData&, Options&, ExtendedOptions&) const;
417 };
418
419 typedef std::unique_ptr<FileFormat> FileFormatUP;
420 typedef std::shared_ptr<FileFormat> FileFormatSP;
421 typedef std::weak_ptr<FileFormat> FileFormatWP;
422
423 extern void* __accessImpl(const FileFormat&);
424 }
425}
426
430);
431
435);
436
437#endif
438// HDI_CORE_AIP_MODE
439
440#endif
441// __HDI_CORE_FILE_FORMAT__
Describes a file format that Illustrator can either read or write.
Definition: hdicoreFileFormat.h:24
virtual AIFileFormatHandle aiFileFormatHandle() const
Gets the file format handle around which the target object is wrapped.
ExtendedOptions
Used to specify the extended capabilities of a file format.
Definition: hdicoreFileFormat.h:154
FileFormat(const std::string &name_, const AddData &data_, const Options opt_, const ExtendedOptions extOpt_)
Constructs a new FileFormat object from a name and some configuration options.
FileFormat()
Constructs an empty FileFormat object.
std::string title() const
Gets the display name of the target file format.
int32_t macType() const
Gets the Mac 4-char code file type identifier.
virtual FileFormat & operator=(const FileFormat &rhs_)
Assigns one FileFormat object to another.
virtual ~FileFormat()
FileFormat object destructor.
virtual bool operator==(const FileFormat &rhs_) const
Tests whether a given FileFormat object is the same as another.
virtual bool operator!=(const FileFormat &rhs_) const
Tests whether a given FileFormat object is not the same as another.
void setOptions(const Options opt_)
Sets the options flags of the target file format.
ExtVector extensions() const
Gets the supported file extensions of the target file format.
Options options() const
Gets the options flags of the target file format.
std::string name() const
Gets the unique internal name of the target file format.
FileFormat(const FileFormat &ff_)
Constructs a new FileFormat object from an existing FileFormat object (copy constructor)
Options
Used to specify the capabilities of a file format.
Definition: hdicoreFileFormat.h:43
FileFormat(const AIFileFormatHandle aiFileFormat_)
Constructs a new FileFormat object from an AIFileFormatHandle.
virtual bool isEmpty() const
Gets whether the target FileFormat object is empty (constructed with the default ctor)
Allows access to a wide variety of Illustrator app-related runtime attributes, documents,...
Definition: hdicoreIllustrator.h:47
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Wraps information needed to add a new file format.
Definition: hdicoreFileFormat.h:163
int32_t type
Mac 4-char code file identifier. Plug-ins on Windows can ignore this.
Definition: hdicoreFileFormat.h:167
AddData()
AddData constructor, setting default values for all members.
virtual ~AddData()
AddData destructor.
AddData(const AddData &d_)
AddData copy constructor, copying values from an existing AddData object.
int32_t titleOrder
Indicates the order of file format menu items, if the plug-in registers more than one.
Definition: hdicoreFileFormat.h:179
ExtVector extensions
Lists the DOS-style file extensions that are filtered in the Open dialog or appended to the file name...
Definition: hdicoreFileFormat.h:191
AddData & operator=(const AddData &rhs_)
Overloaded assignment operator, copying values from one AddData object to another.
std::string title
Description string to be shown in Illustrator's Save and Open dialogs, as UTF-8.
Definition: hdicoreFileFormat.h:172