InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISwatchUtils Class Referenceabstract

#include <ISwatchUtils.h>

Inheritance diagram for ISwatchUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISWATCHUTILS }
 
enum  SwatchNameMatchType { kNoMatch = -1, kExactMatch = 1, kAlternateMatch }
 
enum  DuplicatePref { kUseDefault = 0, kDoDuplicate, kDontDuplicate, kDoReplace }
 
enum  ActionCode {
  kKeepOriginalSwatch = 0, kAddThisSwatch, kAddThisTint, kCancelAction,
  kAddAndConvertThisSwatch, kReplacePantoneSwatch, kReplaceThisSwatch
}
 
enum  SwatchFlags {
  kNoFlags = 0, kDontNotifySwatchList = 1, kFlattenMixedInkSwatch = (1L<<1), kUnlockSwatch = (1L<<2),
  kDontUpdateGraphicState = (1L<<3), kDontWarnUserAboutDuplicateSpot = (1L<<4), kPreserveLockSwatch = (1L<<5)
}
 
enum  CompareCode {
  kSwatchNotCompared = 0, kDiffName, kSameNameSameData, kSameNameDiffData,
  kUnamedSwatch, kSameSwatchSameTint, kSameSwatchDiffTint, kAlternatePantoneName,
  kSameNameEqualMixedInks
}
 
enum  SwatchType {
  kNoneSwatch = 0, kBaseColor, kTintColor, kMixedInkColor,
  kLinkedMixedInkColor, kMixedInkParent, kGradient, kAGMBlackBoxPaint,
  kOtherSwatch
}
 
enum  SwatchUsageType { kAllReferences, kAllObjectReferences, kStyleReferences }
 

Public Member Functions

virtual PMString GetUniqueSwatchName (ISwatchList *swatchList, const PMString &baseName, const PMString &suffixString, bool16 doAppendSuffix=kTrue, bool16 doTruncateNumber=kTrue, SwatchUtilsUniqueNameTempCache *pCache=nil)=0
 
virtual PMString FormatSwatchNameWithColorValue (ISwatchList *swatchList, int32 colorspace, const ColorArray &colorValue, bool16 doUseComma)=0
 
virtual ISwatchListQueryActiveSwatchList (IActiveContext *context=nil)=0
 
virtual ISwatchListQuerySwatchList (IDataBase *iDataBase)=0
 
