ADMBaseDialog Class Reference

Base class for ADM dialogs. More...

#include <ADMBaseDialog.h>

Inherited by AboutDialog, ADMBaseWizPage, LicenseDialog, and RequestProgressDialog.

Collaboration diagram for ADMBaseDialog:
Collaboration graph
[legend]

List of all members.

Classes

struct  ADMBaseControlList
 Helper class for control objects list; will delete them when closed. More...

Public Member Functions

 ADMBaseDialog (const char *pName, ASInt32 uID)
 Constructs a dialog object (but does not show it - for that call DoModal!).
virtual ~ADMBaseDialog ()
 Destructor.
AVWindow GetAVWindow ()
 Retrieve the Acrobat window reference for the dialog.
ASInt32 DoModal ()
 Displays the dialog and returns the dialog return value (usually, the button used to close it).
virtual void OnBtnClicked (ASInt32 nID)
 Called by notification buttons.
virtual bool ConnectControl (ASInt32 nID, ADMBaseControl &control)
 Helper function to connect a control object to an ADM control.
virtual bool ConnectControl (ASInt32 nID, ADMBaseControl &control, unsigned int uFlags)
 Helper function to connect a control object to an ADM control with flags.
virtual void SetOKBtn (ASInt32 nID=IDOK, bool bSetDefault=true)
 Sets the OK button.
virtual void SetCancelBtn (ASInt32 nID=IDCANCEL, bool bSetDefault=false)
 Sets the cancel button.
virtual void AddNotifyBtn (ASInt32 nID, bool bSetDefault=false)
 Sets a dialog control as a notification button.
virtual void AddClosingBtn (ASInt32 nID, bool bSetDefault=false, bool bNotify=true)
 Sets a dialog control as a dialog-closing button.
virtual void AddNotifyRange (ASInt32 nID, int nCount)
 Call to set click notification for a range of buttons.
bool SetControlText (ASInt32 nID, const char *pText)
 Set control text.
int GetSelectedRadio (ASInt32 nIDFirst, int nCount)
 Set a selected radio in a group.
bool ShowControl (ASInt32 nID, ASBoolean bShow=true)
 Show or hide a control.
bool EnableControl (ASInt32 nID, ASBoolean bEnable)
 Enable or disable a control.
bool IsChecked (ASInt32 nID)
 Get checked status for a control (check box).
bool SetCheck (ASInt32 nID, ASBoolean bCheck=true)
 Set the checked status of a control (check box).
bool SetPicture (ASInt32 nID, ASInt32 nPictureID, const char *pName)
 Sets an image for a control (image controls).
int GetActiveEntry (ASInt32 nID)
 Retrieve the current entry (combo, list and tree controls).
std::string GetActiveEntryText (ASInt32 nID)
 Retrieve the current entry's text (combo, list and tree controls).
int GetEntryCount (ASInt32 nID)
 Get the number of entries (combo, list and tree controls).
void SelectEntry (ASInt32 nID, ASInt32 nEntry, ASBoolean bSelect=true)
 Select/deselect a specific entry by number (combo, list and tree controls).
void SelectEntry (ASInt32 nID, const std::string &sEntryText, ASBoolean bSelect=true)
 Select/deselect a specific entry by text (combo, list and tree controls).
void Invalidate ()
 Invalidates the dialog (redrawing it).
void CreateADMTimer (ASUInt32 uDelay, ADMActionMask maskAbort=0)
 Set a timer for the dialog.
void AbortADMTimer ()
 End the timer for the dialog.
bool EndModal (ASInt32 nID, bool bOK)
 End the dialog.

Protected Member Functions

bool HasControl (ASInt32 id)
 Check if there's a control with the specified ID.
virtual ASErr OnInitDialog ()
 Called when the dialog window is created; usually control object are connected to the controls here.
virtual void OnDestroyDialog ()
 Called when the dialog is destroyed.
virtual void OnDialogNotify (ADMNotifierRef inNotifier)
 Called when a notification message is sent to the dialog (mouse click and such).
virtual ASBoolean OnDialogEvent (ADMTrackerRef inTracker)
 Called when a tracking event is sent to the dialog (mouse move and such).
