![]() | InDesign SDK 20.5 |
#include <ISwatchList.h>

Public Types | |
| enum | { kDefaultIID = IID_ISWATCHLIST } |
| enum | { kNotFound = -1 } |
Public Member Functions | |
| virtual void | Init ()=0 |
| virtual UIDRef | FindSwatch (const PMString &name) const =0 |
| virtual UIDRef | FindSwatch (const int32 &colorSpace, const ColorArray &colorArray) const =0 |
| virtual UIDRef | FindSwatch (IColorData *colorData) const =0 |
| virtual UIDRef | FindSwatch (IGradientFill *gradient) const =0 |
| virtual int32 | SwatchLocation (const UID &swatchUID) const =0 |
| virtual int32 | VisibleSwatchLocation (const UID &swatch) const =0 |
| virtual int32 | GetNumSwatches () const =0 |
| virtual int32 | GetNumVisibleSwatches () const =0 |
| virtual int32 | GetNumNamedSwatches () const =0 |
| virtual UIDRef | GetNthSwatch (int32 index) const =0 |
| virtual UIDRef | GetNthVisibleSwatch (int32 index) const =0 |
| virtual UIDRef | GetNthNamedSwatch (int32 index) const =0 |
| virtual void | AddSwatch (const UID &swatch)=0 |
| virtual void | RemoveSwatch (const UID &swatch)=0 |
| virtual void | RemoveSwatch (const UIDList *itemList)=0 |
| virtual void | Move (int32 fromIndex, int32 toIndex)=0 |
| virtual void | SortVisibleSwatchesByName ()=0 |
| virtual UID | GetBlackSwatchUID () const =0 |
| virtual UID | GetPaperSwatchUID () const =0 |
| virtual UID | GetRegistrationSwatchUID () const =0 |
| virtual UID | GetNoneSwatchUID () const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
An interface for managing InDesign swatch list. A swatch is a rendering object boss derived from kK2RenderObjectBoss and must implement IRenderingObject interface. All rendering object must also provide IRenderObjectService implementation through kRenderingObjectService service provider. This facilitates the management of the rendering objects. In addition, all rendering objects must also provide creation, change, and deletion commands. For example, the solid color objects are kPMColorBoss. It provides kNewColorCmdBoss for creating new basic color objects, kChangeColorCmdBoss for changing properties of the colors, and kDeleteColorCmdBoss for deleting the color opbjects.
The swatches can be unnamed or named. Swatches can also be visible in the UI or not.
Currently supported rendering objects (or swatches) are kPMColorBoss, kGradientRenderingObjectBoss, and kGraphicStateNoneRenderingObjectBoss.
| pure virtual |
Add swatch to the list. This should also update the visible list based on its visibility setting.
| swatch | the new swatch UID to add. This should be an UID of a rendering object boss. |
| pure virtual |
Find a swatch by color space and components in the list and return the swatch UIDRef.
| colorSpace | the color space to find. |
| colorArray | the color value to find. |
| pure virtual |
Find a swatch by content of color data in the list and return the swatch UIDRef.
| colorData | the color data to find. |
| pure virtual |
Find a swatch by content of gradient data in the list and return the swatch UIDRef.
| gradient | the gradient data to find. |
| pure virtual |
Return the UID of the [Black] swatch. If not in the list, kInvalidUID is returned.
| pure virtual |
Return the UID of the [None] swatch. If not in the list, kInvalidUID is returned.
| pure virtual |
Returns the UIDRef of the nth named swatch in the named list. Returns kInvalidUID if there are no named swatches. The ordering swatches in this list may not be the same as the visible list or the total list.
| index | the nth named swatch starting from index 0. |
| pure virtual |
| pure virtual |
Returns the UIDRef of the nth swatch in the visible list. Returns kInvalidUID if there are no visible swatches. The order ot these swatches is the order shown in the swatches panel.
| index | the nth visible swatch starting from index 0. |
| pure virtual |
Returns the number of named swatches if any.
| pure virtual |
Get total number of swatches in the list, including unnamed swatches, hidden swatches and visible swatches (swatches shown in the swatch panel).
| pure virtual |
Returns the number of visible swatches if any.
| pure virtual |
Return the UID of the [Paper] swatch. If not in the list, kInvalidUID is returned.
| pure virtual |
Return the UID of the [Registration] swatch. If not in the list, kInvalidUID is returned.
| pure virtual |
Initialize the swatch list.
| pure virtual |
Move a swatch at fromIndex position to toIndex position in the visible list.
| fromIndex | the original position of the swatch. |
| toIndex | the new position of the swatch. |
| pure virtual |
Remove swatch from the list. This should also update the visible list based on its visibility setting if necessary.
| swatch | the swatch UID to remove. This should be an UID of a rendering object boss. |
| pure virtual |
Remove a list of swatches from the swatch list. This should also updates the visible list based on their visibility setting if necessary.
| itemList | the list of swatches to remove. These should be UIDs of rendering object bosses. |
| pure virtual |
Sort the visible swatch list by name in the alphabetical order. If all swatches are unnamed, then this method does nothing.
| pure virtual |
Find a swatch by the Swatch UID and return its index in the swatch list.
| swatchUID | the swatch UID to find. |
| pure virtual |
Find a swatch by UID and return its index in the visible list.
| swatchUID | the swatch UID to find. |