Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
Enumerations | Functions
hdicoreAlerts.h File Reference

Header file for Illustrator alerts, confirmation dialogs, etc. More...

Enumerations

enum  hdi::core::alerts::Response { CancelButtonChosen = 1, NoButtonChosen = 2, YesButtonChosen = 3 }
 Describes the choice the user made when dismissing an alert. More...
 

Functions

bool hdi::core::alerts::setState (const bool enabled_)
 Allows alerts to be (temporarily) disabled. More...
 
void hdi::core::alerts::message (const std::string &message_)
 Shows a simple platform message dialog, with just an "OK" button and a message/warning icon. More...
 
void hdi::core::alerts::error (const std::string &error_)
 Shows a simple platform error dialog, with just an "OK" button and an error icon. More...
 
Response hdi::core::alerts::confirm (const std::string &question_)
 Shows a confirmation dialog with default affirmative and negative buttons ("Yes" and "No") More...
 
Response hdi::core::alerts::confirm (const std::string &question_, const std::string &yesBtnStr_, const std::string &noBtnStr_)
 Shows a confirmation dialog with affirmative and negative buttons with custom titles. More...
 
Response hdi::core::alerts::confirm (const std::string &question_, const Callback &yesCb_, const Callback &noCb_)
 Shows a confirmation dialog with default affirmative and negative buttons ("Yes" and "No") More...
 
Response hdi::core::alerts::confirm (const std::string &question_, const std::string &yesBtnStr_, const Callback &yesCb_, const std::string &noBtnStr_, const Callback &noCb_)
 Shows a confirmation dialog with affirmative and negative buttons with custom titles. More...
 
Response hdi::core::alerts::question (const std::string &question_)
 Shows a question dialog with default affirmative, negative, and dismissal buttons ("Yes", "No", and "Cancel") More...
 
Response hdi::core::alerts::question (const std::string &question_, const std::string &yesBtnStr_, const std::string &noBtnStr_, const std::string &cancelBtnStr_)
 Shows a question dialog with affirmative, negative, and dismissal buttons with custom titles. More...
 
Response hdi::core::alerts::question (const std::string &question_, const Callback &yesCb_, const Callback &noCb_, const Callback &cancelCb_)
 Shows a question dialog with default affirmative, negative, and dismissal buttons ("Yes", "No", and "Cancel") More...
 
Response hdi::core::alerts::question (const std::string &question_, const std::string &yesBtnStr_, const Callback &yesCb_, const std::string &noBtnStr_, const Callback &noCb_, const std::string &cancelBtnStr_, const Callback &cancelCb_)
 Shows a question dialog with affirmative, negative, and dismissal buttons with custom titles. More...
 
void hdi::core::alerts::beep ()
 Causes a platform beep to occur. More...
 

Detailed Description

Header file for Illustrator alerts, confirmation dialogs, etc.

Enumeration Type Documentation

◆ Response

Describes the choice the user made when dismissing an alert.

Note
message() and error() do not return an AlertResponse, because they both only have one button.
confirm() will only return either NoButtonChosen or YesButtonChosen; however, if alerts have been disabled with setState(), it will always return CancelButtonChosen.

Function Documentation

◆ beep()

void hdi::core::alerts::beep ( )

Causes a platform beep to occur.

Author
GW
Date
08/2013

◆ confirm() [1/4]

Response hdi::core::alerts::confirm ( const std::string &  question_)

Shows a confirmation dialog with default affirmative and negative buttons ("Yes" and "No")

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
Returns
The choice the user made within the dialog (either YesButtonChosen or NoButtonChosen)
Note
The dialog is "blocking" and execution will continue immediately after the call to this function.

◆ confirm() [2/4]

Response hdi::core::alerts::confirm ( const std::string &  question_,
const std::string &  yesBtnStr_,
const std::string &  noBtnStr_ 
)

Shows a confirmation dialog with affirmative and negative buttons with custom titles.

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesBtnStr_Title for the affirmative button, as UTF-8
noBtnStr_Title for the negative button, as UTF-8
Returns
The choice the user made within the dialog (either YesButtonChosen or NoButtonChosen)
Note
The dialog is "blocking" and execution will continue immediately after the call to this function.

◆ confirm() [3/4]

Response hdi::core::alerts::confirm ( const std::string &  question_,
const Callback yesCb_,
const Callback noCb_ 
)