virtual void OnOK ()
 Called when the OK button is clicked.
virtual ASBoolean OnTimer (ADMTimerRef inTimerID)
 Called when a timer event occurs (set by CreateADMTimer).
virtual void OnTimerAbort (ADMTimerRef inTimerID, ADMAction inAbortAction)
 Called when a timer event is stopped.

Static Protected Member Functions

static ASErr ASAPI DialogInit (ADMDialogRef dialogRef)
 Callback for dialog initialization; calls OnInitDialog().
static void ASAPI DialogDestroy (ADMDialogRef dialogRef)
 Callback for dialog destruction; calls OnDestoryDialog().
static void ASAPI DialogNotify (ADMDialogRef dialogRef, ADMNotifierRef inNotifier)
 Callback for dialog notification (clicks and such); calls OnDialogNotify().
static ASBoolean ASAPI DialogEvent (ADMDialogRef inDialog, ADMTrackerRef inTracker)
 Callback for dialog tracking events (mouse moves and such); calls OnDialogEvent().
static ASBoolean ASAPI TimerProc (ADMDialogRef inDialog, ADMTimerRef inTimerID)
 Callback for dialog timer events; calls OnTimer().
static void ASAPI TimerAbortProc (ADMDialogRef inDialog, ADMTimerRef inTimerID, ADMAction inAbortAction)
 Callback for dialog timer aborting event; calls OnTimerAbort().

Protected Attributes

ASInt32 m_uID
 ID of the dialog resource.
std::string m_sName
 Unique name of the dialog.
ADMDialogRef m_refDialog
 ADM dialog object reference.
AVWindow m_AVWindow
 Acrobat window reference for the dialog window.
ADMBaseControlList m_controls
 List of control objects.
ASInt32 m_nOKBtnID
 ID of dialog's OK button (if any).
ADMTimerRef m_refTimer
 Reference to the dialog's timer object (can be NULL).

Detailed Description

Base class for ADM dialogs.

Definition at line 39 of file ADMBaseDialog.h.


Constructor & Destructor Documentation

ADMBaseDialog::ADMBaseDialog ( const char *  pName,
ASInt32  uID 
) [inline]

Constructs a dialog object (but does not show it - for that call DoModal!).

Parameters:
pName Unique identifier for the dialog
uID Resource ID for the dialog

Definition at line 48 of file ADMBaseDialog.h.


Member Function Documentation

void ADMBaseDialog::AddClosingBtn ( ASInt32  nID,
bool  bSetDefault = false,
bool  bNotify = true 
) [virtual]

Sets a dialog control as a dialog-closing button.

Parameters:
nID ID of control to set as a dialog-closing button
bSetDefault true to set this button as the default button for the dialog, false not to
bNotify true to notify the dialog about the control prior to closing, false not to

Definition at line 466 of file ADMBaseDialog.cpp.

References ADMBaseDialog::ADMBaseControlList::add(), ConnectControl(), m_controls, and m_refDialog.

void ADMBaseDialog::AddNotifyBtn ( ASInt32  nID,
bool  bSetDefault = false 
) [virtual]

Sets a dialog control as a notification button.

Parameters:
nID ID of control to set as a notificaiton
bSetDefault true to set this button as the default button for the dialog, false not to

Definition at line 446 of file ADMBaseDialog.cpp.

References ADMBaseDialog::ADMBaseControlList::add(), ConnectControl(), m_controls, and m_refDialog.

Referenced by AddNotifyRange(), RequestProgressDialog::OnInitDialog(), ADMBaseWizPage::OnInitDialog(), and FullLicenseDialog::OnInitDialog().

virtual void ADMBaseDialog::AddNotifyRange ( ASInt32  nID,
int  nCount 
) [inline, virtual]

Call to set click notification for a range of buttons.

Parameters:
nID ID of first button in the range
nCount Number of buttons in the range

Definition at line 133 of file ADMBaseDialog.h.

References AddNotifyBtn().

