00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __AIFileFormat__
00018 #define __AIFileFormat__
00019
00020
00021
00022
00023
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
00059
00060
00061 #define kAIFileFormatSuite "AI File Format Suite"
00062 #define kAIFileFormatSuiteVersion15 AIAPI_VERSION(15) // From AI 23.1
00063 #define kAIFileFormatSuiteVersion kAIFileFormatSuiteVersion15
00064 #define kAIFileFormatVersion kAIFileFormatSuiteVersion
00065
00066
00067 #define kAIMacFileFormatSuite "AI Mac File Format Suite"
00068 #define kAIMacFileFormatSuiteVersion AIAPI_VERSION(5)
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),
00172
00177 kFileFormatExport = (1 << 1),
00178
00182 kFileFormatImportArt = (1 << 2),
00183
00187 kFileFormatPlaceArt = (1 << 3),
00188
00190 kFileFormatImportStyles = (1 << 4),
00191
00195 kFileFormatSuppliesPrintRecordOption = (1 << 5),
00196
00200 kFileFormatIsDefaultOption = (1 << 6),
00201
00206 kFileFormatConvertTemplate = (1 << 7),
00207
00211 kFileFormatLinkArt = (1 << 8),
00212
00218 kFileFormatWrite = (1 << 9),
00219
00224 kFileFormatNoAutoCheckFormat = (1 << 10),
00225
00229 kFileFormatCreateTemplateLayer = (1 << 11),
00230
00234 kFileFormatHasExtendedData = (1 << 12),
00235
00239 kFileFormatSkipStartupObjectsOption = (1 << 13),
00240
00243 kFileFormatNoWarningOption = (1 << 14),
00244
00248 kFileFormatSaveCopyOption = (1 << 15),
00249
00254 kFileFormatExportSelection = (1 << 16),
00255
00260 kFileFormatBatchExport = (1 << 17),
00261
00264 kFileFormatSuppressPluginFileNameUniquify = (1 << 18),
00265
00273 kFileFormatOptimizeNetworkOperation = (1 << 19),
00274
00275
00276
00277 kFileFormatSaveInBackground = (1 << 20),
00278
00282 kFileFormatSuppressUI = (1 << 21),
00283
00287 kFileFormatWriteAs = (1 << 22),
00288
00293 kFileFormatCheckAlways = (1 << 23),
00294
00302 kFileFormatContainsPartialParameters = (1 << 24),
00303
00308 kFileFormatImportCompositeFonts = (1 << 25),
00309
00313 kFileFormatOpenUntitledCopy = (1 << 26),
00314
00318 kFileFormatWriteSwatchLibrary = (1 << 27),
00319
00323 kFileFormatWriteBrushLibrary = (1 << 28),
00324
00328 kFileFormatWriteStyleLibrary = (1 << 29),
00329
00333 kFileFormatWriteSymbolLibrary = (1 << 30),
00334
00341 kFileFormatWriteInTouch = (1 << 31)
00342 };
00343
00347 #define kFileFormatWritePalettesOnly (kFileFormatWriteSwatchLibrary|kFileFormatWriteBrushLibrary|kFileFormatWriteStyleLibrary|kFileFormatWriteSymbolLibrary)
00348
00349
00352 #define kFileFormatExtensionStrMaxLength 31
00353
00355 #define kFileFormatExtMaxLength 5
00356
00361 #define kUnknownFormatErr 'FMT?'
00362
00366 #define kInvalidFormatErr 'FMTi'
00367
00372 #define kBadResolutionErr 'RES!'
00373
00378 #define kOptimizedNetworkSaveFailedErr 'ONSF'
00379
00385 enum AIFileFormatPriority {
00387 kAIFileFormatPriorityNative = 10000,
00389 kAIFileFormatPriorityNormal = 0,
00391 kAIFileFormatPriorityLowest = -10000
00392 };
00393
00394
00395
00396
00397
00398
00399
00400
00403 typedef struct _t_AIFileFormatOpaque *AIFileFormatHandle;
00404
00405
00407 typedef struct PlatformAddFileFormatData4 {
00408 ai::int32 type;
00409 unsigned char *title;
00410 ai::int32 titleOrder;
00411 } PlatformAddFileFormatData4;
00412
00415 typedef struct PlatformAddFileFormatData {
00418 ai::int32 type;
00421 ai::UnicodeString title;
00424 ai::int32 titleOrder;
00431 ai::UnicodeString extension;
00432 } PlatformAddFileFormatData;
00433
00434
00437 typedef struct PlatformAddFileFormatExData {
00439 ai::int32 numTypes;
00441 ai::int32* typeList;
00444 ai::UnicodeString title;
00447 ai::int32 titleOrder;
00454 ai::UnicodeString extension;
00455 } PlatformAddFileFormatExData;
00456
00457
00459 typedef struct AICreatorTypePair {
00461 long creator;
00463 ai::int32 type;
00464 } AICreatorTypePair;
00465
00466
00468
00469
00471
00473 enum eFFExtType {
00474
00475 kFFExtNone,
00476
00477 kFFExtPlaceRequest,
00478
00479
00480 kFFExtAdditionalOptions
00481 };
00482
00484
00486
00487 enum AIFFExtendedOptions{
00488
00489 kNoExtendedOptions= (0),
00490
00491 kSaveMultiArtboards= (1<<0),
00493 kDoNotExitTextEditingModeOption = ( 1 << 1),
00497 kFileFormatPlaceInTouch = (1<<2),
00499 kDoNotHonourDocumentScaleOnPlace = (1<<3),
00500
00501
00502
00503 kFileFormatSupportsLargeCanvas = (1 << 4)
00504 };
00505
00506
00508 enum eFFOperationOptions{
00509
00510 kSaveMultiArtboardsSelected= (1<<0),
00511 };
00512
00514 union FileFormatExtUnion {
00518 AIDictionaryRef m_AdditionalOptionsDict;
00520 AIPlaceRequestData *m_pPlaceRequestData;
00521 };
00522
00524 typedef struct FileFormatExtData {
00526 ai::int32 m_lExtType;
00529 union FileFormatExtUnion m_unExt;
00531 FileFormatExtData() : m_lExtType(kFFExtNone)
00532 {
00533 m_unExt.m_AdditionalOptionsDict = NULL;
00534 }
00535 } FileFormatExtData;
00536
00538
00540
00542 struct AIFileFormatMessage {
00544 SPMessageData d;
00548 AIFileFormatHandle fileFormat;
00549
00550 public:
00553 ai::int32 option;
00557 FileFormatExtData *m_pExtData;
00560 void *actionParm;
00561
00562 private:
00566 ai::FilePath filePath;
00567
00568 public:
00571 void SetFilePath(const ai::FilePath &fp);
00574 const ai::FilePath &GetFilePath() const;
00575
00576 public:
00578 ai::int32 operationOptions;
00580 AIArtboardRangeHandle rangeHandle;
00581
00582 public:
00583 AIFileFormatMessage() : fileFormat(NULL), option(0), m_pExtData(NULL),
00584 actionParm(NULL), operationOptions(kNoExtendedOptions), rangeHandle(NULL)
00585 {}
00586 };
00587
00590 struct AIUpdateFileFormatMessage {
00592 struct AIFileFormatMessage ffm;
00594 AIArtHandle art;
00596 void* data;
00597 };
00598
00599
00601
00602
00603
00605
00607 enum eLinkUpdateType {
00610 kNormalUpdate,
00613 kLinkReplaced,
00616 kMissingLinkIgnored
00617 };
00618
00620 struct AILinkUpdateNotifyData {
00622 ai::int32 m_iUpdateType;
00624 void *m_pvParam;
00625 };
00626
00630 enum AIDocumentStartupProfile
00631 {
00632 kAIStartupProfileUnknown = 0,
00633 kAIStartupProfilePrint = 1,
00634 kAIStartupProfileWeb,
00635 kAIStartupProfileVideo,
00636
00637 kAIStartupProfileCMYK,
00638
00639 kAIStartupProfileRGB,
00640 kAIStartupProfileMobile
00641 };
00642
00643
00644
00645
00646
00647
00648
00712 struct AIFileFormatSuite {
00713
00755 AIAPI AIErr (*AddFileFormat) ( SPPluginRef self, const char* name,
00756 PlatformAddFileFormatData *data, ai::int32 options, AIFileFormatHandle *fileFormat , ai::int32 extendedOptions);
00757
00763 AIAPI AIErr (*GetFileFormatName) ( AIFileFormatHandle fileFormat, const char **name );
00764
00770 AIAPI AIErr (*GetFileFormatOptions) ( AIFileFormatHandle fileFormat, ai::int32 *options );
00771
00776 AIAPI AIErr (*SetFileFormatOptions) ( AIFileFormatHandle fileFormat, ai::int32 options );
00777
00783 AIAPI AIErr (*GetFileFormatPlugin) ( AIFileFormatHandle fileFormat,
00784 SPPluginRef *plugin );
00785
00790 AIAPI AIErr (*CountFileFormats) ( ai::int32 *count );
00791
00798 AIAPI AIErr (*GetNthFileFormat) ( ai::int32 n, AIFileFormatHandle *fileFormat );
00799
00804 AIAPI AIErr (*GetFileFormatExtension) ( AIFileFormatHandle fileFormat, ai::UnicodeString& extension );
00805
00834 AIAPI AIErr (*AddFileFormatEx) ( SPPluginRef self, const char* name,
00835 PlatformAddFileFormatExData *dataEx, ai::int32 options, AIFileFormatHandle *fileFormat, ai::int32 extendedOptions );
00836
00841 AIAPI AIErr (*GetFileFormatTitle) ( AIFileFormatHandle fileFormat, ai::UnicodeString& szTitle );
00842
00850 AIAPI AIErr (*GetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 *maxNumTypes, ai::int32 *typeList );
00851
00865 AIAPI AIErr (*SetFileFormatFilter) ( AIFileFormatHandle fileFormat, ai::int32 numPairs, AICreatorTypePair *pairList, const ai::UnicodeString& extensions );
00866
00874 AIAPI AIErr (*GetFileFormatCreatorType) ( AIFileFormatHandle fileFormat, ai::int32 *maxNumPairs, AICreatorTypePair *pairList );
00875
00888 AIAPI AIErr (*PutFile) (ai::int32 options, const unsigned char *dlgTitle, ai::FilePath &fileSpec, AIFileFormatHandle *fileFormat, AIBoolean *good );
00889
00896 AIAPI AIErr (*SetFileFormatPriority) ( AIFileFormatHandle fileFormat, ai::int32 priority );
00897
00905 AIAPI AIErr (*FindMatchingFileFormats) ( ai::int32 options, const ai::FilePath &file, ai::int32 maxMatches, AIFileFormatHandle matchingFormats[], ai::int32* numMatches );
00906
00908 AIAPI AIErr (*ResolveImportConflicts) ();
00909
00925 AIAPI AIVersion (*GetFirstVersionUsingPlacedArt) (AIFileFormatHandle fileFormat);
00926
00935 AIAPI AIErr (*SetFirstVersionUsingPlacedArt) (AIFileFormatHandle fileFormat, AIVersion version);
00936
00944 AIAPI AIErr (*GetFileStartupProfileType) (const ai::FilePath &file, AIDocumentStartupProfile *docStartupProfile);
00945
00952 AIAPI AIErr (*GetStartupFileOfType) (const AIDocumentStartupProfile docStartupProfile, ai::FilePath &profile);
00953
00964 AIAPI AIErr (*GetFileFormatExtendedOptions) ( AIFileFormatHandle fileFormat, ai::int32 *extendedOptions );
00965
00976 AIAPI AIErr (*SetFileFormatExtendedOptions) ( AIFileFormatHandle fileFormat, ai::int32 extendedOptions);
00977
00982 AIAPI AIErr(*GoExport) (AIActionParamValueRef actionParam);
00983 } ;
00984
00985
00987 typedef struct {
00988
00989 AIAPI AIErr (*MacXGetFileFormatTitle) ( AIFileFormatHandle fileFormat, ai::UnicodeString& title );
00990 AIAPI AIErr (*MacXSetFileFormatTitle) ( AIFileFormatHandle fileFormat, ai::UnicodeString title );
00991 AIAPI AIErr (*MacXGetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 *type );
00992 AIAPI AIErr (*MacXSetFileFormatType) ( AIFileFormatHandle fileFormat, ai::int32 type );
00993
00994 } AIMacFileFormatSuite;
00995
00996
00997 #include "AIHeaderEnd.h"
00998
00999
01000
01001
01002
01003
01004 inline void AIFileFormatMessage::SetFilePath(const ai::FilePath &fp)
01005 {
01006 filePath = fp;
01007 }
01008
01009 inline const ai::FilePath &AIFileFormatMessage::GetFilePath() const
01010 {
01011 return filePath;
01012 }
01013
01014 #endif