Shows a confirmation dialog with default affirmative and negative buttons ("Yes" and "No")

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesCb_Action to perform on the user having chosen "Yes"
noCb_Action to perform on the user having chosen "No"
Returns
The choice the user made within the dialog (either YesButtonChosen or NoButtonChosen)
Note
The dialog is "blocking" and, immediately after the call to this function and to any passed callbacks, execution will continue

◆ confirm() [4/4]

Response hdi::core::alerts::confirm ( const std::string &  question_,
const std::string &  yesBtnStr_,
const Callback yesCb_,
const std::string &  noBtnStr_,
const Callback noCb_ 
)

Shows a confirmation dialog with affirmative and negative buttons with custom titles.

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesBtnStr_Title for the affirmative button, as UTF-8
yesCb_Action to perform on the user having chosen "Yes"
noBtnStr_Title for the negative button, as UTF-8
noCb_Action to perform on the user having chosen "No"
Returns
The choice the user made within the dialog (either YesButtonChosen or NoButtonChosen)
Note
The dialog is "blocking" and, immediately after the call to this function and to any passed callbacks, execution will continue

◆ error()

void hdi::core::alerts::error ( const std::string &  error_)

Shows a simple platform error dialog, with just an "OK" button and an error icon.

Author
GW
Date
08/2013
Parameters
error_Error string to show to the user in the dialog, as UTF-8
Note
The dialog is "blocking" and execution will continue immediately after the call to this function

◆ message()

void hdi::core::alerts::message ( const std::string &  message_)

Shows a simple platform message dialog, with just an "OK" button and a message/warning icon.

Author
GW
Date
08/2013
Parameters
message_Message string to show to the user in the dialog, as UTF-8
Note
The dialog is "blocking" and execution will continue immediately after the call to this function

◆ question() [1/4]

Response hdi::core::alerts::question ( const std::string &  question_)

Shows a question dialog with default affirmative, negative, and dismissal buttons ("Yes", "No", and "Cancel")

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
Returns
The choice the user made within the dialog
Note
The dialog is "blocking" and execution will continue immediately after the call to this function.

◆ question() [2/4]

Response hdi::core::alerts::question ( const std::string &  question_,
const std::string &  yesBtnStr_,
const std::string &  noBtnStr_,
const std::string &  cancelBtnStr_ 
)

Shows a question dialog with affirmative, negative, and dismissal buttons with custom titles.

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesBtnStr_Title for the affirmative button, as UTF-8
noBtnStr_Title for the negative button, as UTF-8
cancelBtnStr_Title for the dismissal button, as UTF-8
Returns
The choice the user made within the dialog
Note
The dialog is "blocking" and execution will continue immediately after the call to this function.

◆ question() [3/4]

Response hdi::core::alerts::question ( const std::string &  question_,
const Callback yesCb_,
const Callback noCb_,
const Callback cancelCb_ 
)

Shows a question dialog with default affirmative, negative, and dismissal buttons ("Yes", "No", and "Cancel")

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesCb_Action to perform on the user having chosen "Yes"
noCb_Action to perform on the user having chosen "No"
cancelCb_Action to perform on the user having chosen "Cancel"
Returns
The choice the user made within the dialog
Note
The dialog is "blocking" and, immediately after the call to this function and to any passed callbacks, execution will continue

◆ question() [4/4]

Response hdi::core::alerts::question ( const std::string &  question_,
const std::string &  yesBtnStr_,
const Callback yesCb_,
const std::string &  noBtnStr_,
const Callback noCb_,
const std::string &  cancelBtnStr_,
const Callback cancelCb_ 
)

Shows a question dialog with affirmative, negative, and dismissal buttons with custom titles.

Author
GW
Date
08/2013
Parameters
question_Question to pose to the user, as UTF-8
yesBtnStr_Title for the affirmative button, as UTF-8
yesCb_Action to perform on the user having chosen "Yes"
noBtnStr_Title for the negative button, as UTF-8
noCb_Action to perform on the user having chosen "No"
cancelBtnStr_Title for the dismissal button, as UTF-8
cancelCb_Action to perform on the user having chosen "Cancel"
Returns
The choice the user made within the dialog
Note
The dialog is "blocking" and, immediately after the call to this function and to any passed callbacks, execution will continue

◆ setState()

bool hdi::core::alerts::setState ( const bool  enabled_)

Allows alerts to be (temporarily) disabled.

Author
GW
Date
08/2013
Parameters
enabled_true to enable alerts, false to disable
Returns
The previous enable/disable setting
Note
When alerts are disabled, the message(), error(), confirm(), and question() functions will return early, thereby preventing the alert UI from ever being presented to the user. The beep() function will return early, preventing a beep sound from being made.