Referenced by ADMWizSamplePage::OnInitDialog(), ADMWizJurisdicationPage::OnInitDialog(), ADMWizModificationPage::OnInitDialog(), ADMWizUsagePage::OnInitDialog(), and ADMWizLicenseTypePage::OnInitDialog().

bool ADMBaseDialog::ConnectControl ( ASInt32  nID,
ADMBaseControl control,
unsigned int  uFlags 
) [virtual]

Helper function to connect a control object to an ADM control with flags.

Parameters:
nID ID of control to connect
control Object to connect to the control
uFlags Additional creation controls
Returns:
true if connected, false if failed

Definition at line 59 of file ADMBaseDialog.cpp.

References ADMBaseControl::ConnectToControl(), and m_refDialog.

bool ADMBaseDialog::ConnectControl ( ASInt32  nID,
ADMBaseControl control 
) [virtual]

Helper function to connect a control object to an ADM control.

Parameters:
nID ID of control to connect
control Object to connect to the control
Returns:
true if connected, false if failed

Definition at line 35 of file ADMBaseDialog.cpp.

References ADMBaseControl::ConnectToControl(), and m_refDialog.

Referenced by AddClosingBtn(), AddNotifyBtn(), RequestProgressDialog::OnInitDialog(), and LicenseDialog::OnInitDialog().

void ADMBaseDialog::CreateADMTimer ( ASUInt32  uDelay,
ADMActionMask  maskAbort = 0 
)

Set a timer for the dialog.

Parameters:
uDelay Delay between timer calls, in Milliseconds
maskAbort Actions that will stop the timer

Note that there can be only one timer per dialog for now!

Definition at line 191 of file ADMBaseDialog.cpp.

References m_refDialog, m_refTimer, TimerAbortProc(), and TimerProc().

Referenced by RequestProgressDialog::OnInitDialog().

void ADMBaseDialog::DialogDestroy ( ADMDialogRef  dialogRef  )  [static, protected]

Callback for dialog destruction; calls OnDestoryDialog().

Parameters:
dialogRef Reference to the destroyed ADM dialog object

Definition at line 151 of file ADMBaseDialog.cpp.

References OnDestroyDialog().

Referenced by DialogInit().

ASBoolean ASAPI ADMBaseDialog::DialogEvent ( ADMDialogRef  dialogRef,
ADMTrackerRef  inTracker 
) [static, protected]

Callback for dialog tracking events (mouse moves and such); calls OnDialogEvent().

Parameters:
dialogRef ADM dialog reference
inTracker ADM Tracker object
Returns:
true to continue tracking, false to stop

Definition at line 275 of file ADMBaseDialog.cpp.

References m_refDialog, and OnDialogEvent().

Referenced by OnInitDialog().

ASErr ASAPI ADMBaseDialog::DialogInit ( ADMDialogRef  dialogRef  )  [static, protected]

Callback for dialog initialization; calls OnInitDialog().

Parameters:
dialogRef Reference to the initialized ADM dialog object (called by Modal)
Returns:
kNoErr if initialized successfully, any other error code to fail

Definition at line 137 of file ADMBaseDialog.cpp.

References DialogDestroy(), m_refDialog, and OnInitDialog().

Referenced by DoModal().

void ASAPI ADMBaseDialog::DialogNotify ( ADMDialogRef  dialogRef,
ADMNotifierRef  inNotifier 
) [static, protected]

Callback for dialog notification (clicks and such); calls OnDialogNotify().

Parameters:
dialogRef ADM dialog reference
inNotifier ADM Notification object

Definition at line 244 of file ADMBaseDialog.cpp.

References m_refDialog, and OnDialogNotify().

Referenced by OnInitDialog().

ASInt32 ADMBaseDialog::DoModal (  ) 

Displays the dialog and returns the dialog return value (usually, the button used to close it).

Returns:
The dialog ending value; usually the ID of the closing control

Definition at line 80 of file ADMBaseDialog.cpp.

References DialogInit(), ADMWrapper::InitADM(), m_sName, m_uID, and ADMWrapper::ReleaseADM().

Referenced by RequestProgressDialog::DoRequest(), CCInfoFullPlugin::ShowAbout(), and CCInfoFullPlugin::ShowLicense().

