Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Classes | Public Types | Public Member Functions | Friends | List of all members
hdi::core::FileFormat Class Reference

Describes a file format that Illustrator can either read or write. More...

#include <hdicoreFileFormat.h>

Classes

struct  AddData
 Wraps information needed to add a new file format. More...
 

Public Types

enum  Options {
  UnknownOptions = 0, ReadOption = 1 << 0, ExportOption = 1 << 1, WriteOption = 1 << 9,
  ImportArtOption = 1 << 2, PlaceArtOption = 1 << 3, ConvertTemplateOption = 1 << 7, LinkArtOption = 1 << 8,
  ImportStylesOption = 1 << 4, SuppliesPrintRecordOptionOption = 1 << 5, IsDefaultOptionOption = 1 << 6, NoAutoCheckFormatOption = 1 << 10,
  CreateTemplateLayerOption = 1 << 11, HasExtendedDataOption = 1 << 12, SkipStartupObjectsOptionOption = 1 << 13, NoWarningOptionOption = 1 << 14,
  SaveCopyOptionOption = 1 << 15, SuppressUIOption = 1 << 21, WriteAsOption = 1 << 22, CheckAlwaysOption = 1 << 23,
  ContainsPartialParametersOption = 1 << 24, ImportCompositeFontsOption = 1 << 25, OpenUntitledCopyOption = 1 << 26, WriteSwatchLibraryOption = 1 << 27,
  WriteBrushLibraryOption = 1 << 28, WriteStyleLibraryOption = 1 << 29, WriteSymbolLibraryOption = 1 << 30
}
 Used to specify the capabilities of a file format. More...
 
enum  ExtendedOptions { NoExtendedOptions = 0, SaveMultiArtboardsExtendedOption = 1 << 0 }
 Used to specify the extended capabilities of a file format.
 
typedef std::vector< std::string > ExtVector
 
typedef std::auto_ptr< AddDataAddDataAP
 

Public Member Functions

 FileFormat ()
 Constructs an empty FileFormat object. More...
 
 FileFormat (const FileFormat &ff_)
 Constructs a new FileFormat object from an existing FileFormat object (copy constructor) More...
 
 FileFormat (const AIFileFormatHandle aiFileFormat_)
 Constructs a new FileFormat object from an AIFileFormatHandle. More...
 
 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. More...
 
virtual ~FileFormat ()
 FileFormat object destructor. More...
 
virtual FileFormatoperator= (const FileFormat &rhs_)
 Assigns one FileFormat object to another. More...
 
virtual bool isEmpty () const
 Gets whether the target FileFormat object is empty (constructed with the default ctor) More...
 
virtual AIFileFormatHandle aiFileFormatHandle () const
 Gets the file format handle around which the target object is wrapped. More...
 
virtual bool operator== (const FileFormat &rhs_) const
 Tests whether a given FileFormat object is the same as another. More...
 
virtual bool operator!= (const FileFormat &rhs_) const
 Tests whether a given FileFormat object is not the same as another. More...
 
std::string name () const
 Gets the unique internal name of the target file format. More...
 
std::string title () const
 Gets the display name of the target file format. More...
 
int32_t macType () const
 Gets the Mac 4-char code file type identifier. More...
 
ExtVector extensions () const
 Gets the supported file extensions of the target file format. More...
 
Options options () const
 Gets the options flags of the target file format. More...
 
void setOptions (const Options opt_)
 Sets the options flags of the target file format. More...
 

Friends

class Illustrator
 
void * __accessImpl (const FileFormat &)
 

Detailed Description

Describes a file format that Illustrator can either read or write.

Member Enumeration Documentation

Used to specify the capabilities of a file format.

A subset of options are used with the FileFormat constructor that creates wholly new Illustrator file formats. These options specify which operations are supported, and are also sent in a FileFormatMessage to indicate the requested action. Additional options can be set in the FileFormatGoMessageType message to provide more information about the requested operation.

Note
The read, embed (import/place), and link operations are very similar in execution. In all cases, Illustrator creates an empty artwork and send the plug-in a message to read the file into the artwork. Special handling is required only if the plug-in needs to do different things depending on the type of operation; for example, the Photoshop file format plug-in has options for preserving Photoshop's layers if it is not linking.

