InDesign C++ SDK: Which PMIID / Protocol should I observe to detect swatch changes
Hi everyone,
I am developing an InDesign C++ SDK plugin that features a custom UI panel containing an EVEColorListDropDownWidget. My goal is to keep this color dropdown widget automatically synchronized whenever changes occur to the document's swatches—including adding new swatches, deleting existing ones, or modifying swatch properties (such as color values or swatch names).
I am implementing a custom CObserver class attached to the active document (kDocBoss) via ISubject. However, I am unsure about the exact PMIID protocols required to reliably catch all relevant swatch events.
Specifically, I would like to ask:
-
Which PMIID(s) should I listen to? Should I attach my observer using
IID_ISWATCHLIST, or a combination of them? -
Where should I attach the Observer? Is attaching to the document's
ISubject(kDocBoss) sufficient, or do I need to attach directly toISwatchList/kSwatchListBoss? -
Command Filtering: In the
Update()method, which ClassIDs (theChangeparameter) should I handle to cover additions, deletions, name updates, and color modifications (e.g.,kAddSwatchCmdBoss,kModifyColorCmdBoss)?