bool ADMBaseDialog::EnableControl ( ASInt32  nID,
ASBoolean  bEnable 
)

Enable or disable a control.

Parameters:
nID ID of control to enable or disable
bEnable true to enable the control, false to disable it
Returns:
true if set status successfully, false if failed

Definition at line 349 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by RequestProgressDialog::OnBtnClicked(), FullLicenseDialog::OnInitDialog(), ADMBaseWizDialog::SetEnabledButtons(), and ADMWizJurisdicationPage::UpdateControls().

bool ADMBaseDialog::EndModal ( ASInt32  nID,
bool  bOK 
)

End the dialog.

Parameters:
nID ID to return from the modal function
bOK true to call OnOK(), false not to
Returns:
true if modal ended, false if something failed

Definition at line 109 of file ADMBaseDialog.cpp.

References GetAVWindow(), m_refDialog, and OnOK().

Referenced by RequestProgressDialog::OnFinished().

int ADMBaseDialog::GetActiveEntry ( ASInt32  nID  ) 

Retrieve the current entry (combo, list and tree controls).

Parameters:
nID ID of list, combo or tree control to retrieve the selected entry number from
Returns:
Index of selected entry, or -1 if none are selected or an error occured

Definition at line 613 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizJurisdicationPage::UpdateControls().

std::string ADMBaseDialog::GetActiveEntryText ( ASInt32  nID  ) 

Retrieve the current entry's text (combo, list and tree controls).

Parameters:
nID ID of list, combo or tree control to retrieve entry text from
Returns:
Text of the selected entry, empty string if an error occured or none is selected

Definition at line 575 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizJurisdicationPage::OnKillActive().

AVWindow ADMBaseDialog::GetAVWindow (  )  [inline]

Retrieve the Acrobat window reference for the dialog.

Returns:
The Acrobat window reference for the dialog

Definition at line 104 of file ADMBaseDialog.h.

References m_AVWindow.

Referenced by EndModal(), and ADMCloseDialogButton::OnNotify().

int ADMBaseDialog::GetEntryCount ( ASInt32  nID  ) 

Get the number of entries (combo, list and tree controls).

Parameters:
nID ID of list, combo or tree control to retrieve the number of entries of
Returns:
Number of entries in the control, or -1 if an error occured

Definition at line 641 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizJurisdicationPage::UpdateControls().

int ADMBaseDialog::GetSelectedRadio ( ASInt32  nIDFirst,
int  nCount 
)

Set a selected radio in a group.

Parameters:
nIDFirst ID of first radio control in the group
nCount Number of radio controls in the group
Returns:
The number of the radio button in the group that is selected, or -1 if none are (or if an error occured)

Definition at line 541 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizSamplePage::OnKillActive(), ADMWizJurisdicationPage::OnKillActive(), ADMWizModificationPage::OnKillActive(), ADMWizUsagePage::OnKillActive(), ADMWizLicenseTypePage::OnKillActive(), ADMWizSamplePage::UpdateControls(), ADMWizJurisdicationPage::UpdateControls(), ADMWizModificationPage::UpdateControls(), ADMWizUsagePage::UpdateControls(), and ADMWizLicenseTypePage::UpdateControls().

bool ADMBaseDialog::HasControl ( ASInt32  id  )  [protected]

Check if there's a control with the specified ID.

Parameters:
id ID of control to check
Returns:
true if there's a control with this ID on the dialog, false if not

Definition at line 235 of file ADMBaseDialog.cpp.

References m_refDialog.

bool ADMBaseDialog::IsChecked ( ASInt32  nID  ) 

Get checked status for a control (check box).

Parameters:
nID ID to test
Returns:
true if the control is checked, false otherwise

Definition at line 496 of file ADMBaseDialog.cpp.

References m_refDialog.

void ADMBaseDialog::OnBtnClicked ( ASInt32  nID  )  [virtual]

Called by notification buttons.

Parameters:
nID ID of button clicked

Reimplemented in FullLicenseDialog, ADMWizLicenseTypePage, ADMWizUsagePage, ADMWizModificationPage, ADMWizJurisdicationPage, ADMWizSamplePage, ADMBaseWizPage, and RequestProgressDialog.

