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

#include <CWidgetObserver.h>

Inheritance diagram for CWidgetObserver:
CObserverIObserverIPMUnknown

Public Member Functions

 CWidgetObserver (IPMUnknown *boss)
 
- Public Member Functions inherited from CObserver
 CObserver (IPMUnknown *boss, PMIID interfaceID=IID_IOBSERVER)
 
IChangeManagerGetChangeManager () const
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
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)
 
- Public Member Functions inherited from IObserver
virtual void Update (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Protected Member Functions

void AttachToWidget (const WidgetID &widgetId, const PMIID &interestedIn=IID_IUNKNOWN, const PMIID &asObserver=IID_IOBSERVER, IPMUnknown *widget=nil)
 
void DetachFromWidget (const WidgetID &widgetId, const PMIID &interestedIn=IID_IUNKNOWN, const PMIID &asObserver=IID_IOBSERVER, IPMUnknown *widget=nil)
 
virtual void SetTextControlData (const WidgetID &widgetId, const PMString &text, IPMUnknown *widget=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual PMString GetTextControlData (const WidgetID &widgetId, IPMUnknown *widget=nil) const
 
virtual void SetTriStateControlData (const WidgetID &widgetId, const ITriStateControlData::TriState &triState, IPMUnknown *widget, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual
ITriStateControlData::TriState 
GetTriStateControlData (const WidgetID &widgetId, IPMUnknown *widget=nil) const
 

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 
- Protected Attributes inherited from CObserver
bool16 fDetachSubjectsOnDelete
 
PMIID fAttachIID
 
const UIDRef fThisRef
 
bool16 fEnabled
 

Detailed Description

This class provides a few handy routines useful to observers that deal with certian kinds of widgets.

Constructor & Destructor Documentation

CWidgetObserver::CWidgetObserver (IPMUnknownboss)

constructor

Member Function Documentation

void CWidgetObserver::AttachToWidget (const WidgetIDwidgetId,
const PMIIDinterestedIn = IID_IUNKNOWN,
const PMIIDasObserver = IID_IOBSERVER,
IPMUnknownwidget = nil 
)
protected

Attach Helper Method. Simplifies attaching to another widget in the same window.

Parameters
widgetIdThe widget to attach to
interestedInwhich IID to attach to
asObserverthe IID of this observer. Usually this is IID_IOBSERVER, but when there are 2 or more observers on a widget, only one gets to use IID_IOBSERVER
widgeta widget in the same widget hierarchy as the widget to attach to. If you pass nil, it is assumed that 'this' points to a widget in the same hierarchy as the widget to attach to.
void CWidgetObserver::DetachFromWidget (const WidgetIDwidgetId,
const PMIIDinterestedIn = IID_IUNKNOWN,
const PMIIDasObserver = IID_IOBSERVER,
IPMUnknownwidget = nil 
)
protected

Detach Helper Method. Simplifies detaching from another widget in the same window.

Parameters
widgetIdThe widget to detach from
interestedInwhich IID to detach from
asObserverthe IID of this observer. Usually this is IID_IOBSERVER, but when there are 2 or more observers on a widget, only one gets to use IID_IOBSERVER
widgeta widget in the same widget hierarchy as the widget to detach from. If you pass nil, it is assumed that 'this' points to a widget in the same hierarchy as the widget to detach from.
virtual PMString CWidgetObserver::GetTextControlData (const WidgetIDwidgetId,
IPMUnknownwidget = nil 
) const
protectedvirtual

Helper method to get the string from the ITextControlData of some widget

Parameters
widgetIdthe widget whose data you want to get.
widgeta widget in the same hierarchy as the widget to get the data for. If you pass nil, 'this' is assumed to be a widget in the same hierarchy.
Returns
the string from the ITextControlData of the requested widget
virtual ITriStateControlData::TriState CWidgetObserver::GetTriStateControlData (const WidgetIDwidgetId,
IPMUnknownwidget = nil 
) const
protectedvirtual

Helper method to get the state from the ITriStateControlData of some widget

Parameters
widgetIdthe widget whose data you want to get.
widgeta widget in the same hierarchy as the widget to get the data for. If you pass nil, 'this' is assumed to be a widget in the same hierarchy.
Returns
the state from the ITriStateControlData of the requested widget
virtual void CWidgetObserver::SetTextControlData (const WidgetIDwidgetId,
const PMStringtext,
IPMUnknownwidget = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
protectedvirtual

Helper method to set ITextControlData string

Parameters
widgetIdthe widget whose data you want to set.
textthe string to put on the widget
widgeta widget in the same hierarchy as the widget to set the data for. If you pass nil, 'this' is assumed to be a widget in the same hierarchy.
invalidateshould we invalidate the view when setting the data?
notifyOfChangeshould we send out a notification when changing the data?
virtual void CWidgetObserver::SetTriStateControlData (const WidgetIDwidgetId,
const ITriStateControlData::TriStatetriState,
IPMUnknownwidget,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
protectedvirtual

Helper method to set ITriStateControlData

Parameters
widgetIdthe widget whose data you want to set.
triStatethe new state for the widget
widgeta widget in the same hierarchy as the widget to set the data for. If you pass nil, 'this' is assumed to be a widget in the same hierarchy.
invalidateshould we invalidate the view when setting the data?
notifyOfChangeshould we send out a notification when changing the data?