Adobe.com
Contents Suites Classes Class Index Member Index

AIFileFormat.h

Go to the documentation of this file.
00001 #ifndef __AIFileFormat__
00002 #define __AIFileFormat__
00003 
00004 /*
00005  *        Name: AIFileFormat.h
00006  *     Purpose: Adobe Illustrator File Format Suite.
00007  *
00008  * ADOBE SYSTEMS INCORPORATED
00009  * Copyright 1986-2014 Adobe Systems Incorporated.
00010  * All rights reserved.
00011  *
00012  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00013  * in accordance with the terms of the Adobe license agreement 
00014  * accompanying it. If you have received this file from a source other 
00015  * than Adobe, then your use, modification, or distribution of it 
00016  * requires the prior written permission of Adobe.
00017  *
00018  */
00019 
00020 
00021 /*******************************************************************************
00022  **
00023  **     Imports
00024  **
00025  **/
00026 
00027 #ifndef __AITypes__
00028 #include "AITypes.h"
00029 #endif
00030 
00031 #ifndef __AIPlugin__
00032 #include "AIPlugin.h"
00033 #endif
00034 
00035 #ifndef __AIArt__
00036 #include "AIArt.h"
00037 #endif
00038 
00039 #ifndef __AIPlaced__
00040 #include "AIPlaced.h"
00041 #endif
00042 
00043 #include "AIEntry.h"
00044 
00045 #include "IAIFilePath.hpp"
00046 #include "AIArtboardRange.h"
00047 #include "AIActionManager.h"
00048 
00049 #include "AIHeaderBegin.h"
00050 
00051 
00052 
00056 /*******************************************************************************
00057  **
00058  ** Constants
00059  **
00060  **/
00061 #define kAIFileFormatSuite                              "AI File Format Suite"
00062 #define kAIFileFormatSuiteVersion14             AIAPI_VERSION(14)                       // From AI 20.0
00063 #define kAIFileFormatSuiteVersion               kAIFileFormatSuiteVersion14
00064 #define kAIFileFormatVersion                    kAIFileFormatSuiteVersion
00065 
00066 
00067 #define kAIMacFileFormatSuite                   "AI Mac File Format Suite"
00068 #define kAIMacFileFormatSuiteVersion    AIAPI_VERSION(4)
00069 #define kAIMacFileFormatVersion                 kAIMacFileFormatSuiteVersion
00070 
00071 
00075 #define kCallerAIFileFormat                             "AI File Format"
00076 
00089 #define kSelectorAIGetFileFormatParameters      "AI Get Parameters"
00090 
00103 #define kSelectorAISetFileFormatParameters      "AI Set Parameters"
00104 
00113 #define kSelectorAIGoFileFormat                         "AI Go"
00114 
00123 #define kSelectorAICheckFileFormat                      "AI Check"
00124 
00133 #define kSelectorAIUpdateFileFormat                     "AI Update AI140"
00134 
00140 #define kAIFileFormatDocumentOpenedNotifier             "AI File Format Document Opened Notifier"
00141 
00148 #define kAIFileFormatLinkUpdateNotifier                 "AI File Format Link Update Notifier"
00149 
00150 
00167 enum AIFileFormatOptions {
00171         kFileFormatRead =                                                       (1<<0),
00176         kFileFormatExport =                                                     (1<<1),
00182         kFileFormatWrite =                                                      (1<<9),
00186         kFileFormatImportArt =                                          (1<<2),
00190         kFileFormatPlaceArt     =                                               (1<<3),
00195         kFileFormatConvertTemplate =                            (1<<7),
00199         kFileFormatLinkArt =                                            (1<<8),
00201         kFileFormatImportStyles =                                       (1<<4),
00205         kFileFormatSuppliesPrintRecordOption =          (1<<5),
00206 
00210         kFileFormatIsDefaultOption =                            (1<<6),
00211 
00216         kFileFormatNoAutoCheckFormat =                          (1<<10),
00220         kFileFormatCreateTemplateLayer =                        (1<<11),
00224         kFileFormatHasExtendedData =                            (1<<12),
00225 
00229         kFileFormatSkipStartupObjectsOption =           (1<<13),
00230 
00233         kFileFormatNoWarningOption =                            (1<<14),
00237         kFileFormatSaveCopyOption =                                     (1<<15),
00238 
00243         kFileFormatExportSelection =                            (1 << 16),
00244 
00249         kFileFormatBatchExport          =                               (1 << 17),
00250 
00253         kFileFormatSuppressPluginFileNameUniquify = (1 << 18),
00254 
00258         kFileFormatSuppressUI =                                         (1<<21),
00262         kFileFormatWriteAs =                                            (1<<22),
00263 
00268         kFileFormatCheckAlways =                                        (1<<23),
00269 
00277         kFileFormatContainsPartialParameters =          (1<<24),
00278 
00283         kFileFormatImportCompositeFonts =                       (1<<25),
00284 
00288         kFileFormatOpenUntitledCopy =                           (1<<26),
00289 
00293         kFileFormatWriteSwatchLibrary =                         (1<<27),
00297         kFileFormatWriteBrushLibrary =                          (1<<28),
00301         kFileFormatWriteStyleLibrary =                          (1<<29),
00305         kFileFormatWriteSymbolLibrary =                         (1<<30),
00312         kFileFormatWriteInTouch         =                               (1<<31)
00313 };
00314 
00318 #define kFileFormatWritePalettesOnly (kFileFormatWriteSwatchLibrary|kFileFormatWriteBrushLibrary|kFileFormatWriteStyleLibrary|kFileFormatWriteSymbolLibrary)
00319 
00320 
00323 #define kFileFormatExtensionStrMaxLength                31
00324 
00326 #define kFileFormatExtMaxLength                                 5
00327 
00332 #define kUnknownFormatErr                                               'FMT?'
00333 
00337 #define kInvalidFormatErr                                               'FMTi'
00338 
00344 #define kBadResolutionErr                                               'RES!' 
00345 
00351 enum AIFileFormatPriority {
00353         kAIFileFormatPriorityNative =                           10000,
00355         kAIFileFormatPriorityNormal     =                               0,
00357         kAIFileFormatPriorityLowest     =                               -10000
00358 };
00359 
00360 
00361 /*******************************************************************************
00362  **
00363  ** Types
00364  **
00365  **/
00366 
00369 typedef struct _t_AIFileFormatOpaque *AIFileFormatHandle;
00370 
00371 
00373 typedef struct PlatformAddFileFormatData4 {
00374         ai::int32 type;
00375         unsigned char *title;
00376         ai::int32 titleOrder;
00377 } PlatformAddFileFormatData4;
00378 
00381 typedef struct PlatformAddFileFormatData {
00384         ai::int32                       type;
00387         unsigned char*  title;
00390         ai::int32                       titleOrder;
00397         const char*                     extension;
00398 } PlatformAddFileFormatData;
00399 
00400 
00403 typedef struct PlatformAddFileFormatExData {
00405         ai::int32                       numTypes;
00407         ai::int32*                      typeList;
00410         unsigned char*  title;
00413         ai::int32                       titleOrder;
00420         const char*                     extension;
00421 } PlatformAddFileFormatExData;
00422 
00423 
00425 typedef struct AICreatorTypePair {
00427         long            creator;
00429         ai::int32               type;
00430 } AICreatorTypePair;
00431 
00432 
00434 // Extend File Format Message with
00435 // usage-specific data type.
00437 
00439 enum eFFExtType {
00440         /* No additional data required for this request */
00441         kFFExtNone,
00442         /* This is a placement request, which requires additional data */
00443         kFFExtPlaceRequest,
00444         /*      This is a import/export request, where additional data is
00445                 provided by the client to customize the request */
00446         kFFExtAdditionalOptions
00447 };
00448 
00450 // Extended options of plug-ins
00452 
00453 enum AIFFExtendedOptions{
00454         /* No Extended options is supported*/
00455         kNoExtendedOptions= (0),
00456         /* Save/Export of Multiple Artboards is supported */
00457         kSaveMultiArtboards= (1<<0),
00459         kDoNotExitTextEditingModeOption = ( 1 << 1),
00463         kFileFormatPlaceInTouch         =                               (1<<2)
00464 };
00465 
00466 
00468 enum eFFOperationOptions{
00469         /* Save/Export Multiple Artboards selected by the user*/
00470         kSaveMultiArtboardsSelected= (1<<0),
00471 };
00472 
00474 union FileFormatExtUnion {
00478         AIDictionaryRef m_AdditionalOptionsDict;
00480         AIPlaceRequestData *m_pPlaceRequestData;
00481 };
00482 
00484 typedef struct FileFormatExtData {
00486         ai::int32 m_lExtType;
00488         union FileFormatExtUnion m_unExt;
00490         FileFormatExtData() : m_lExtType(kFFExtNone)
00491         {
00492                 m_unExt.m_AdditionalOptionsDict = NULL;
00493         }
00494 } FileFormatExtData;
00495 
00497 // File Format message structure.
00499 
00501 struct AIFileFormatMessage {
00503         SPMessageData d;
00507         AIFileFormatHandle fileFormat;
00508 
00509         public:
00512         ai::int32 option;
00516         FileFormatExtData *m_pExtData;
00519         void *actionParm;
00520 
00521         private:
00525         ai::FilePath filePath;
00526 
00527         public:
00530         void SetFilePath(const ai::FilePath &fp);
00533         const ai::FilePath &GetFilePath() const;
00534 
00535         public:
00537         ai::int32 operationOptions;
00539         AIArtboardRangeHandle rangeHandle;
00540 
00541         public:
00542         AIFileFormatMessage() : fileFormat(NULL), option(0), m_pExtData(NULL),
00543                 actionParm(NULL), operationOptions(kNoExtendedOptions), rangeHandle(NULL)
00544         {}
00545 };
00546 
00549 struct AIUpdateFileFormatMessage {
00551         struct AIFileFormatMessage ffm;
00553         AIArtHandle art;
00555         void* data;
00556 };
00557 
00558 
00560 // The following enum and struct can be used to convey
00561 // information in conjunction with the Link Update
00562 // Artwork Notifier.
00564 
00566 enum eLinkUpdateType {
00569         kNormalUpdate,
00572         kLinkReplaced,
00575         kMissingLinkIgnored
00576 };
00577 
00579 struct AILinkUpdateNotifyData {
00581         ai::int32 m_iUpdateType;
00583         void *m_pvParam;
00584 };
00585 
00589 enum AIDocumentStartupProfile
00590 {
00591         kAIStartupProfileUnknown = 0,
00592         kAIStartupProfilePrint = 1,
00593         kAIStartupProfileWeb,
00594         kAIStartupProfileVideo,
00595         /* Unused. Not returned. Use \c kAIStartupProfilePrint instead. */
00596         kAIStartupProfileCMYK,
00597         /* Unused. Not returned. Use \c kAIStartupProfileWeb instead. */
00598         kAIStartupProfileRGB,
00599         kAIStartupProfileMobile
00600 };
00601 
00602 /*******************************************************************************
00603  **
00604  **     Suite
00605  **
00606  **/
00607 
00671 struct AIFileFormatSuite {
00672 
00714         AIAPI AIErr (*AddFileFormat) ( SPPluginRef self, const char *name,
00715                                 PlatformAddFileFormatData *data, ai::int32 options, AIFileFormatHandle *fileFormat ,  ai::int32 extendedOptions);
00716 
00722         AIAPI AIErr (*GetFileFormatName) ( AIFileFormatHandle fileFormat, char **name );
00723 
00729         AIAPI AIErr (*GetFileFormatOptions) ( AIFileFormatHandle fileFormat, ai::int32 *options );
00730 
00735         AIAPI AIErr (*SetFileFormatOptions) ( AIFileFormatHandle fileFormat, ai::int32 options );
00736 
00742         AIAPI AIErr (*GetFileFormatPlugin) ( AIFileFormatHandle fileFormat,
00743                                 SPPluginRef *plugin );
00744 
00749         AIAPI AIErr (*CountFileFormats) ( ai::int32 *count );
00750 
00757         AIAPI AIErr (*GetNthFileFormat) ( ai::int32 n, AIFileFormatHandle *fileFormat );
00758 
00763         AIAPI AIErr (*GetFileFormatExtension) ( AIFileFormatHandle fileFormat, char *extension );
00764 
00793         AIAPI AIErr (*AddFileFormatEx) ( SPPluginRef self, const char *name,
00794                                 PlatformAddFileFormatExData *dataEx, ai::int32 options, AIFileFormatHandle *fileFormat, ai::int32 extendedOptions );
00795 
00800         AIAPI AIErr (*GetFileFormatTitle) ( AIFileFormatHandle fileFormat, char *szTitle );
00801 
00809         AIAPI AIErr (*GetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 *maxNumTypes, ai::int32 *typeList );
00810 
00824         AIAPI AIErr (*SetFileFormatFilter) ( AIFileFormatHandle fileFormat, ai::int32 numPairs, AICreatorTypePair *pairList, const char* extensions );
00825 
00833         AIAPI AIErr (*GetFileFormatCreatorType) ( AIFileFormatHandle fileFormat, ai::int32 *maxNumPairs, AICreatorTypePair *pairList );
00834 
00847         AIAPI AIErr (*PutFile) (ai::int32 options, const unsigned char *dlgTitle, ai::FilePath &fileSpec, AIFileFormatHandle *fileFormat, AIBoolean *good );
00848 
00855         AIAPI AIErr (*SetFileFormatPriority) ( AIFileFormatHandle fileFormat, ai::int32 priority );
00856 
00864         AIAPI AIErr (*FindMatchingFileFormats) ( ai::int32 options, const ai::FilePath &file, ai::int32 maxMatches, AIFileFormatHandle matchingFormats[], ai::int32* numMatches );
00865 
00867         AIAPI AIErr (*ResolveImportConflicts) ();
00868 
00884         AIAPI AIVersion (*GetFirstVersionUsingPlacedArt) (AIFileFormatHandle fileFormat);
00885 
00894         AIAPI AIErr (*SetFirstVersionUsingPlacedArt) (AIFileFormatHandle fileFormat, AIVersion version);
00895 
00903         AIAPI AIErr (*GetFileStartupProfileType) (const ai::FilePath &file, AIDocumentStartupProfile *docStartupProfile);
00904 
00911         AIAPI AIErr (*GetStartupFileOfType) (const AIDocumentStartupProfile docStartupProfile, ai::FilePath &profile);
00912 
00923         AIAPI AIErr (*GetFileFormatExtendedOptions) ( AIFileFormatHandle fileFormat, ai::int32 *extendedOptions );
00924 
00935         AIAPI AIErr (*SetFileFormatExtendedOptions) ( AIFileFormatHandle fileFormat, ai::int32 extendedOptions);
00936 
00941         AIAPI AIErr(*GoExport) (AIActionParamValueRef actionParam);
00942 } ;
00943 
00944 
00946 typedef struct {
00947 
00948         AIAPI AIErr (*MacXGetFileFormatTitle) ( AIFileFormatHandle fileFormat, unsigned char *title );
00949         AIAPI AIErr (*MacXSetFileFormatTitle) ( AIFileFormatHandle fileFormat, const unsigned char *title );
00950         AIAPI AIErr (*MacXGetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 *type );
00951         AIAPI AIErr (*MacXSetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 type );
00952 
00953 } AIMacFileFormatSuite;
00954 
00955 
00956 #include "AIHeaderEnd.h"
00957 
00958 /*******************************************************************************
00959  **
00960  **     Inline members
00961  **
00962  **/
00963 inline void AIFileFormatMessage::SetFilePath(const ai::FilePath &fp)
00964 {
00965         filePath = fp;
00966 }
00967 
00968 inline const ai::FilePath &AIFileFormatMessage::GetFilePath() const
00969 {
00970         return filePath;
00971 }
00972 
00973 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2016 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks