InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SwatchesObserver Class Reference

#include <SwatchesObserver.h>

Inheritance diagram for SwatchesObserver:
CObserverIObserverIPMUnknown

Public Member Functions

 SwatchesObserver (IPMUnknown *boss)
 
virtual void Update (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
- Public Member Functions inherited from CObserver
 CObserver (IPMUnknown *boss, PMIID interfaceID=IID_IOBSERVER)
 
IChangeManagerGetChangeManager () const
 
virtual void SetAttachIID (PMIID iid)
 
virtual PMIID GetAttachIID () const
 
virtual void SetEnabled (bool16 state)
 
virtual bool16 IsEnabled () const
 
virtual void LazyUpdate (ISubject *theSubject, const PMIID &protocol, const LazyNotificationData *data)
 

Protected Member Functions

virtual bool16 UpdateSwatchesUIDData (IGraphicStateRenderObjects *iGfxStateRenderObjects, const ClassID &theChange)
 
virtual bool16 UpdateRenderObject (IGraphicStateRenderObjects *iGfxStateRenderObjects, ClassID targetRenderObjectClassID, UID targetRenderingUID, UID prevRenderingUID)
 
virtual bool16 ApplyRenderObjectAttributes (IDataBase *iDataBase, UID targetRenderingUID, UID prevRenderingUID, bool16 swatchIsUniqueSelection=kFalse)
 
virtual bool16 ProcessGraphicStateChanges (IGraphicStateRenderObjects *iGfxStateRenderObjects, UIDRef swatchRef, const ClassID &theChange)
 

Protected Attributes

PMIID fAttachAsIID
 
PMIID fAttachToIID
 
- Protected Attributes inherited from CObserver
bool16 fDetachSubjectsOnDelete
 
PMIID fAttachIID
 
const UIDRef fThisRef
 
bool16 fEnabled
 

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 

Detailed Description

An observer class responds to changes in the swatch list widget selection. As a result of updating the widget selection, it may also interact with the graphic state object. This observer lives on the swatch list widget.

See Also
also CObserver.h for detail description of Update, AutoAttach, and AutoDetach.

Member Function Documentation

virtual bool16 SwatchesObserver::ApplyRenderObjectAttributes (IDataBaseiDataBase,
UID targetRenderingUID,
UID prevRenderingUID,
bool16 swatchIsUniqueSelection = kFalse 
)
protectedvirtual

Apply relevant render object attributes to the graphic state based on the new rendering object.

Parameters
iDataBaseis the database of the new rendering object UID.
targetRenderingUIDis the new rendering object UID.
prevRenderingUIDis the previous rendering object UID of the same rendering class.
swatchIsUniqueSelectionis true if this rendering UID is the unique selection and not part of the multiple selection.
virtual void SwatchesObserver::AutoAttach ()
virtual

Called when this observer should attach to the subject(s) that it observes.

Reimplemented from CObserver.

virtual void SwatchesObserver::AutoDetach ()
virtual

Called when this observer should automatically detach from the subject(s) that it observes.

Reimplemented from CObserver.

virtual bool16 SwatchesObserver::ProcessGraphicStateChanges (IGraphicStateRenderObjectsiGfxStateRenderObjects,
UIDRef swatchRef,
const ClassIDtheChange 
)
protectedvirtual

Update the graphic state based on the changes.

Parameters
iGfxStateRenderObjectsis usually the active graphic state objects.
swatchRefis the new rendering object UIDRef of the swatch selection is updating to.
theChangeis the type of change.
virtual void SwatchesObserver::Update (const ClassIDtheChange,
ISubjecttheSubject,
const PMIIDprotocol,
void * changedBy 
)
virtual

Responds to interested change messages.

Parameters
theChangeis the change message.
theSubjectis the subject broadcasting the change.
protocolis the change message protocol.
changedByis any additional data passed along by the change subject.

Implements IObserver.

virtual bool16 SwatchesObserver::UpdateRenderObject (IGraphicStateRenderObjectsiGfxStateRenderObjects,
ClassID targetRenderObjectClassID,
UID targetRenderingUID,
UID prevRenderingUID 
)
protectedvirtual

Change graphic state render data to update the render object. Additionaly it may also create and process a attribute command that is related to the rendering object being udpated.

Parameters
iGfxStateRenderObjectsis usually the active graphic state objects.
targetRenderObjectClassIDis the new rendering class ID the swatch selection is updating to.
targetRenderingUIDis the corresponding rendering object UID.
prevRenderingUIDis the previous rendering object UID of the same rendering class.
virtual bool16 SwatchesObserver::UpdateSwatchesUIDData (IGraphicStateRenderObjectsiGfxStateRenderObjects,
const ClassIDtheChange 
)
protectedvirtual

Update the swatch list widget's swatches UID list to reflect the current selections in the swatches list widget. The implementation assumes we have an IListControlDataOf interface and swatch list widget has access to a IColorViewData interface. It also sorts the selection list so that the order of UIDList reflects the order the swatches in the swatch list widget. If your panel does not conform to this assumption, then it must be overwritten by the subclasses.

Parameters
iGfxStateRenderObjectsis usually the active graphic state objects.
theChangeis the type of change.

Member Data Documentation

PMIID SwatchesObserver::fAttachAsIID
protected

fAttachAsIID is the attached IID of the observer.

PMIID SwatchesObserver::fAttachToIID
protected

fAttachToIID is the interested procotol IID being observered.