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

#include <CDialogController.h>

Inheritance diagram for CDialogController:
CPMUnknown< IDialogController >IDialogControllerIPMUnknownBPIDlgControllerBscDlgDialogControllerBscL10NDialogControllerCSelectableDialogControllerCusDtLnkUIBrowsDialogControllerFrmLblUIDialogControllerHidTxtEdDlgControllerPDFVTUIDialogControllerPstLstUIDlgControllerSnapDialogControllerSnipRunDialogControllerTblBscDialogControllerTranFxUIDialogControllerTxtExpDialogControllerWatermarkUIDialogControllerWFPDialogControllerXDocBkUIDialogController

Public Member Functions

 CDialogController (IPMUnknown *boss)
 
virtual void UserCancelled ()
 
virtual void ClosingDialog (IActiveContext *lastChanceToUseMyContext)
 
virtual bool16 HasBeenInitialized () const
 
virtual void SetInitialized (bool16 initialized)
 
virtual void SetOwner (IControlView *ownerPanel)
 
virtual IControlViewGetOwner () const
 
virtual void GetName (PMString &name)
 
Dialog helper methods
virtual void SetTextControlData (const WidgetID &widgetId, const PMString &text, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual PMString GetTextControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const
 
virtual void SetTextValue (const WidgetID &widgetId, const PMReal &value, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual PMReal GetTextValue (const WidgetID &widgetId, const IPanelControlData *panel=nil, bool16 *outParsingError=nil, bool16 *outIsBlank=nil) const
 
virtual void SetTextValueControlState (const WidgetID &widgetId, ITextValue::TextControlState controlState, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual
ITextValue::TextControlState 
GetTextValueControlState (const WidgetID &widgetId, const IPanelControlData *panel=nil) const
 
virtual void SetBooleanControlData (const WidgetID &widgetId, bool16 isChecked, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual bool16 GetBooleanControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const
 
virtual void SetTriStateControlData (const WidgetID &widgetId, bool16 isSelected, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual void SetTriStateControlData (const WidgetID &widgetId, ITriStateControlData::TriState triState, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual
ITriStateControlData::TriState 
GetTriStateControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const
 
virtual WidgetID GetSelectedClusterWidget (WidgetID cluster, const IPanelControlData *panel=nil)
 
virtual void SetSelectedClusterWidget (WidgetID clusterId, WidgetID widgetToSelect, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)
 
virtual IStringListControlDataQueryListControlDataInterface (const WidgetID &widgetId, const IPanelControlData *panel=nil) const
 
virtual IPanelControlDataQueryIfNilElseAddRef (const IPanelControlData *panel) const
 
virtual void SelectDialogWidget (const WidgetID &widgetId)
 
virtual bool16 GetPreviewModeOn ()
 
virtual void SetPreviewModeOn (bool16 bOn)
 
virtual IActiveContextQueryDialogContext ()
 
- Public Member Functions inherited from CPMUnknown< IDialogController >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 
Dialog protocol
Dialog query methods
Owner query methods
Previewable dialog methods
Dialog helper methods

Protected Member Functions

virtual void InitializeDialogFields (IActiveContext *context)
 
virtual WidgetID ValidateDialogFields (IActiveContext *myContext)
 
virtual void ApplyDialogFields (IActiveContext *myContext, const WidgetID &widgetId)
 
virtual void ResetDialogFields (IActiveContext *myContext)
 
- Protected Member Functions inherited from CPMUnknown< IDialogController >
 CPMUnknown (IPMUnknown *boss)
 

Friends

class QAFontDlgController
 

Additional Inherited Members

- Public Types inherited from IDialogController
enum  { kDefaultIID = IID_IDIALOGCONTROLLER }
 
- Protected Attributes inherited from CPMUnknown< IDialogController >
HelperInterface fHelperInterface
 

Detailed Description

Basic implementation of the IDialogController interface, used to control dialogs. Implementors of IDialogController should derive from CDialogController.

See Also
IDialogController

Member Function Documentation

virtual void CDialogController::ApplyDialogFields (IActiveContextmyContext,
const WidgetIDwidgetId 
)
protectedvirtual

Override to retrieve data from the widgets in the dialog and apply it. By default the widget with id kOKButtonWidgetID causes an apply. Override Update to have others call "ApplyDialog"

Parameters
myContextIN the active context
widgetIdIN the widget that triggered the "apply"

Reimplemented in SnapDialogController, PDFVTUIDialogController, SnipRunDialogController, CusDtLnkUIBrowsDialogController, TxtExpDialogController, WatermarkUIDialogController, FrmLblUIDialogController, BscL10NDialogController, BscDlgDialogController, TranFxUIDialogController, WFPDialogController, XDocBkUIDialogController, PstLstUIDlgController, BPIDlgController, TblBscDialogController, HidTxtEdDlgController, and CSelectableDialogController.

virtual void CDialogController::ClosingDialog (IActiveContextlastChanceToUseMyContext)
virtual

Override to be called during the process of closing the dialog, an opportunity to do some special cleanup. Default implementation is empty.

Reimplemented in SnipRunDialogController, XDocBkUIDialogController, and CSelectableDialogController.

virtual bool16 CDialogController::GetBooleanControlData (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil 
) const
virtual

Get the value of a widget that has boolean control data.

Implements IDialogController.

virtual void CDialogController::GetName (PMStringname)
virtual

Override to supply the undo/redo name for the dialog. This appears in the edit menu if the user hits "OK" in a previewable dialog. Default implementation returns the window title of the dialog window.

Implements IDialogController.

virtual IControlView* CDialogController::GetOwner () const
virtual

Get the owner panel of this dialog

Returns
the owner panel, may return nil

Implements IDialogController.

virtual bool16 CDialogController::GetPreviewModeOn ()
virtual

Get the value of the "Preview Mode On" flag (used to be in CDialogObserver).

Implements IDialogController.

virtual WidgetID CDialogController::GetSelectedClusterWidget (WidgetID cluster,
const IPanelControlDatapanel = nil 
)
virtual

Get the selected widget in a cluster

Implements IDialogController.

virtual PMString CDialogController::GetTextControlData (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil 
) const
virtual

Get the text of a widget that has text control data.

Implements IDialogController.

virtual PMReal CDialogController::GetTextValue (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil,
bool16 * outParsingError = nil,
bool16 * outIsBlank = nil 
) const
virtual

Get the value of a widget with an ITextValue interface.

Implements IDialogController.

virtual ITextValue::TextControlState CDialogController::GetTextValueControlState (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil 
) const
virtual

Get the control-state of a widget with an ITextValue interface.

Implements IDialogController.

virtual ITriStateControlData::TriState CDialogController::GetTriStateControlData (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil 
) const
virtual

Get the value of a widget that has tristate control data.

Implements IDialogController.

virtual bool16 CDialogController::HasBeenInitialized () const
virtual

Returns kTrue if InitializeFields() has been called.

Implements IDialogController.

virtual void CDialogController::InitializeDialogFields (IActiveContextcontext)
protectedvirtual
virtual IActiveContext* CDialogController::QueryDialogContext ()
virtual

Query for the dialog context established when the dialog was initialized

Implements IDialogController.

virtual IPanelControlData* CDialogController::QueryIfNilElseAddRef (const IPanelControlDatapanel) const
virtual

Internal utility routine to do what it sez.

Implements IDialogController.

virtual IStringListControlData* CDialogController::QueryListControlDataInterface (const WidgetIDwidgetId,
const IPanelControlDatapanel = nil 
) const
virtual

Query for the list control data from a widget

Implements IDialogController.

virtual void CDialogController::ResetDialogFields (IActiveContextmyContext)
protectedvirtual

Override to modify the default Reset behavior. Called when the user holds down the option/alt key and the cancel button changes to "Reset" and then clicks on the reset button. By default, this function simply calls InitializeDialogFields. For most dialogs, this results in the correct behavior.

Parameters
myContextIN the active context

Reimplemented in CSelectableDialogController.

virtual void CDialogController::SelectDialogWidget (const WidgetIDwidgetId)
virtual

This method is typically used in conjuntion with Validate() to select the widget that has "illegal" values.

Implements IDialogController.

Reimplemented in CSelectableDialogController.

virtual void CDialogController::SetBooleanControlData (const WidgetIDwidgetId,
bool16 isChecked,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the value of a widget that has boolean control data.

Implements IDialogController.

virtual void CDialogController::SetInitialized (bool16 initialized)
virtual

Subclasses can call this to set the initialized state, instead of calling the inherited Initialize functions.

Implements IDialogController.

virtual void CDialogController::SetOwner (IControlViewownerPanel)
virtual

Set the owner panel of this dialog.

Parameters
ownerPanelIN the owner panel

Implements IDialogController.

virtual void CDialogController::SetPreviewModeOn (bool16 bOn)
virtual

Set the value of the "Preview Mode On" flag (used to be in CDialogObserver).

Implements IDialogController.

virtual void CDialogController::SetSelectedClusterWidget (WidgetID clusterId,
WidgetID widgetToSelect,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the selected widget in a cluster

Implements IDialogController.

virtual void CDialogController::SetTextControlData (const WidgetIDwidgetId,
const PMStringtext,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the text of a widget that has text control data.

Implements IDialogController.

virtual void CDialogController::SetTextValue (const WidgetIDwidgetId,
const PMRealvalue,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the value of a widget with an ITextValue interface.

Implements IDialogController.

virtual void CDialogController::SetTextValueControlState (const WidgetIDwidgetId,
ITextValue::TextControlState controlState,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the control-state of a widget with an ITextValue interface.

Implements IDialogController.

virtual void CDialogController::SetTriStateControlData (const WidgetIDwidgetId,
bool16 isSelected,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the value of a widget that has tristate control data.

Implements IDialogController.

virtual void CDialogController::SetTriStateControlData (const WidgetIDwidgetId,
ITriStateControlData::TriState triState,
const IPanelControlDatapanel = nil,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
virtual

Set the value of a widget that has tristate control data.

Implements IDialogController.

virtual void CDialogController::UserCancelled ()
virtual

Override to be called when the user clicks the "cancel" button. Default implementation is empty.

Implements IDialogController.

Reimplemented in SnipRunDialogController, TxtExpDialogController, and CSelectableDialogController.

virtual WidgetID CDialogController::ValidateDialogFields (IActiveContextmyContext)
protectedvirtual

Override to be called when the user clicks the "ok" (or equivalent) button. Use ValidateFields to check that the data in each dialog control is valid and within limits. It's up to the subclass to display an alert if invalid data is found. If one or more of the fields have invalid data, return the WidgetID of the dialog item to select. If all fields are valid, return kDefaultWidgetId. When all fields are valid, the "ApplyDialogFields" function will be called.

Parameters
myContextIN the active context
Returns
id of the first widget with invalid data

Reimplemented in SnapDialogController, PDFVTUIDialogController, SnipRunDialogController, TxtExpDialogController, WatermarkUIDialogController, CusDtLnkUIBrowsDialogController, FrmLblUIDialogController, BscL10NDialogController, TranFxUIDialogController, BscDlgDialogController, WFPDialogController, XDocBkUIDialogController, and CSelectableDialogController.