InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDialogController Class Referenceabstract

#include <IDialogController.h>

Inheritance diagram for IDialogController:
IPMUnknownCPMUnknown< IDialogController >CDialogControllerBPIDlgControllerBscDlgDialogControllerBscL10NDialogControllerCSelectableDialogControllerCusDtLnkUIBrowsDialogControllerFrmLblUIDialogControllerHidTxtEdDlgControllerPDFVTUIDialogControllerPstLstUIDlgControllerSnapDialogControllerSnipRunDialogControllerTblBscDialogControllerTranFxUIDialogControllerTxtExpDialogControllerWatermarkUIDialogControllerWFPDialogControllerXDocBkUIDialogController

Public Types

enum  { kDefaultIID = IID_IDIALOGCONTROLLER }
 

Public Member Functions

Dialog protocol
virtual void InitializeDialog (IActiveContext *context)=0
 
virtual IActiveContextQueryDialogContext ()=0
 
virtual WidgetID ValidateDialog ()=0
 
virtual void ApplyDialog (const WidgetID &widgetId)=0
 
virtual void ResetDialog ()=0
 
virtual void UserCancelled ()=0
 
virtual void DialogClosing ()=0
 
Dialog query methods
virtual bool16 HasBeenInitialized () const =0
 
virtual void SetInitialized (bool16 initialized)=0
 
Owner query methods
virtual void SetOwner (IControlView *ownerPanel)=0
 
virtual IControlViewGetOwner () const =0
 
Previewable dialog methods
virtual void GetName (PMString &name)=0
 
Dialog helper methods
virtual void SetTextControlData (const WidgetID &widgetId, const PMString &text, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual PMString GetTextControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const =0
 
virtual void SetTextValue (const WidgetID &widgetId, const PMReal &value, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual PMReal GetTextValue (const WidgetID &widgetId, const IPanelControlData *panel=nil, bool16 *outParsingError=nil, bool16 *outIsBlank=nil) const =0
 
virtual void SetTextValueControlState (const WidgetID &widgetId, ITextValue::TextControlState controlState, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual
ITextValue::TextControlState 
GetTextValueControlState (const WidgetID &widgetId, const IPanelControlData *panel=nil) const =0
 
virtual void SetBooleanControlData (const WidgetID &widgetId, bool16 isChecked, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual bool16 GetBooleanControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const =0
 
virtual void SetTriStateControlData (const WidgetID &widgetId, ITriStateControlData::TriState triState, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual void SetTriStateControlData (const WidgetID &widgetId, bool16 isSelected, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual
ITriStateControlData::TriState 
GetTriStateControlData (const WidgetID &widgetId, const IPanelControlData *panel=nil) const =0
 
virtual WidgetID GetSelectedClusterWidget (WidgetID cluster, const IPanelControlData *panel=nil)=0
 
virtual void SetSelectedClusterWidget (WidgetID clusterId, WidgetID widgetToSelect, const IPanelControlData *panel=nil, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual IStringListControlDataQueryListControlDataInterface (const WidgetID &widgetId, const IPanelControlData *panel=nil) const =0
 
virtual IPanelControlDataQueryIfNilElseAddRef (const IPanelControlData *panel) const =0
 
virtual void SelectDialogWidget (const WidgetID &widgetId)=0
 
virtual bool16 GetPreviewModeOn ()=0
 
virtual void SetPreviewModeOn (bool16 bOn)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Interface that client code should implement for dialog.

Member Function Documentation

virtual void IDialogController::ApplyDialog (const WidgetIDwidgetId)
pure virtual

Should be overridden to retrieve data from the widgets in the dialog and apply it. The widget that caused the apply is passed in 'widgetId. By default the widget with id kOKButtonWidgetID causes an apply. Override Update to have others call ApplyFields.

Parameters
widgetIdwidget that caused the apply
virtual void IDialogController::DialogClosing ()
pure virtual

This function is called during the process of closing the dialog. This gives subclassers an opportunity to do some special cleanup.

virtual void IDialogController::GetName (PMStringname)
pure virtual

Accessor for name.

Implemented in CDialogController.

virtual IControlView* IDialogController::GetOwner () const
pure virtual

Get the owner panel of this dialog. This function may return nil.

Returns
reference to IControlView interface on panel boss object that owns this dialog, or nil if no current owner.

Implemented in CDialogController.

virtual bool16 IDialogController::GetPreviewModeOn ()
pure virtual

Access a flag that used to be in CDialogObserver

Implemented in CDialogController.

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

Helper method to get which widget in a cluster is selected

Implemented in CDialogController.

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

Helper methods for easily getting the text from a widget that has text control data.

Implemented in CDialogController.

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

Gets the value of a widget with an ITextValue interface.

Implemented in CDialogController.

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

Gets the control-state from a widget(editbox) that has an ITextValue interface.

Implemented in CDialogController.

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

Helper methods for easily getting the state of a widget that has tristate control data.

Implemented in CDialogController.

virtual bool16 IDialogController::HasBeenInitialized () const
pure virtual

Returns kTrue if InitializeFields() has been called.

Implemented in CDialogController.

virtual void IDialogController::InitializeDialog (IActiveContextcontext)
pure virtual

Should be overridden to initialize each widget in the dialog with its default value.

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

Query for the data interface of a widget that has list control data.

Implemented in CDialogController.

virtual void IDialogController::ResetDialog ()
pure virtual

This function is 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 InitializeFields. For most dialogs, this results in the correct behavior.

virtual void IDialogController::SelectDialogWidget (const WidgetIDwidgetId)
pure virtual

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

Implemented in CDialogController, and CSelectableDialogController.

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

Helper methods for easily setting and getting the state of a widget that has boolean control data.

Implemented in CDialogController.

virtual void IDialogController::SetInitialized (bool16 initialized)
pure virtual

This method exists so that subclasses don't have to call the inherited InitializeFields() function.

Implemented in CDialogController.

virtual void IDialogController::SetOwner (IControlViewownerPanel)
pure virtual

Set the owner panel of this dialog.

Implemented in CDialogController.

virtual void IDialogController::SetPreviewModeOn (bool16 bOn)
pure virtual

Manage a flag that used to be in CDialogObserver

Implemented in CDialogController.

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

Helper method to set which widget in a cluster is selected

Implemented in CDialogController.

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

Helper methods for easily setting the text of a widget that has text control data.

Implemented in CDialogController.

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

Sets value of a widget with an ITextValue interface.

Implemented in CDialogController.

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

Sets the control-state of a widget(editbox) that has an ITextValue interface.

Implemented in CDialogController.

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

Helper methods for easily setting the state of a widget that has tristate control data.

Implemented in CDialogController.

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

Helper methods for easily setting the state of a widget that has tristate control data.

Implemented in CDialogController.

virtual void IDialogController::UserCancelled ()
pure virtual

This function is called when the user clicks the "cancel" button. Override if the dialog needs to know when this happens.

Implemented in CDialogController, SnipRunDialogController, TxtExpDialogController, and CSelectableDialogController.

virtual WidgetID IDialogController::ValidateDialog ()
pure virtual

This function is called when the user clicks the "ok" (or equivalent) button. Override 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 one or more of the fields have invalid data, return the WidgetID of the dialog item to select. If all fields are valid, return kNoInvalidWidgets. When all fields are valid, the ApplyFields function will be called.

Returns
WidgetID of dialog item with invalid data, or kNoInvalidWidgets if data validated successfully