virtual UID CreateNewSwatch (ClassID renderClassID, const IPMUnknown *newRenderObject, IDataBase *iDataBase, bool16 updateGfxState=kTrue, int32 nSwatchFlags=kNoFlags, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateNewSwatch (ClassID renderClassID, const IPMUnknown *newRenderObject, IWorkspace *workspacePtr, bool16 updateGfxState=kTrue, int32 nSwatchFlags=kNoFlags, const UID &colorGroup=kInvalidUID)=0
 
virtual UIDList DuplicateSwatches (const UIDList &dupList, ISwatchList *swatchList, bool16 makeHidden, bool16 convertToProcess, bool16 doCheck, ISwatchUtils::DuplicatePref dupPref=kDoDuplicate, const PMString &nameSuffixString=PMString(""), bool16 doConvert=kFalse, bool16 doUnlock=kFalse, int32 nFlags=kNoFlags)=0
 
virtual ErrorCode ReplaceAndDeleteSwatches (UIDList *selectedList, UID replacementUID)=0
 
virtual ErrorCode ConvertAndDeleteSwatches (UIDList *selectedList)=0
 
virtual bool16 ConvertToGlobalColorSwatch (ISwatchList *iSwatchList, const UID &originalUID, UID &newUID)=0
 
virtual void GetAllDependentSwatches (ISwatchList *iSwatchList, const UIDList &fromList, UIDList &dependentList)=0
 
virtual void GetAllDependentColorSwatchesAndTintValues (ISwatchList *iSwatchList, const UIDList &fromList, UIDList &dependentList, K2Vector< PMReal > &tintList)=0
 
virtual void GetAllMixedInkParentSwatches (ISwatchList *iSwatchList, UIDList &mixedInkParentList)=0
 
virtual void GetDependentMixedInkSwatches (ISwatchList *iSwatchList, const UIDRef &mixedInkParentRef, UIDList &mixedInkList)=0
 
virtual UID CreateTintedSwatch (const UIDRef &srcSwatch, const PMReal &tintval, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateProcessCMYKSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &cyanVal, const PMReal &magentaVal, const PMReal &yellowVal, const PMReal &blackVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateProcessRGBSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &redVal, const PMReal &greenVal, const PMReal &blueVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateProcessLABSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &LVal, const PMReal &aVal, const PMReal &bVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateProcessHSBSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &hueVal, const PMReal &satVal, const PMReal &briVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateSpotCMYKSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &cyanVal, const PMReal &magentaVal, const PMReal &yellowVal, const PMReal &blackVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateSpotRGBSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &redVal, const PMReal &greenVal, const PMReal &blueVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateSpotLABSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &LVal, const PMReal &aVal, const PMReal &bVal, const UID &colorGroup=kInvalidUID)=0
 
virtual UID CreateSpotHSBSwatch (IWorkspace *workspacePtr, const PMString &swatchName, const PMReal &hueVal, const PMReal &satVal, const PMReal &briVal, const UID &colorGroup=kInvalidUID)=0
 
virtual ErrorCode ReplaceColorSwatchDefinition (const UIDRef &swatchRef1, const UIDRef &swatchRef2, int32 nFlags=kNoFlags)=0
 
virtual ErrorCode ReplaceGradientSwatchDefinition (const UIDRef &, const UIDRef &)=0
 
virtual bool16 SyncMixedInkSwatchesColorData (IDataBase *iSrcDB, IDataBase *iTargetDB, IRenderingObject *iSrcRenderObject, IRenderingObject *iTargetRenderObject, ColorArray &newComponents)=0
 
virtual bool16 TintColorSwatchAlreadyExists (const UID &baseObjectUID, const PMReal &tint, ISwatchList *swatchList=nil, UIDRef *matchedRef=nil)=0
 
virtual bool16 SwatchIsGlobalSwatch (IDataBase *iDataBase, UID swatchUID)=0
 
virtual bool16 SwatchIsVisible (IDataBase *iDataBase, UID swatchUID)=0
 
virtual bool16 SwatchIsLocked (IDataBase *, UID)=0
 
virtual UID GetSwatchAliasUID (IDataBase *, UID)=0
 
virtual bool16 SwatchIsReservedSwatch (IDataBase *, UID)=0
 
virtual bool16 SwatchIsSpotColorSwatch (const UIDRef &swatchRef)=0
 
virtual bool16 SwatchIsBasedOnSwatch (const UIDRef &swatchRef)=0
 
virtual bool16 SwatchIsTintSwatch (const UIDRef &swatchRef, UID *pBaseUID=nil)=0
 
virtual bool16 SwatchIsMixedInkSwatch (const UIDRef &swatchRef, UID *pParentUID=nil)=0
 
virtual bool16 SwatchIsMixedInkGroupParent (const UIDRef &swatchRef)=0
 
virtual bool16 SpotSwatchIsConvertedToProcess (const UIDRef &swatchRef)=0
 
virtual SwatchType GetSwatchType (const UIDRef &swatchRef, UID *pBaseUID=nil)=0
 
virtual UID GetBaseObjectUIDFromSwatch (const UIDRef &swatchRef)=0
 
virtual UID GetNoneSwatchUID (IDataBase *iDataBase)=0
 
virtual UID GetBlackSwatchUID (IDataBase *iDataBase)=0
 
virtual UID GetPaperSwatchUID (IDataBase *iDataBase)=0
 
virtual UID GetRegistrationSwatchUID (IDataBase *iDataBase)=0
 
virtual UID GetNamedSwatch (const PMString &swatchName, IDataBase *iDataBase=nil)=0
 
virtual PMString GetSwatchName (IDataBase *iDataBase, UID swatchUID)=0
 
virtual UIDList GetAllTintSwatchUIDListOfSwatch (IDataBase *iDataBase, UID swatchUID)=0
 
virtual ISwatchUtils::ActionCode CheckSwatchBeforeCopy (const UIDRef &swatchRef, ISwatchList *swatchList, bool16 doAlertUser, ISwatchUtils::DuplicatePref dupPref, UIDRef &matchedRef, ISwatchUtils::CompareCode &resultCode)=0
 
virtual void SynchronizeTintsOfAliasedSwatchOldAndNew (ISwatchList *iSwatchList, const UIDRef &swatchRef, UID newUID)=0
 
virtual void SynchronizeAliasedSwatchInkDataOldAndNew (ISwatchList *iSwatchList, const UIDRef &swatchRef, UID newUID)=0
 
virtual void ProcessMakeSwatchAliasCommand (ISwatchList *iSwatchList, UID swatchUID, UID aliasSwatchUID)=0
 
virtual UID HandleAlternateSwatchMatch (const UIDRef &srcSwatchRef, ISwatchList *iSwatchList, const UIDRef &altSwatchRef, ISwatchUtils::ActionCode actionCode, ISwatchUtils::CompareCode resultCode)=0
 
virtual UID HandleAlternateSwatchMatch (ISwatchList *iSwatchList, const UIDRef &altSwatchRef, const PMString &, const PMString &, int32, const ColorArray &, const IInkData::InkType &, bool16, ISwatchUtils::ActionCode)=0
 
virtual ISwatchUtils::ActionCode CancelDuplicateSpotColorSwatchAlert ()=0
 
virtual ISwatchUtils::ActionCode InvokeSameSwatchAlert (const ISwatchUtils::CompareCode &compareResult, PMString swatchName, bool16 isSpot=kFalse, bool16 allowCancel=kTrue, PMString alternateName=PMString(""))=0
 
virtual UID HandlePlacedContentSpotSwatch (ISwatchList *iSwatchList, const PMString &colorName, int32 colorSpace, const ColorArray &colorArray)=0
 
virtual UIDRef ConvertLibraryColorSwatchToK2Swatch (const UIDRef &libSwatchRef, IWorkspace *iDestinationWS, bool16 doCheckForConflicts, bool16 doUpdateGfxState, int32 nSwatchFlags=kNoFlags, const UID &colorGroup=kInvalidUID)=0
 
virtual UIDRef ConvertLibraryGradientSwatchToK2Swatch (const UIDRef &libSwatchRef, IWorkspace *iDestinationWS, UIDList *pNewColorUIDList, bool16 doCheckForConflicts, bool16 doUpdateGfxState)=0
 
virtual UID AddBookSwatch (ISwatchList *iSwatchList, const UIDRef &bookRef, int32 swatchIndex, const PMString &swatchName, bool16 doLockSwatch, const UID &colorGroup=kInvalidUID)=0
 
virtual PMString GetAlternatePanetoneSwatchName (const PMString &swatchName)=0
 
virtual
ISwatchUtils::SwatchNameMatchType 
FindAlternateSwatchName (ISwatchList *iSwatchList, const PMString &swatchName, UIDRef &altSwatchRef, PMString *pAlterateName=nil)=0
 
virtual PMString GetAlternatePanetoneSwatchNameSuffix (const PMString &pantoneSuffixString)=0
 
virtual ErrorCode ConvertSwatchProfile (ISwatchList *pSwatchList, const UIDList &listSrcColors, UIDList &listDstColors, IDataBase *pDstDB)=0
 
virtual ActionCode CheckProfilesBeforeCopy (ActionCode inActionCode, bool16 inDoAlertUser, const UIDRef &inSrcSwatchRef, ISwatchList *inDstSwatchList, UIDRef &refMatched, bool16 bAllowCancel=kTrue)=0
 
virtual bool16 SwatchIsUsed (IDataBase *iDataBase, UID swatchUID, ISwatchUtils::SwatchUsageType usageType)=0
 
virtual void GetSwatchReferences (IDataBase *iDataBase, UIDList &referencedList, UIDList &unusedList, bool16 includeVisibleSwatches, bool16 includeUnnamedSwatches, ISwatchUtils::SwatchUsageType usageType)=0
 
virtual void GetSwatchReferencesByObject (const UIDRef &objectUIDRef, UIDList &referencedList)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Swatch related utility

See Also
ISwatchList for more information on requirements for swatch UIDs and UIDRefs
aslo IRenderingObject

Member Enumeration Documentation

Use to specify the desired action resulting from CheckSwatchBeforeCopy()

See Also
also CheckSwatchBeforeCopy
Enumerator
kKeepOriginalSwatch 

kKeepOriginalSwatch indicates that the original swatch matched in the target should be used.

kAddThisSwatch 

kAddThisSwatch indicates that a new swatch matching the source should be addded in the target.

kAddThisTint 

kAddThisTint indicates that a new tint swatch matching the source should be added.

kCancelAction 

kCancelAction indicates that the specified action has been cancelled.

kAddAndConvertThisSwatch 

kAddAndConvertThisSwatch indicates that the source profile should be added and converted in the target.

kReplacePantoneSwatch 

kReplacePantoneSwatch indicates that as a result of pantone conflict, the target should be replaced.

kReplaceThisSwatch 

kReplaceThisSwatch indicates that the target will be replaced by the source's definition if they have same name.

Use to specify the swatch mathcing result from CheckSwatchBeforeCopy()
Enumerator
kSwatchNotCompared 

kSwatchNotCompared indicates that the specified swatch is not compared.

kDiffName 

kDiffName indicates that the source swatch has different name from all target swatches.

kSameNameSameData 

kSameNameSameData indicates that the source swatch matched the target with same same and same data.

kSameNameDiffData 

kSameNameDiffData indicates that the source swatch matched the target with same same but different data

kUnamedSwatch 

kUnamedSwatch indicates that the source swatch is a unnamed swatch.

kSameSwatchSameTint 

kSameSwatchSameTint indicates that the source matched a target with same base color and same tint value.

kSameSwatchDiffTint 

kSameSwatchDiffTint indicates that the source matched a target with same base color but different tint value.

kAlternatePantoneName 

kAlternatePantoneName indicates that the source matched a target with alternate pantone name.

kSameNameEqualMixedInks 

kSameNameEqualMixedInks indicates that the source matched a target with same name, equivalent ink list but inks appear in different orders.

Use to specify the duplicate swatch preference.
Enumerator
kUseDefault 

kUseDefault means don't duplicate on kSameNameSameData, do duplicate kSameNameDifferentData (except spots)

kDoDuplicate 

kDoDuplicate will override default in favor of duplicating

kDontDuplicate 

kDontDuplicate overrides default in favor of not duplicating

kDoReplace 

kDoReplace means don't duplicate on kSameNameDifferentData and always do override

A new set of bitflags that can be be passed to the various duplicate/replace swatch functions.
Enumerator
kDontNotifySwatchList 

default is to notify, because that was the original behavior, but this causes performance problems in some cases, so this allows you to prevent notification.

kFlattenMixedInkSwatch 

Flatten any linked mixed ink swatch when replacing a color swatch. Default is to replace swatch as is.

kUnlockSwatch 

Unlock resulting swatch. Default is to keep swatch as is.

kDontUpdateGraphicState 

Don't update the graphic state if necessary. Default is to update.

kDontWarnUserAboutDuplicateSpot 

Don't warn the user about same named spots that have different definitions. Default is to warn.

kPreserveLockSwatch 

Preserve origainal swatch lock properties when duplicate or replacing a color swatch. The default is to update.

Use to specify the type of swatch match based on swatch name.
Enumerator
kNoMatch 

No match in the swatch name.

kExactMatch 

An exact match in the swatch name is found.

kAlternateMatch 

An alternate match in the swatch name is found. This is limited to PANTONE library swatches.

Use to specify the type of swatch.
Enumerator
kNoneSwatch 

kNoneSwatch specifies swatch is a reserved [None] swatch.

kBaseColor 

kBaseColor specifies swatch is a normal base color swatch. This is either a spot or a process color.

kTintColor 

kTintColor specifies swatch is a tint color swatch.

kMixedInkColor 

kMixedInkColor specifies swatch is a standalone mixed ink color.

kLinkedMixedInkColor 

kLinkedMixedInkColor specifies swatch is a linked mixed ink color. This is a child mixed ink swatch of a mixed ink group.

kMixedInkParent 

kMixedInkGroupParent speifies swatch is a mixed ink group parent swatch.

kGradient 

kGradient specicies swatch is a gradient swatch.

kAGMBlackBoxPaint 

kAGMBlackBoxPaint specicies swatch is a AGM blackbox paint object.

kOtherSwatch 

kOtherSwatch specicies swatch is a non-InDesign native swatch.

Use to specify the type of swatch.
Enumerator
kAllReferences 

kAllReferences specifies all swatch references.

kAllObjectReferences 

kAllObjectReferences specifies all swatch references by InDesign objects such as page items, text, table, and styles. Dependent swatches of those that are referenced are also included even if they are not directly referenced.

kStyleReferences 

kStyleReferences specifies all swatch references by text style, table style, object style, or another swatch.

Member Function Documentation

virtual UID ISwatchUtils::AddBookSwatch (ISwatchListiSwatchList,
const UIDRefbookRef,
int32 swatchIndex,
const PMStringswatchName,
bool16 doLockSwatch,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Add a swatch from the Adobe swatchbook to the specified swatch list.

Parameters
iSwatchListis the swatch list the swatch is being added to.
bookRefis the swatchbook from swatch the swatch is being added.
swatchIndexis the index in the swatchbook.
swatchNameif not empty, set the new swatch with this name. Otherwise leave swatch name as is.
doLockSwatchif set to kTrue, the new swatch is locked.
colorGroupthe UID of the parent color group for the new swatch.
Returns
UID of the new swatch.
virtual ISwatchUtils::ActionCode ISwatchUtils::CancelDuplicateSpotColorSwatchAlert ()
pure virtual

Bring up a duplicate spot color swatch alert.

Returns
kCancelAction if user choose to not duplicate.
virtual ActionCode ISwatchUtils::CheckProfilesBeforeCopy (ActionCode inActionCode,
bool16 inDoAlertUser,
const UIDRefinSrcSwatchRef,
ISwatchListinDstSwatchList,
UIDRefrefMatched,
bool16 bAllowCancel = kTrue 
)
pure virtual

Check profile before copy to determine if swatch profiles should be converted.

Parameters
inActionCodethe initial action code.
inDoAlertUserkTrue if allow to put up an user alert dialog.
inSrcSwatchRefthe source swatch to check.
inDstSwatchListthe target swatch list.
refMatchedthe matching swatch UIDRef found in the target swatch list.
bAllowCancelkTrue if user can cancel.
Returns
an ActionCode based on an action code and user choice.
virtual ISwatchUtils::ActionCode ISwatchUtils::CheckSwatchBeforeCopy (const UIDRefswatchRef,
ISwatchListswatchList,
bool16 doAlertUser,
ISwatchUtils::DuplicatePref dupPref,
UIDRefmatchedRef,
ISwatchUtils::CompareCoderesultCode 
)
pure virtual

Return an action code, a compare result, and a matching UIDRef if one is found based on the swatch's compare result.

Parameters
swatchRefthe source swatch to check.
swatchListthe target swatch list to check.
doAlertUserif kTrue, a warning alert is shown when there's conflict. A conflict exists if two swatches have same name but different data.
dupPrefspecifies the duplicate preference.
matchedRefreturns a UIDRef of the matching swatch found in the target swatchList.
resultCodereturns the compare result code.
Returns
a preferred action code.
virtual ErrorCode ISwatchUtils::ConvertAndDeleteSwatches (UIDListselectedList)
pure virtual

Deletes all swatches in the list after replacing all references to these swatches with equivalent unnamed local swatches

Parameters
selectedListthe list of swatch UID to delete. Reserved swatches in the lsit are not deleted.
Returns
kSuccess if swatches are deleted and replaced successfully. Otherwise, returns an error code.
virtual UIDRef ISwatchUtils::ConvertLibraryColorSwatchToK2Swatch (const UIDReflibSwatchRef,
IWorkspaceiDestinationWS,
bool16 doCheckForConflicts,
bool16 doUpdateGfxState,
int32 nSwatchFlags = kNoFlags,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Convert a swatch library color swatch to an InDesign color swatch.

Parameters
libSwatchRefspecifies the UIDRef of the library swatch.
iDestinationWSspecifies the target workspace to create the new InDesign swatch.
doCheckForConflictsis kTrue, if CheckSwatchBeforeCopy() should be called.
doUpdateGfxStateis kTrue, if the graphic state should be updated with the new swatch.
nSwatchFlagsa combination of SwatchFlags.
colorGroupthe UID of the parent color group for the new InDesign color swatch.
Returns
UIDRef of the new InDesign color swatch.
virtual UIDRef ISwatchUtils::ConvertLibraryGradientSwatchToK2Swatch (const UIDReflibSwatchRef,
IWorkspaceiDestinationWS,
UIDListpNewColorUIDList,
bool16 doCheckForConflicts,
bool16 doUpdateGfxState 
)
pure virtual

Convert a swatch library gradient swatch to an InDesign gradient swatch.

Parameters
libSwatchRefspecifies the UIDRef of the library swatch.
iDestinationWSspecifies the target workspace to create the new InDesign swatch.
pNewColorUIDListreturns the list of new color UID created for this gradient swatch.
doCheckForConflictsis kTrue, if CheckSwatchBeforeCopy() should be called.
doUpdateGfxStateis kTrue, if the graphic state should be updated with the new swatch.
Returns
UIDRef of the new InDesign gradient swatch.
virtual ErrorCode ISwatchUtils::ConvertSwatchProfile (ISwatchListpSwatchList,
const UIDListlistSrcColors,
UIDListlistDstColors,
IDataBasepDstDB 
)
pure virtual

Convert swatches' profiles. Only RGB and CMYK color spaces are converted.

Parameters
pSwatchListthe target swatch list.
listSrcColorsthe list of source color swatches.
listDstColorsthe list of corresponding target color swatches.
pDstDBthe target database.
Returns
kSuccess if successful other wise returns an error code.
virtual bool16 ISwatchUtils::ConvertToGlobalColorSwatch (ISwatchListiSwatchList,
const UIDoriginalUID,
UIDnewUID 
)
pure virtual

Convert the specified unnamed color swatch to the equivalent named with color value swatch.

Parameters
originalUIDthe unnamed color swatch to convert.
newUIDthe converted global color swatch. This swatch is named with color values.
Returns
kSuccess if swatch is converted to named swatch successfully. Otherwise, returns an error code.
virtual UID ISwatchUtils::CreateNewSwatch (ClassID renderClassID,
const IPMUnknownnewRenderObject,
IDataBaseiDataBase,
bool16 updateGfxState = kTrue,
int32 nSwatchFlags = kNoFlags,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Create a new swatch matching the attributes described by the newRenderObject exactly in the given workspace or database. Update graphic state in the specified workspace or database to the new swatch when updateGfxState is set to kTrue.

Parameters
renderClassIDrendering class ID of the new rendering object.
newRenderObjectspecifies the new rendering attributes matching the renderClassID.
iDataBasethe target data base to create the new swatch.
workspacePtrthe target workspace to create the new swatch.
updateGfxStateif kTrue, the graphic state of the specified workspace or database is updated with this new swatch UID.
nSwatchFlagsa combination of SwatchFlags. See SwatchFlags above.
colorGroupthe UID of the parent color group for the new swatch.
Returns
a new swatch UID.
virtual UID ISwatchUtils::CreateNewSwatch (ClassID renderClassID,
const IPMUnknownnewRenderObject,
IWorkspaceworkspacePtr,
bool16 updateGfxState = kTrue,
int32 nSwatchFlags = kNoFlags,
const UIDcolorGroup = kInvalidUID 
)
pure virtual
See Also
CreateNewSwatch above.
virtual UID ISwatchUtils::CreateProcessCMYKSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealcyanVal,
const PMRealmagentaVal,
const PMRealyellowVal,
const PMRealblackVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new process CMYK color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new process color swatch.
swatchNamespecifies the new swatch name.
cyanValspecifies the cyan component value.
magentaValspecifies the magenta component value.
yellowValspecifies the yellow component value.
blackValspecifies the black component value.
colorGroupthe UID of the parent color group for the new process color swatch.
Returns
the new process color swatch UID.
virtual UID ISwatchUtils::CreateProcessHSBSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealhueVal,
const PMRealsatVal,
const PMRealbriVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new process HSB color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new process color swatch.
swatchNamespecifies the new swatch name.
hueValspecifies the hue component value.
satValspecifies the saturation component value.
briValspecifies the brightness component value.
colorGroupthe UID of the parent color group for the new process color swatch.
Returns
the new process color swatch UID.
virtual UID ISwatchUtils::CreateProcessLABSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealLVal,
const PMRealaVal,
const PMRealbVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new process Lab color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new process color swatch.
swatchNamespecifies the new swatch name.
LValspecifies the L component value.
aValspecifies the A component value.
bValspecifies the B component value.
colorGroupthe UID of the parent color group for the new process color swatch.
Returns
the new process color swatch UID.
virtual UID ISwatchUtils::CreateProcessRGBSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealredVal,
const PMRealgreenVal,
const PMRealblueVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new process RGB color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new process color swatch.
swatchNamespecifies the new swatch name.
redValspecifies the red component value.
greenValspecifies the green component value.
blueValspecifies the blue component value.
colorGroupthe UID of the parent color group for the new process color swatch.
Returns
the new process color swatch UID.
virtual UID ISwatchUtils::CreateSpotCMYKSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealcyanVal,
const PMRealmagentaVal,
const PMRealyellowVal,
const PMRealblackVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new spot CMYK color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new spot color swatch.
swatchNamespecifies the new swatch name.
cyanValspecifies the cyan component value.
magentaValspecifies the magenta component value.
yellowValspecifies the yellow component value.
blackValspecifies the black component value.
colorGroupthe UID of the parent color group for the new spot color swatch.
Returns
the new spot color swatch UID.
virtual UID ISwatchUtils::CreateSpotHSBSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealhueVal,
const PMRealsatVal,
const PMRealbriVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new spot HSB color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new spot color swatch.
swatchNamespecifies the new swatch name.
hueValspecifies the hue component value.
satValspecifies the saturation component value.
briValspecifies the brightness component value.
colorGroupthe UID of the parent color group for the new spot color swatch.
Returns
the new spot color swatch UID.
virtual UID ISwatchUtils::CreateSpotLABSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealLVal,
const PMRealaVal,
const PMRealbVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new spot Lab color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new spot color swatch.
swatchNamespecifies the new swatch name.
LValspecifies the L component value.
aValspecifies the A component value.
bValspecifies the B component value.
colorGroupthe UID of the parent color group for the new spot color swatch.
Returns
the new spot color swatch UID.
virtual UID ISwatchUtils::CreateSpotRGBSwatch (IWorkspaceworkspacePtr,
const PMStringswatchName,
const PMRealredVal,
const PMRealgreenVal,
const PMRealblueVal,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a new spot RGB color swatch in the workspacePtr using the passed in values.

Parameters
workspacePtrthe workspace of the new spot color swatch.
swatchNamespecifies the new swatch name.
redValspecifies the red component value.
greenValspecifies the green component value.
blueValspecifies the blue component value.
colorGroupthe UID of the parent color group for the new spot color swatch.
Returns
the new spot color swatch UID.
virtual UID ISwatchUtils::CreateTintedSwatch (const UIDRefsrcSwatch,
const PMRealtintval,
const UIDcolorGroup = kInvalidUID 
)
pure virtual

Creates a tinted color swatch. This will return a kInvalidUID if the source swatch is not a color. If tint of that swatch already exists, it will return the existing tint swatch UID.

Parameters
srcSwatchthe base swatch from which to create the new tint swatch.
tintvalthe tint value of the new tint swatch.
colorGroupthe UID of the parent color group for the new tint swatch.
Returns
the new tint swatch UID.
virtual UIDList ISwatchUtils::DuplicateSwatches (const UIDListdupList,
ISwatchListswatchList,
bool16 makeHidden,
bool16 convertToProcess,
bool16 doCheck,
ISwatchUtils::DuplicatePref dupPref = kDoDuplicate,
const PMStringnameSuffixString = PMString(""),
bool16 doConvert = kFalse,
bool16 doUnlock = kFalse,
int32 nFlags = kNoFlags 
)
pure virtual

Duplicate the swatches specified by the dupList in the specified swatchList. If swatchList is nil, the source swatch list is used.

Parameters
dupListspecifies a list of swatch UID to duplicate.
swatchListthe target swatch list to create the duplicates.
makeHiddenif kTrue, the resulting duplicates is converted to unnamed swatches.
convertToProcessif kTrue, the resulting duplicates that are color swatches are converted to process color swatches.
doCheckif kTrue, call CheckSwatchBeforeCopy() first.
dupPrefused by the reference converter to determine what to do if an existing swatch matches the one to be duplicated.
nameSuffixStringthe string to append to duplicated swatch name. if string is empty, the new name will just be the duplicated name with a numeric value
doConvertif kTrue color values are converted using source and destination document color profiles
doUnlockif kTrue locked swatches are unlocked.
nFlagsa combination of SwatchFlags. See SwatchFlags above.
Returns
a list of swatch UID corresponding to the UID in dupList.
virtual ISwatchUtils::SwatchNameMatchType ISwatchUtils::FindAlternateSwatchName (ISwatchListiSwatchList,
const PMStringswatchName,
UIDRefaltSwatchRef,
PMStringpAlterateName = nil 
)
pure virtual

Find the alternate swatch in the specified target swatch list.

Parameters
iSwatchListthe target swatch list.
swatchNamethe PANTONE swatch name to check.
altSwatchRefreturns the alternate swatch UIDRef found. This is UIDRef::gNull if no alternate found.
pAlterateNamereturns the alternate swatch name if not nil.
virtual PMString ISwatchUtils::FormatSwatchNameWithColorValue (ISwatchListswatchList,
int32 colorspace,
const ColorArraycolorValue,
bool16 doUseComma 
)
pure virtual

Format a swatch name from the given color space and value. For example, if the color space is CMYK and value is (0,100, 20, 0), the swatch name is "C=0, M=100, Y=20, K=0". If a swatch name with this string already exists, the string is appended a number starting with "2".

Parameters
swatchListthe swatch list in which the swatch name should be unique.
colorspacethe colorspace to format swatch name with.
colorValuethe color value to format swatch name with.
doUseCommaif kTrue, the comman "," is used with a space separator.
Returns
an uniquely formated swatch name.
virtual void ISwatchUtils::GetAllDependentColorSwatchesAndTintValues (ISwatchListiSwatchList,
const UIDListfromList,
UIDListdependentList,
K2Vector< PMReal > & tintList 
)
pure virtual

Compile a list of color swatches UIDs and tint values that are dependent of the base swatches in the fromList.

Parameters
iSwatchListthe swatch list to gather information from.
fromListthe list of base color swatch UID.
dependentListthe resulting list of tint swatch UIDs that are tint of swatches in the fromList
tintListthe list of tint values corresponding to the dependentList.
virtual void ISwatchUtils::GetAllDependentSwatches (ISwatchListiSwatchList,
const UIDListfromList,
UIDListdependentList 
)
pure virtual

Compile a list of swatch UIDs that are dependents of swatches in the fromList.

Parameters
iSwatchListthe swatch list to gather information from.
fromListthe list of base swatch UID.
dependentListthe resulting list of swatch UIDs that are dependent of swatches in the fromList. This list can include tint swatches as well as mixed ink group swatches.
virtual void ISwatchUtils::GetAllMixedInkParentSwatches (ISwatchListiSwatchList,
UIDListmixedInkParentList 
)
pure virtual

Compile a list of mixed ink parent swatches from the specified swatch list.

Parameters
iSwatchListthe target swatch list.
mixedInkParentListreturns a list of mixed ink parent swatchUID.
virtual UIDList ISwatchUtils::GetAllTintSwatchUIDListOfSwatch (IDataBaseiDataBase,
UID swatchUID 
)
pure virtual

Return a list of tint swatch UID that is based on the specified color swatch UID

Parameters
iDataBasethe database of the specified swatch UID.
swatchUIDspecifies the swatch
Returns
a list of tintg swatch UID that is based on the specified swatch.
virtual PMString ISwatchUtils::GetAlternatePanetoneSwatchName (const PMStringswatchName)
pure virtual

Returns the alternate PANTONE swatch name corresponding to the specified swatch name.

Parameters
swatchNamethe PANTONE swatch name to check.
Returns
the alternate PANTONE swatch name. Returns nil, if there's no alternate name.
virtual PMString ISwatchUtils::GetAlternatePanetoneSwatchNameSuffix (const PMStringpantoneSuffixString)
pure virtual

Get the alternate PANTONE swatch name's suffix string

Parameters
pantoneSuffixStringspecifies the PANTONE swatch name suffix string to check.
Returns
the alternate PANTONE swatch name's suffix string. It is a empty string if no alternate.
virtual UID ISwatchUtils::GetBaseObjectUIDFromSwatch (const UIDRefswatchRef)
pure virtual

Return swatch's base object UID. UID is kInvalidUID if swatch is not based on another swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
Returns
swatch's base UID.
virtual UID ISwatchUtils::GetBlackSwatchUID (IDataBaseiDataBase)
pure virtual

Return the Black swatch UID of the specified database.

Parameters
iDataBasethe database to check.
Returns
Black swatch UID or kInvalidUID if does not exist.
virtual void ISwatchUtils::GetDependentMixedInkSwatches (ISwatchListiSwatchList,
const UIDRefmixedInkParentRef,
UIDListmixedInkList 
)
pure virtual

Returns a list of mixed ink swatches that are linked to the specified parent swatch.

Parameters
iSwatchListthe target swatch list.
mixedInkParentRefspecifies the mixed ink parent swatch UID.
mixedInkListreturns a list of mixed ink swatch UIDs that are linked to mixedInkParentRef. Returns an empty list if mixedInkParentRef is not mixed ink parent swatch.
virtual UID ISwatchUtils::GetNamedSwatch (const PMStringswatchName,
IDataBaseiDataBase = nil 
)
pure virtual

Get the named swatch's UID from the specified database. If database is nil, it returns the named swatch UID in the current active workspace.

Parameters
namethe swatch name.
iDataBasethe database to check.
Returns
swatch UID of the specified swatch name.
virtual UID ISwatchUtils::GetNoneSwatchUID (IDataBaseiDataBase)
pure virtual

Return the None swatch UID of the specified database.

Parameters
iDataBasethe database to check.
Returns
None swatch UID or kInvalidUID if does not exist.
virtual UID ISwatchUtils::GetPaperSwatchUID (IDataBaseiDataBase)
pure virtual

Return the Paper swatch UID of the specified database.

Parameters
iDataBasethe database to check.
Returns
Paper swatch UID or kInvalidUID if does not exist.
virtual UID ISwatchUtils::GetRegistrationSwatchUID (IDataBaseiDataBase)
pure virtual

Return the Registration swatch UID of the specified database.

Parameters
iDataBasethe database to check.
Returns
Registration swatch UID or kInvalidUID if does not exist.
virtual UID ISwatchUtils::GetSwatchAliasUID (IDataBase,
UID  
)
pure virtual

Return the specified swatch's aliase swatch UID. If the swatch is not aliased, then kInvalidUID is returned.

Parameters
iDataBasethe database of the swatch UID to check.
swatchUIDthe swatch UID to check.
Returns
the swatch's alias swatch UID.
virtual PMString ISwatchUtils::GetSwatchName (IDataBaseiDataBase,
UID swatchUID 
)
pure virtual

Given the UIDRef, return the swatch name.

Parameters
iDataBasethe database to check.
swatchUIDthe swatch UID.
Returns
the swatch name of the specified swatch.
virtual void ISwatchUtils::GetSwatchReferences (IDataBaseiDataBase,
UIDListreferencedList,
UIDListunusedList,
bool16 includeVisibleSwatches,
bool16 includeUnnamedSwatches,
ISwatchUtils::SwatchUsageType usageType 
)
pure virtual

Return a list of swatch UIDs that are used in the database.

Parameters
iDataBaseis the database.
referencedListthe list containing the used swatch UIDs.
unusedListthe list containing the used swatch UIDs.
includeVisibleSwatchesif true visible swatches are included in the referencedList and the unusedList. If false, visible swatches are excluded.
includeUnnamedSwatchesif true unnamed swatches are included in the referencedList and the unusedList. If false, unnamed swatches are excluded. If both includeVisibleSwatches and includeUnnamedSwatches are true, all swatches are included. If both are false, then nothing is don, i.e. both referencedList and unusedList are returned as empty lists.
usageTypeis the type of references wanted.
Returns
the list of swatch UIDs referenced.
virtual void ISwatchUtils::GetSwatchReferencesByObject (const UIDRefobjectUIDRef,
UIDListreferencedList 
)
pure virtual

Return a list of swatch UIDs that are referenced by the specified object.

Parameters
objectUIDRefis the object the swatch references are being returned.
referencedListthe list containing the used swatch UIDs.
Returns
the list of swatch UIDs referenced.
virtual SwatchType ISwatchUtils::GetSwatchType (const UIDRefswatchRef,
UIDpBaseUID = nil 
)
pure virtual

Return the swatch type of the specified swatch. If a tint swatch is based on a mixed ink swatch, the swatch type returned will be kTintColor and the base UID will be the mixed ink swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
pBaseUIDthe base color UID if the swatch is based on another swatch.
Returns
the swatch type.
virtual PMString ISwatchUtils::GetUniqueSwatchName (ISwatchListswatchList,
const PMStringbaseName,
const PMStringsuffixString,
bool16 doAppendSuffix = kTrue,
bool16 doTruncateNumber = kTrue,
SwatchUtilsUniqueNameTempCachepCache = nil 
)
pure virtual

Get an unique swatch name starting with "baseName". If the baseName is already unique, this is returned.

Parameters
swatchListthe swatch list in which the name should be unique.
baseNamethe base name to start with.
suffixStringthe string to append to baseName if not empty.
doAppendSuffixif set to kTrue, then suffixString is append.
doTruncateNumberif set to kTrue, the existing number appended to baseName will be removed first.
vecExistingSuffixesif you are calling GetUniqueSwatchName many times repeatedly for the same base name, this will act as a cache and significantly improve performance. If nil, it is ignored.
Returns
an unique swatch name within the specified swatch list.
virtual UID ISwatchUtils::HandleAlternateSwatchMatch (const UIDRefsrcSwatchRef,
ISwatchListiSwatchList,
const UIDRefaltSwatchRef,
ISwatchUtils::ActionCode actionCode,
ISwatchUtils::CompareCode resultCode 
)
pure virtual

Handle the user actions resulting from a pantone color swatch alternate match in the target swatch list. Both source and matched swatch must be a color.

Parameters
srcSwatchRefthe source (original) panetone swatch.
iSwatchListthe target swatch list.
altSwatchRefthe matched alternate swatch UIDRef found in swatchList.
actionCodethe desired action code.
resultCodespecifies the result code. This must be kAlternatePantoneName.
Returns
the new UID in the target database.
Precondition
pantone conflicts must exist, i.e. resultCode must be kAlternatePantoneName.
virtual UID ISwatchUtils::HandleAlternateSwatchMatch (ISwatchListiSwatchList,
const UIDRefaltSwatchRef,
const PMString,
const PMString,
int32 ,
const ColorArray,
const IInkData::InkType,
bool16 ,
ISwatchUtils::ActionCode  
)
pure virtual

Handle the user actions resulting from a pantone color swatch alternate match in the target swatch list. In this version, the source must be a color swatch specified by its swatch name, color space, color values, ink type, and whether or not it must be locked.

Parameters
iSwatchListthe target swatch list.
altSwatchRefthe matched alternate swatch UIDRef found in swatchList.
swatchNamethe source (original) panetone swatch name.
alternateSwatchNamethe alternate panetone swatch name.
colorspacethe source (original) panetone swatch color space.
colorArraythe source (original) panetone swatch color value.
inkTypethe source (original) panetone swatch ink type.
lockedSwatchspecified if source swatch is locked.
actionCodethe desired action code.
Returns
the new UID in the target database.
Precondition
pantone conflicts must exist.
virtual UID ISwatchUtils::HandlePlacedContentSpotSwatch (ISwatchListiSwatchList,
const PMStringcolorName,
int32 colorSpace,
const ColorArraycolorArray 
)
pure virtual

This utility encapsulates the tricky business of taking spot plates coming from placed content (PDF, EPS, images) and matching up to or creating new swatches in the document. Specifically it does one of the following depending on the name of the spot.

If the spot name matches a reserved ink name it simply returns the UID of the reserved ink.



If the spot name matches an existing spot color in the document exactly then it locks that

spot and returns its UID.  No alert is given if the definition doesn't match, per the

current spot functional specification.  The existing document definition always wins.



If the spot name matches a book color *and* an existing swatch in the document also matches

the same book color (e.g., one is PANTONE 185 CVC and the other is PANTONE 185 C) then 

the new spot is aliased to the existing spot and the existing spot is locked.  So, again,

the document definition always wins if it exists.



If the spot name matches a current book color but that color (or a name variant) doesn't 

exist in the document, the book definition is added to the swatch list and its UID is

returned.  Note that the color space/array coming is irrelevant in this case; the book

definition always wins (per the spot spec).  However, the name from the linked content 

is used even if it differs from the book name (e.g., if the placed content uses PANTONE

185 CVC, it will retain that name, but the values will come from the book).



If the spot name doesn't match any existing document colors, nor a book color (current or

legacy) then it's a custom spot.  A new swatch is added to the swatch list with the name

and color values specified and that swatch is locked.  Its UID is returned.

Parameters
iSwatchListThe swatch list to which swatches are compared and/or added.
swatchNameThe name of the swatch as specified in the placed content.
colorSpaceThe kPMCs* colorspace of the spot's alternate.
colorArrayThe array of color values in spot alt space.
Returns
The UID of the resulting swatch in the swatch list, per the rules described above.
virtual ISwatchUtils::ActionCode ISwatchUtils::InvokeSameSwatchAlert (const ISwatchUtils::CompareCodecompareResult,
PMString swatchName,
bool16 isSpot = kFalse,
bool16 allowCancel = kTrue,
PMString alternateName = PMString("") 
)
pure virtual

Bring up a alert indicating duplicating a color swatch.

Parameters
compareResultspecifies either swatch compare is kSameNameSameData or kSameNameDiffData.
swatchNamespecifies the swatch name.
isSpotis kTrue if swatch is a spot color swatch.
allowCancelif kTrue, the allow the action to be cancelled.
resultCodespecifies the result code. This must be kAlternatePantoneName.
Returns
the desired action code. This is one of kKeepOriginalSwatch, kAddThisSwatch, or kCancelAction. kAddThisSwatch,
virtual void ISwatchUtils::ProcessMakeSwatchAliasCommand (ISwatchListiSwatchList,
UID swatchUID,
UID aliasSwatchUID 
)
pure virtual

Process a command to create a swatch alias

Parameters
swatchListthe target swatch list.
swatchUIDthe swatch to be aliased
aliasSwatchUIDthe swatch UID that swatchUID will be aliased to.
virtual ISwatchList* ISwatchUtils::QueryActiveSwatchList (IActiveContextcontext = nil)
pure virtual

Query for the current active swatch list in the specified context. If the context is nil, the current active context is used.

Parameters
contextthe active context to use.
Returns
a ISwatchList* associated with the context.
See Also
ISwatchList
virtual ISwatchList* ISwatchUtils::QuerySwatchList (IDataBaseiDataBase)
pure virtual

Query for the swatch list of the given database.

Parameters
iDataBasethe database to use
Returns
a ISwatchList* associated with the iDataBase.
See Also
ISwatchList
virtual ErrorCode ISwatchUtils::ReplaceAndDeleteSwatches (UIDListselectedList,
UID replacementUID 
)
pure virtual

Delete all swatches in the list after replacing all references to these swatches with the replacement swatch.

Parameters
selectedListthe list of swatch UID to delete. Reserved swatches in the lsit are not deleted.
replacementUIDthe replacement swatch UID.
Returns
kSuccess if swatches are deleted and replaced successfully. Otherwise, returns an error code.
virtual ErrorCode ISwatchUtils::ReplaceColorSwatchDefinition (const UIDRefswatchRef1,
const UIDRefswatchRef2,
int32 nFlags = kNoFlags 
)
pure virtual

Process a command to replace the definition of color swatch 1 with the definition from color swatch 2. Swatch 1 and 2 do not have to be in the same data base. However swatch 1 and 2 must be of the same rendering type.

Parameters
swatchRef1the UIDRef of swatch 1.
swatchRef1the UIDRef of swatch 2.
nFlagsa combination of SwatchFlags.
Returns
kSuccess if the command is completed successfully or an error code.
Precondition
rendering class of swatchRef1 == rendering class of swatchRef2.
swatchRef1 is not a mixed ink group parent and/or swatchRef2 is not a mixed ink group parent.
virtual ErrorCode ISwatchUtils::ReplaceGradientSwatchDefinition (const UIDRef,
const UIDRef 
)
pure virtual

Process a command to replace the gradient swatch 1 with the definition from gradient swatch 2. Swatch 1 and 2 do not have to be in the same data base. However swatch 1 and 2 must be of the same rendering type.

Parameters
swatchRef1the UIDRef of swatch 1.
swatchRef1the UIDRef of swatch 2.
Returns
kSuccess if the command is completed successfully.
Precondition
rendering class of swatchRef1 == rendering class of swatchRef2.
swatchRef1 is not a mixed ink group parent and/or swatchRef2 is not a mixed ink group parent.
virtual bool16 ISwatchUtils::SpotSwatchIsConvertedToProcess (const UIDRefswatchRef)
pure virtual

Return true if the given spot swatch has been converted to process. It will also return true if swatchRef is not spot, but a process swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
Returns
kTrue if swatch is process color swatch or converted to process color swatch.
virtual bool16 ISwatchUtils::SwatchIsBasedOnSwatch (const UIDRefswatchRef)
pure virtual

Return true if the given swatch is based on another swatch. For example, a tint swatch is based on another swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
Returns
kTrue if swatch based on another swatch.
virtual bool16 ISwatchUtils::SwatchIsGlobalSwatch (IDataBaseiDataBase,
UID swatchUID 
)
pure virtual

Reutrn true if the given swatch is a global swatch. A global swatch is a named and visible swatch.

Parameters
iDataBasethe database of the swatch UID to check.
swatchUIDthe swatch UID to check.
Returns
kTrue if specified swatch is a global swatch.
virtual bool16 ISwatchUtils::SwatchIsLocked (IDataBase,
UID  
)
pure virtual

Return true if the given swatch is locked. A swatch is locked if it cannot be deleted.

Parameters
iDataBasethe database of the swatch UID to check.
swatchUIDthe swatch UID to check.
Returns
kTrue if specified swatch is locked.
virtual bool16 ISwatchUtils::SwatchIsMixedInkGroupParent (const UIDRefswatchRef)
pure virtual

Return true if the given swatch is a mixed ink group parent swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
Returns
kTrue if swatch is a mixed ink group parent swatch.
virtual bool16 ISwatchUtils::SwatchIsMixedInkSwatch (const UIDRefswatchRef,
UIDpParentUID = nil 
)
pure virtual

Return true if the given swatch is a mixed ink swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
pParentUIDthe mixed ink group parent UID if the swatch is part of the mixed ink group.
Returns
kTrue if swatch is a mixed ink swatch.
virtual bool16 ISwatchUtils::SwatchIsReservedSwatch (IDataBase,
UID  
)
pure virtual

Return true if the given swatch is one of reserved Cyan, Magenta, Yellow, Paper, Black, Registration, or None.

Parameters
iDataBasethe database of the swatch UID to check.
swatchUIDthe swatch UID to check.
Returns
kTrue if swatch is a reserved swatch.
virtual bool16 ISwatchUtils::SwatchIsSpotColorSwatch (const UIDRefswatchRef)
pure virtual

Return true if the given swatch is a spot color swatch. Will also return kTrue if tint swatch is a tint of a spot.

Parameters
swatchRefthe UIDRef of the swatch to check.
Returns
kTrue if swatch is a spot color swatch.
virtual bool16 ISwatchUtils::SwatchIsTintSwatch (const UIDRefswatchRef,
UIDpBaseUID = nil 
)
pure virtual

Return true if the given swatch is a tint swatch swatch.

Parameters
swatchRefthe UIDRef of the swatch to check.
pBaseUIDthe base color UID the tint swatch is based on.
Returns
kTrue if swatch is a tint swatch.
virtual bool16 ISwatchUtils::SwatchIsUsed (IDataBaseiDataBase,
UID swatchUID,
ISwatchUtils::SwatchUsageType usageType 
)
pure virtual

Return kTrue if swatchUID is used in the database.

Parameters
iDataBaseis the database.
swatchUIDis the swatchUID to test.
usageTypeis the type of references wanted for this swatch.
Returns
true if swatch is used in the manner specified by usageType.
virtual bool16 ISwatchUtils::SwatchIsVisible (IDataBaseiDataBase,
UID swatchUID 
)
pure virtual

Return true if the given swatch is visible in the list.

Parameters
iDataBasethe database of the swatch UID to check.
swatchUIDthe swatch UID to check.
Returns
kTrue if specified swatch is a visible swatch.
virtual void ISwatchUtils::SynchronizeAliasedSwatchInkDataOldAndNew (ISwatchListiSwatchList,
const UIDRefswatchRef,
UID newUID 
)
pure virtual

A utility function to synchronize aliased swatch's ink data from old to new.

Parameters
swatchListthe target swatch list.
swatchRefthe original swatch alias UID.
newUIDthe new swatch alias UID.
virtual void ISwatchUtils::SynchronizeTintsOfAliasedSwatchOldAndNew (ISwatchListiSwatchList,
const UIDRefswatchRef,
UID newUID 
)
pure virtual

A utility function to synchronize tint swatches of aliased swatch from old alias to new alias.

Parameters
swatchListthe target swatch list.
swatchRefthe original swatch alias UID.
newUIDthe new swatch alias UID.
virtual bool16 ISwatchUtils::SyncMixedInkSwatchesColorData (IDataBaseiSrcDB,
IDataBaseiTargetDB,
IRenderingObjectiSrcRenderObject,
IRenderingObjectiTargetRenderObject,
ColorArraynewComponents 
)
pure virtual

Reutrn true and the target's color components are sync to the same order as source if two rendering objects are mixed ink swatches and they are equivalent. They are equivalent if they are exactly equal or if their ink lists contains same inks though inks may not appear in the same order and ink contribution data are the same. Otherwise, it returns kFalse and newComponents is cleared.

Parameters
iSrcDBthe database of the source mixed ink rendering object.
iTargetDBthe database of the source mixed ink rendering object.
iSrcRenderObjectthe source mixed ink rendering object.
iTargetRenderObjectthe target mixed ink rendering object.
newComponentsthe color components of target in the order of source ink list.
Returns
kTrue if iSrcRenderObject and iTargetRenderObject are equivalent.
virtual bool16 ISwatchUtils::TintColorSwatchAlreadyExists (const UIDbaseObjectUID,
const PMRealtint,
ISwatchListswatchList = nil,
UIDRefmatchedRef = nil 
)
pure virtual

Reutrn true if the given swatch and tint value already exists in the swatch list.

Parameters
baseObjectUIDthe base color swatch UID.
tintthe tint value to check.
swatchListspecifies the swatch list of the baseObjectUID
matchedRefif not nil, the matched tint swatch UID is returned.
Returns
kTrue if a match is found in the swatchList.