Definition at line 484 of file ADMBaseDialog.cpp.

References m_nOKBtnID, and OnOK().

Referenced by ADMCloseDialogButton::OnClick(), and ADMNotifyButton::OnClick().

virtual ASBoolean ADMBaseDialog::OnDialogEvent ( ADMTrackerRef  inTracker  )  [inline, protected, virtual]

Called when a tracking event is sent to the dialog (mouse move and such).

Parameters:
inTracker Reference to the ADM tracking object
Returns:
true to perform the default tracking handling

Definition at line 193 of file ADMBaseDialog.h.

Referenced by DialogEvent().

void ADMBaseDialog::OnDialogNotify ( ADMNotifierRef  inNotifier  )  [protected, virtual]

Called when a notification message is sent to the dialog (mouse click and such).

Parameters:
inNotifier ADM Notification object

Reimplemented in ADMBaseWizPage.

Definition at line 264 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by DialogNotify().

ASErr ADMBaseDialog::OnInitDialog (  )  [protected, virtual]

Called when the dialog window is created; usually control object are connected to the controls here.

Returns:
kNoErr if all went well, an error code otherwise

Reimplemented in AboutDialog, FullLicenseDialog, ADMWizLicenseTypePage, ADMWizUsagePage, ADMWizModificationPage, ADMWizJurisdicationPage, ADMWizSummeryPage, ADMWizSamplePage, LicenseDialog, ADMBaseWizPage, and RequestProgressDialog.

Definition at line 209 of file ADMBaseDialog.cpp.

References DialogEvent(), DialogNotify(), AcrobatPluginInfo::GetPluginInfo(), m_AVWindow, m_refDialog, AcrobatPluginInfo::RegisterModalDialog(), and ADMModalWrapper::StartModal().

Referenced by DialogInit().

virtual ASBoolean ADMBaseDialog::OnTimer ( ADMTimerRef  inTimerID  )  [inline, protected, virtual]

Called when a timer event occurs (set by CreateADMTimer).

Parameters:
inTimerID Reference to the ADM timer
Returns:
true to continue sending timer events, false to stop

Reimplemented in RequestProgressDialog.

Definition at line 203 of file ADMBaseDialog.h.

References m_refTimer.

Referenced by TimerProc().

virtual void ADMBaseDialog::OnTimerAbort ( ADMTimerRef  inTimerID,
ADMAction  inAbortAction 
) [inline, protected, virtual]

Called when a timer event is stopped.

Parameters:
inTimerID Reference to the ADM timer
inAbortAction The action that caused the abort

Definition at line 209 of file ADMBaseDialog.h.

References m_refTimer.

Referenced by TimerAbortProc().

void ADMBaseDialog::SelectEntry ( ASInt32  nID,
const std::string &  sEntryText,
ASBoolean  bSelect = true 
)

Select/deselect a specific entry by text (combo, list and tree controls).

Parameters:
nID ID of list, combo or tree control to selected/deselect an entry for
sEntryText Text of the entry to select or deselect
bSelect true to select the entry, false to deselect it

Definition at line 696 of file ADMBaseDialog.cpp.

References m_refDialog.

void ADMBaseDialog::SelectEntry ( ASInt32  nID,
ASInt32  nEntry,
ASBoolean  bSelect = true 
)

Select/deselect a specific entry by number (combo, list and tree controls).

Parameters:
nID ID of list, combo or tree control to selected/deselect an entry for
nEntry Index of entry to selected or deselect
bSelect true to select the entry, false to deselect it

Definition at line 665 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizJurisdicationPage::OnInitDialog(), and ADMWizJurisdicationPage::UpdateControls().

void ADMBaseDialog::SetCancelBtn ( ASInt32  nID = IDCANCEL,
bool  bSetDefault = false 
) [virtual]

Sets the cancel button.

Parameters:
nID ID of control to set as the dialog's Cancel button
bSetDefault true to set this button as the default button for the dialog, false not to

Definition at line 418 of file ADMBaseDialog.cpp.

