Adobe.com
Contents Suites Classes Class Index Member Index

AISwatchList.h

Go to the documentation of this file.
00001 #ifndef __AISwatchList__
00002 #define __AISwatchList__
00003 
00004 /*
00005  *        Name: AISwatchList.h
00006  *      Author:
00007  *        Date:
00008  *     Purpose: Adobe Illustrator Swatch list management
00009  *
00010  * ADOBE SYSTEMS INCORPORATED
00011  * Copyright 1986-2007 Adobe Systems Incorporated.
00012  * All rights reserved.
00013  *
00014  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00015  * in accordance with the terms of the Adobe license agreement 
00016  * accompanying it. If you have received this file from a source other 
00017  * than Adobe, then your use, modification, or distribution of it 
00018  * requires the prior written permission of Adobe.
00019  *
00020  */
00021 
00022 
00023 /*******************************************************************************
00024  **
00025  **     Imports
00026  **
00027  **/
00028 
00029 #ifndef __AITypes__
00030 #include "AITypes.h"
00031 #endif
00032 
00033 #ifndef __AIColor__
00034 #include "AIColor.h"
00035 #endif
00036 
00037 #ifndef __AIDocument__
00038 #include "AIDocument.h"
00039 #endif
00040 
00041 #include "AIHeaderBegin.h"
00042 
00045 /*******************************************************************************
00046  **
00047  ** Constants
00048  **
00049  **/
00050 #define kAISwatchListSuite                                      "AI Swatch List Suite"
00051 #define kAISwatchListSuiteVersion7                      AIAPI_VERSION(7)
00052 #define kAISwatchListSuiteVersion                       kAISwatchListSuiteVersion7
00053 #define kAISwatchListVersion                            kAISwatchListSuiteVersion
00054 
00055 #define kAISwatchGroupSuite                                     "AI Swatch Group Suite"
00056 #define kAISwatchGroupSuiteVersion3                     AIAPI_VERSION(3)
00057 #define kAISwatchGroupSuiteVersion                      kAISwatchGroupSuiteVersion3
00058 #define kAISwatchGroupVersion                           kAISwatchGroupSuiteVersion
00059 
00063 #define kAISwatchLibraryDialogChangedNotifier                           "AI Swatch Library Dialog Changed Notifier"
00064 
00071 #define kAISwatchListChangedNotifier                            "AI Swatch List Changed Notifier"
00072 
00077 #define kAISwatchListChangedInternallyNotifier          "AI Swatch List Changed Internally Notifier"
00078 
00080 #define kAISwatchReplaceColorNotifier                           "AI Swatch Replace Color Notifier"      // used only by SwatchLib
00081 
00083 #define kAICreateNewSwatchNotifier                                      "AI Create New Swatch Notifier" // used only by PaintStyle
00084 
00087 #define kAIDeleteSwatchNotifier                    "AI Delete Selected Swatch Notifier"    // used only by PaintStyle
00088 
00091 #define kAICreateNewSwatchWithDefaultParamNotifier                                      "AI Create New Swatch With Default Param Notifier"      // used only by PaintStyle
00092 
00095 #define kAIDocSwatchesSelectionChangedNotifier          "AI Doc Swatches Selection Changed Notifier"
00096 
00099 #define kCantDeleteSwatchErr                            '!XDS'
00100 
00102 #define kInvalidSwatchTypeForDest                       '!vST'
00103 
00105 #define kTooManySwatchGroupsErr                         '>#sg'
00106 
00108 #define kTooManySwatchesInGrpErr                        '>#sw'
00109 
00111 #define kMaxNumberSwatchGroups          ((ASInt16) 0x7FFF)      // 32767
00112 
00113 #define kMaxNumberSwatchesPerGroup      ((ASInt16) 0xFFFF)      // 65535
00114 
00115 /*******************************************************************************
00116  **
00117  **     Types
00118  **
00119  **/
00120 
00122 typedef struct _AISwatchOpaque *AISwatchRef;
00124 typedef struct _AISwatchListOpaque *AISwatchListRef;
00125 
00127 typedef struct _AISwatchGroupOpaque *AISwatchGroupRef;
00128 
00132 typedef enum
00133 {
00136         kAISGKindGeneric,
00139         kAISGKindSolidColorsOnly,
00141         kAISGKindPatternsOnly,
00143         kAISGKindGradientsOnly
00144 }  AISwatchGroupKind;
00145 
00146 /*******************************************************************************
00147  **
00148  **     Suite
00149  **
00150  **/
00151 
00185 typedef struct {
00186 
00192         ai::int32 ASAPI (*CountSwatches)                                (AISwatchListRef list);
00193 
00200         AISwatchRef ASAPI (*GetFirstSwatch)             (AISwatchListRef list);
00201 
00214         AISwatchRef ASAPI (*GetNextSwatch)              (AISwatchRef prev);
00215 
00223         AISwatchRef ASAPI (*GetNthSwatch)               (AISwatchListRef list, ai::int32 index);
00224 
00231         AISwatchRef ASAPI (*GetSwatchByName)    (AISwatchListRef list, const ai::UnicodeString& name);
00232 
00249         AISwatchRef ASAPI (*InsertNthSwatch)    (AISwatchListRef list, ai::int32 index);
00250 
00260         ASErr ASAPI (*RemoveNthSwatch)                  (AISwatchListRef list, ai::int32 index);
00261 
00267         ASErr ASAPI (*GetAIColor)                               (AISwatchRef swatch, AIColor *aicolor);
00268 
00276         ASErr ASAPI (*SetAIColor)                               (AISwatchRef swatch, AIColor *aicolor);
00277 
00282         ASErr ASAPI (*GetSwatchName)                    (AISwatchRef swatch, ai::UnicodeString& name);
00283 
00289         ASErr ASAPI (*SetSwatchName)                    (AISwatchRef swatch, const ai::UnicodeString& name);
00290 
00297         ASErr ASAPI (*GetSwatchList)                    (AIDocumentHandle document, AISwatchListRef *list);
00298 
00308         AISwatchRef ASAPI (*GetSwatchByColor)   (AISwatchListRef list, const AIColor *aicolor);
00309 
00317         AISwatchRef ASAPI (*GetSwatchByNameAndType)     (AISwatchListRef list, const ai::UnicodeString& name, AIColorTag type);
00318 
00330         ASErr ASAPI (*RemoveSwatch) (AISwatchListRef list, AISwatchRef swatch, ASBoolean deleteCustomColor);
00331 
00332 } AISwatchListSuite;
00333 
00334 
00335 // New in AI13 (CS3)
00336 
00357 typedef struct {
00358 
00365         ai::int32 ASAPI (*CountSwatchGroups) (AISwatchListRef list);
00366 
00374         AISwatchGroupRef (*GetNthSwatchGroup) (AISwatchListRef list, ai::int32 index);
00375 
00384         AISwatchGroupRef ASAPI (*GetSwatchGroupByName) (AISwatchListRef list, const ai::UnicodeString& name);
00385 
00397         ASErr ASAPI (*NewSwatchGroup) ( AISwatchListRef list, AISwatchGroupKind groupKind,
00398                                                                         ai::int32 atIndex, AISwatchGroupRef *newGroup );
00399 
00408         ASBoolean ASAPI (*SwatchGroupIsInList) (AISwatchListRef list, AISwatchGroupRef swatchGroup, ai::int32 *indexFoundAt ); 
00409 
00423         ASErr ASAPI (*RemoveNthSwatchGroup) (AISwatchListRef list, ai::int32 index, ASBoolean deleteSwatches );
00424 
00438         ASErr ASAPI (*RemoveSwatchGroup) (AISwatchListRef list, AISwatchGroupRef swatchGroup, ASBoolean deleteSwatches);
00439 
00449         ASErr ASAPI (*ReorderNthSwatchGroup) (AISwatchListRef list, ai::int32 fromIndex, ai::int32 newIndex );
00450 
00462         ASErr ASAPI (*ReorderSwatchGroup) (AISwatchListRef list, AISwatchGroupRef swatchGroup, ai::int32 newIndex );
00463 
00469         ASErr ASAPI (*GetSwatchGroupName) (AISwatchGroupRef swatchGroup, ai::UnicodeString& name);
00470 
00475         ASErr ASAPI (*SetSwatchGroupName) (AISwatchGroupRef swatchGroup, const ai::UnicodeString& name);
00476 
00483         AISwatchGroupKind ASAPI (*GetSwatchGroupKind) (AISwatchGroupRef swatchGroup);
00484 
00491         ASBoolean ASAPI (*AllowsColorKind) (AISwatchGroupRef swatchGroup, AIColorTag colorKind);
00492 
00501         ASErr ASAPI (*ReorderSwatch) (AISwatchGroupRef swatchGroup, AISwatchRef swatch, ai::int32 toIndex );
00502 
00514         ASErr ASAPI (*ReorderNthSwatch) (AISwatchGroupRef swatchGroup, ai::int32 fromIndex, ai::int32 toIndex );
00515 
00521         ai::int32 ASAPI (*CountSwatches) (AISwatchGroupRef swatchGroup);
00522 
00529         AISwatchRef ASAPI (*GetNthSwatch) (AISwatchGroupRef swatchGroup, ai::int32 index);
00530 
00538         AISwatchRef ASAPI (*GetSwatchByName) (AISwatchGroupRef swatchGroup, const ai::UnicodeString& name);
00539 
00549         AISwatchRef ASAPI (*GetSwatchByColor) (AISwatchGroupRef swatchGroup, const AIColor *aicolor);
00550 
00558         AISwatchRef ASAPI (*GetSwatchByNameAndType) (AISwatchGroupRef swatchGroup, const ai::UnicodeString& name, AIColorTag type);
00559 
00571         AISwatchRef ASAPI (*InsertNthSwatch) (AISwatchGroupRef swatchGroup, AIColor *aicolor, ai::int32 index);
00572 
00589         ASErr ASAPI (*RemoveNthSwatch) (AISwatchGroupRef swatchGroup, ai::int32 index, ASBoolean deleteCustomColor, bool swatchNotUsed);
00590 
00605         ASErr ASAPI (*RemoveSwatch) (AISwatchGroupRef swatchGroup, AISwatchRef swatch, ASBoolean deleteCustomColor);
00606 
00619         ASErr ASAPI (*LocateSwatch) (AISwatchListRef list, AISwatchRef swatch, AISwatchGroupRef *containingSwatchGroup, ai::int32 *groupIndex, ai::int32 *swatchIndex);
00620 
00634         ASErr ASAPI (*ReorderSwatchBetweenGroups) ( AISwatchGroupRef fromGroup, ai::int32 fromIndex, AISwatchGroupRef toGroup, ai::int32 toIndex );
00635 
00649         ASBoolean ASAPI (*WantsToBeOpenIfInListView) ( AISwatchGroupRef swatchGroup );
00650 
00667         ASErr ASAPI (*SetWantsToBeOpenIfInListView) ( AISwatchGroupRef swatchGroup, ASBoolean whatItWants );
00668 
00669 } AISwatchGroupSuite;
00670 
00671 
00672 #include "AIHeaderEnd.h"
00673 
00674 #endif


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