Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreFileFormat.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_FILE_FORMAT__
8 #define __HDI_CORE_FILE_FORMAT__
9 
10 #include <vector>
11 
12 #include "hdicoreTypes.h"
13 
14 namespace hdi
15 {
16  namespace core
17  {
21  class FileFormat
22  {
23  public:
24  typedef std::vector<std::string> ExtVector;
25 
40  enum Options
41  {
42  UnknownOptions = 0,
43 
44  // Read the file, creating artwork in a new document. The format is included in the File > Open file
45  // types. Use when adding a format.
46  ReadOption = 1 << 0,
47 
48  // Write the documentís contents to a file in a non-Illustrator format. The format is included in
49  // the File > Export file types. Use when adding a format.
50  ExportOption = 1 << 1,
51 
52  // Write the documentís contents to a file in a format from which is can be read back into
53  // Illustrator without loss of data. The format is included in the File > Save As file types. Use
54  // when adding a format.
55  WriteOption = 1 << 9,
56 
57  // Read the file and embed artwork to the current document. The format is included in the File >
58  // Import file types. Use when adding a format.
59  ImportArtOption = 1 << 2,
60 
61  // Read the file and embed artwork to the current document. This is the same as ImportArtOption. Use
62  // when adding a format.
63  PlaceArtOption = 1 << 3,
64 
65  // Allows "Template" to be checked in the Place dialog when linking or embedding a file of this type,
66  // so the art is placed in a template layer. Use when adding a format.
67  ConvertTemplateOption = 1 << 7,
68 
69  // Make a link from the contents of a file to an Illustrator document. Use when adding a format.
70  LinkArtOption = 1 << 8,
71 
72  // Unused!
73  ImportStylesOption = 1 << 4,
74 
75  // Unused!
76  SuppliesPrintRecordOptionOption = 1 << 5,
77 
78  // Makes this the default format for all documents. If specified by more than one plug-in, the last
79  // one becomes the default. Use when adding a format.
80  IsDefaultOptionOption = 1 << 6,
81 
82  // The plug-in will not respond to the FileFormatCheckMessageType message. (For example, the
83  // PhotoShop adapter plug-in always returns that no error occurred. Use when adding a format.
84  NoAutoCheckFormatOption = 1 << 10,
85 
86  // Read the file, creating artwork in a new template layer in the current document. Not used for
87  // adding a format.
88  CreateTemplateLayerOption = 1 << 11,
89 
90  // Handle the extended data passed in a FileFormatGoMessageType message for a placement request. Use
91  // when adding a format.
92  HasExtendedDataOption = 1 << 12,
93 
94  // This file format supplies its own startup objects (colors, patterns, and so on), Illustrator does
95  // not copy the startup file. Use when adding a format.
96  SkipStartupObjectsOptionOption = 1 << 13,
97 
98  // Disable warning dialogs upon read and write. Not used for adding a format.
99  NoWarningOptionOption = 1 << 14,
100 
101  // Write the current document to a copy of the file it was loaded from. Not used for adding a format.
102  SaveCopyOptionOption = 1 << 15,
103 
104  // Prevents this file format from appearing in the file selection menu of the Open and Place dialogs.
105  // Use when adding a format.
106  SuppressUIOption = 1 << 21,
107 
108  // Set in combination with \c #kFileFormatWrite for a Save As operation, to distinguish it from Save.
109  // Not used for adding a format.
110  WriteAsOption = 1 << 22,
111 
112  // Always receive the Check message, even for operations this plug-in does not support. Allows an
113  // opportunity to explicitly reject operations on files matching this plug-in's type. Use when
114  // adding a format.
115  CheckAlwaysOption = 1 << 23,
116 
117  // Handle additional parameters passed in the FileFormatMessage::actionParam() method. These
118  // supplement the usual parameters of the file format, and may not be complete. Can be used, for
119  // instance, for scripting or optimizing. If set in the FileFormatGoMessageType message for a plug-in
120  // that does not handle the option, you can ignore it. Not used for adding a format.
121  ContainsPartialParametersOption = 1 << 24,
122 
123  // Import only the SLO composite fonts. Do not import artwork or other global objects, and do not
124  // perform font fauxing. Not used for adding a format.
125  ImportCompositeFontsOption = 1 << 25,
126 
127  // Treat the file as stationary - that is, open a copy with an Untitled name. Use only in conjunction
128  // with ReadOption. Not used for adding a format.
129  OpenUntitledCopyOption = 1 << 26,
130 
131  // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
132  // palettes and the global objects, directly or indirectly. Not used for adding a format.
133  WriteSwatchLibraryOption = 1 << 27,
134 
135  // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
136  // palettes and the global objects, directly or indirectly. Not used for adding a format.
137  WriteBrushLibraryOption = 1 << 28,
138 
139  // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
140  // palettes and the global objects, directly or indirectly. Not used for adding a format.
141  WriteStyleLibraryOption = 1 << 29,
142 
143  // An option for the native (PGF) AI File Format Writer, telling it to write out only the indicated
144  // palettes and the global objects, directly or indirectly. Not used for adding a format.
145  WriteSymbolLibraryOption = 1 << 30
146  };
147 
152  {
153  NoExtendedOptions = 0,
154  SaveMultiArtboardsExtendedOption = 1 << 0
155  };
156 
160  struct AddData
161  {
165  int32_t type;
166 
170  std::string title;
171 
177  int32_t titleOrder;
178 
189  ExtVector extensions;
190 
196  AddData();
197 
205  AddData(const AddData& d_);
206 
212  virtual ~AddData();
213 
222  AddData& operator=(const AddData& rhs_);
223  };
224 
225  typedef std::auto_ptr<AddData> AddDataAP;
226 
238  FileFormat();
239 
247  FileFormat(const FileFormat& ff_);
248 
256  FileFormat(const AIFileFormatHandle aiFileFormat_);
257 
269  FileFormat(
270  const std::string& name_,
271  const AddData& data_,
272  const Options opt_,
273  const ExtendedOptions extOpt_
274  );
275 
281  virtual ~FileFormat();
282 
292  virtual FileFormat& operator=(const FileFormat& rhs_);
293 
301  virtual bool isEmpty() const;
302 
314  virtual AIFileFormatHandle aiFileFormatHandle() const;
315 
324  virtual bool operator==(const FileFormat& rhs_) const;
325 
334  virtual bool operator!=(const FileFormat& rhs_) const;
335 
343  std::string name() const;
344 
352  std::string title() const;
353 
361  int32_t macType() const;
362 
370  ExtVector extensions() const;
371 
379  Options options() const;
380 
388  void setOptions(const Options opt_);
389 
390 
391  private:
392  friend class Illustrator;
393  friend void* __accessImpl(const FileFormat&);
394 
398  void* __data;
399 
405  void* __impl() const;
406 
412  bool __add(std::string&, AddData&, Options&, ExtendedOptions&) const;
413  };
414 
415  typedef std::auto_ptr<FileFormat> FileFormatAP;
416 
417  extern void* __accessImpl(const FileFormat&);
418  }
419 }
420 
424 );
425 
429 );
430 
431 #endif
432 // __HDI_CORE_FILE_FORMAT__
void setOptions(const Options opt_)
Sets the options flags of the target file format.
FileFormat()
Constructs an empty FileFormat object.
virtual ~FileFormat()
FileFormat object destructor.
virtual bool operator!=(const FileFormat &rhs_) const
Tests whether a given FileFormat object is not the same as another.
virtual AIFileFormatHandle aiFileFormatHandle() const
Gets the file format handle around which the target object is wrapped.
ExtVector extensions() const
Gets the supported file extensions of the target file format.
AddData & operator=(const AddData &rhs_)
Overloaded assignment operator, copying values from one AddData object to another.
ExtVector extensions
Lists the DOS-style file extensions that are filtered in the Open dialog or appended to the file name...
Definition: hdicoreFileFormat.h:189
AddData()
AddData constructor, setting default values for all members.
Wraps information needed to add a new file format.
Definition: hdicoreFileFormat.h:160
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Describes a file format that Illustrator can either read or write.
Definition: hdicoreFileFormat.h:21
int32_t macType() const
Gets the Mac 4-char code file type identifier.
Definition: hdicoreaiArray.h:12
Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc.
Definition: hdicoreIllustrator.h:48
ExtendedOptions
Used to specify the extended capabilities of a file format.
Definition: hdicoreFileFormat.h:151
std::string name() const
Gets the unique internal name of the target file format.
virtual bool isEmpty() const
Gets whether the target FileFormat object is empty (constructed with the default ctor) ...
virtual ~AddData()
AddData destructor.
std::string title() const
Gets the display name of the target file format.
std::string title
Description string to be shown in Illustrator's Save and Open dialogs, as UTF-8.
Definition: hdicoreFileFormat.h:170
int32_t titleOrder
Indicates the order of file format menu items, if the plug-in registers more than one...
Definition: hdicoreFileFormat.h:177
virtual FileFormat & operator=(const FileFormat &rhs_)
Assigns one FileFormat object to another.
Options options() const
Gets the options flags of the target file format.
Options
Used to specify the capabilities of a file format.
Definition: hdicoreFileFormat.h:40
virtual bool operator==(const FileFormat &rhs_) const
Tests whether a given FileFormat object is the same as another.
int32_t type
Mac 4-char code file identifier. Plug-ins on Windows can ignore this.
Definition: hdicoreFileFormat.h:165