References ADMBaseDialog::ADMBaseControlList::add(), ADMBaseControl::ConnectToControl(), m_controls, and m_refDialog.

Referenced by ADMBaseWizPage::OnInitDialog().

bool ADMBaseDialog::SetCheck ( ASInt32  nID,
ASBoolean  bCheck = true 
)

Set the checked status of a control (check box).

Parameters:
nID ID of control to set the check status of
bCheck true to set, false to clear
Returns:
true if check set successfully, false if failed

Definition at line 518 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizSamplePage::OnInitDialog(), ADMWizJurisdicationPage::OnInitDialog(), ADMWizModificationPage::OnInitDialog(), ADMWizUsagePage::OnInitDialog(), and ADMWizLicenseTypePage::OnInitDialog().

bool ADMBaseDialog::SetControlText ( ASInt32  nID,
const char *  pText 
)

Set control text.

Parameters:
nID ID of control to set the text of
pText String to set to the control
Returns:
true if successfully set, false if failed

Definition at line 326 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by RequestProgressDialog::OnBtnClicked(), ADMWizSamplePage::OnInitDialog(), ADMWizSummeryPage::OnInitDialog(), ADMWizJurisdicationPage::OnInitDialog(), ADMWizModificationPage::OnInitDialog(), ADMWizUsagePage::OnInitDialog(), ADMBaseWizDialog::SetEnabledButtons(), ADMWizLicenseTypePage::UpdateControls(), and LicenseDialog::UpdateLicenseInfo().

void ADMBaseDialog::SetOKBtn ( ASInt32  nID = IDOK,
bool  bSetDefault = true 
) [virtual]

Sets the OK button.

Parameters:
nID ID of control to set as an OK button
bSetDefault true to set this button as the default button for the dialog, false not to

Definition at line 296 of file ADMBaseDialog.cpp.

References ADMBaseDialog::ADMBaseControlList::add(), ADMBaseControl::ConnectToControl(), m_controls, m_nOKBtnID, and m_refDialog.

Referenced by AboutDialog::OnInitDialog(), and LicenseDialog::OnInitDialog().

bool ADMBaseDialog::SetPicture ( ASInt32  nID,
ASInt32  nPictureID,
const char *  pName 
)

Sets an image for a control (image controls).

Parameters:
nID ID of control to set the image to
nPictureID ID of image
pName Unique name of image
Returns:
true if image set successfully, false if failed

Definition at line 396 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizSummeryPage::SetIconImage().

bool ADMBaseDialog::ShowControl ( ASInt32  nID,
ASBoolean  bShow = true 
)

Show or hide a control.

Parameters:
nID ID of control to show or hide
bShow true to show the control, false to hide it
Returns:
true if shown/hidden successfully, false if failed

Definition at line 372 of file ADMBaseDialog.cpp.

References m_refDialog.

Referenced by ADMWizSummeryPage::SetIconImage().

void ASAPI ADMBaseDialog::TimerAbortProc ( ADMDialogRef  dialogRef,
ADMTimerRef  inTimerID,
ADMAction  inAbortAction 
) [static, protected]

Callback for dialog timer aborting event; calls OnTimerAbort().

Parameters:
dialogRef ADM dialog reference
inTimerID ADM timer reference
inAbortAction Action that caused the timer to abort

Definition at line 749 of file ADMBaseDialog.cpp.

References m_refDialog, and OnTimerAbort().

Referenced by CreateADMTimer().

ASBoolean ASAPI ADMBaseDialog::TimerProc ( ADMDialogRef  dialogRef,
ADMTimerRef  inTimerID 
) [static, protected]

Callback for dialog timer events; calls OnTimer().

Parameters:
dialogRef ADM dialog reference
inTimerID ADM timer reference
Returns:
true to continue receiving timer events, false to stop

Definition at line 727 of file ADMBaseDialog.cpp.

References m_refDialog, and OnTimer().

Referenced by CreateADMTimer().


The documentation for this class was generated from the following files:

Generated on Thu Dec 17 17:37:08 2009 for CCInfo PDF Plugin by doxygen 1.6.1