Constructor & Destructor Documentation

hdi::core::FileFormat::FileFormat ( )

Constructs an empty FileFormat object.

Author
GW
Date
12/2014
Note
To test if a FileFormat object is empty, call isEmpty() on it
Empty FileFormat objects do not relate to any actual Illustrator file format; they are designed to be "receivers" of some other FileFormat object via the overloaded assignment operator. Empty FileFormat objects are useless until such time (though it is safe to call any of their methods)
hdi::core::FileFormat::FileFormat ( const FileFormat ff_)

Constructs a new FileFormat object from an existing FileFormat object (copy constructor)

Author
GW
Date
12/2014
Parameters
ff_Existing FileFormat object
hdi::core::FileFormat::FileFormat ( const AIFileFormatHandle  aiFileFormat_)

Constructs a new FileFormat object from an AIFileFormatHandle.

Author
GW
Date
12/2014
Parameters
aiFileFormat_Raw Illustrator AIFileFormatHandle
hdi::core::FileFormat::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.

Author
GW
Date
12/2014
Parameters
name_Unique name for the file format, as UTF-8
data_Data that further describes the file format to be added
opt_File format operations that this plug-in supports; a bitwise OR of the Options enum values marked as being applicable to adding a new format
extOpt_Extended capabilities of the new format
virtual hdi::core::FileFormat::~FileFormat ( )
virtual

FileFormat object destructor.

Author
GW
Date
12/2014

Member Function Documentation

virtual AIFileFormatHandle hdi::core::FileFormat::aiFileFormatHandle ( ) const
virtual

Gets the file format handle around which the target object is wrapped.

Author
GW
Date
12/2014
Returns
AIFileFormatHandle for this object
Note
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of functionality provided by Illustrator is not handled by this class (or related classes), then it should probably be added to the hdi_core library.
ExtVector hdi::core::FileFormat::extensions ( ) const

Gets the supported file extensions of the target file format.

Author
GW
Date
12/2014
Returns
The file extension strings, as UTF-8
virtual bool hdi::core::FileFormat::isEmpty ( ) const
virtual

Gets whether the target FileFormat object is empty (constructed with the default ctor)

Author
GW
Date
12/2014
Returns
true if the target FileFormat object is empty, false otherwise
int32_t hdi::core::FileFormat::macType ( ) const

Gets the Mac 4-char code file type identifier.

Author
GW
Date
12/2014
Returns
The file Mac ID
std::string hdi::core::FileFormat::name ( ) const

Gets the unique internal name of the target file format.

Author
GW
Date
12/2014
Returns
The format name, as UTF-8
virtual bool hdi::core::FileFormat::operator!= ( const FileFormat rhs_) const
virtual

Tests whether a given FileFormat object is not the same as another.

Author
GW
Date
12/2014
Parameters
rhs_FileFormat to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different file formats, false otherwise
virtual FileFormat& hdi::core::FileFormat::operator= ( const FileFormat rhs_)
virtual

Assigns one FileFormat object to another.

Author
GW
Date
12/2014
Parameters
rhs_Existing FileFormat object to copy values from
Returns
The target FileFormat object, but with its values updated to match that of the rhs_ argument
virtual bool hdi::core::FileFormat::operator== ( const FileFormat rhs_) const
virtual

Tests whether a given FileFormat object is the same as another.

Author
GW
Date
12/2014
Parameters
rhs_FileFormat to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same file format, false otherwise
Options hdi::core::FileFormat::options ( ) const

Gets the options flags of the target file format.

Author
GW
Date
12/2014
Returns
A bitwise OR of Options enum values
void hdi::core::FileFormat::setOptions ( const Options  opt_)

Sets the options flags of the target file format.

Author
GW
Date
12/2014
Parameters
opt_New options flags; a bitwise OR of Options enum values
std::string hdi::core::FileFormat::title ( ) const

Gets the display name of the target file format.

Author
GW
Date
12/2014
Returns
The format title, as UTF-8