src/hbwidgets/popups/hbmessagebox.cpp
changeset 3 11d3954df52a
parent 2 06ff229162e9
child 5 627c4a0fd0e7
equal deleted inserted replaced
2:06ff229162e9 3:11d3954df52a
   163 
   163 
   164 /*!
   164 /*!
   165     @beta
   165     @beta
   166     
   166     
   167     \class HbMessageBox
   167     \class HbMessageBox
   168     \brief HbMessageBox is a convenience modal dialog class, using which a simple information, a question, or a simple warning can be shown to the user.
   168     \brief The HbMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer.
       
   169 
       
   170     \image html information.PNG  "An information MessageBox"
       
   171     \image html question.PNG  "A question MessageBox"
       
   172     \image html warning.PNG  "A warning MessageBox"
   169 
   173 
   170     Using HbMessageBox, the following dialogs can be created:
   174     Using HbMessageBox, the following dialogs can be created:
   171 
   175 
   172     <b>Information:</b> a statement to the user to which they may respond by acknowledging the information ('OK').<br>
   176     <b>Information:</b> a statement to the user to which they may respond by acknowledging the information ('OK').<br>
   173     <b>Question:</b> a query to the user requiring a response. User needs to select between two alternatives, the positive or negative (For example: 'Delete Mailbox?' 'Yes'/'No').<br>
   177     <b>Question:</b> a query to the user requiring a response. User needs to select between two alternatives, the positive or negative (For example: 'Delete Mailbox?' 'Yes'/'No').<br>
   181     Icon: Default icons are available for each dialog type using the MessageBox template. Changing the default icons is not recommended.
   185     Icon: Default icons are available for each dialog type using the MessageBox template. Changing the default icons is not recommended.
   182     Action buttons (one or two): one button for information and warning MessageBox, two buttons for question MessageBox.
   186     Action buttons (one or two): one button for information and warning MessageBox, two buttons for question MessageBox.
   183     
   187     
   184     All the three dialogs(information, warning, question) supported by MessageBox are by default modal in nature, with
   188     All the three dialogs(information, warning, question) supported by MessageBox are by default modal in nature, with
   185     a dismiss policy of NoDismiss, timeout policy of NoTimeout, and with a BackgroundFade property on.
   189     a dismiss policy of NoDismiss, timeout policy of NoTimeout, and with a BackgroundFade property on.
       
   190     The user must click the OK/Yes/No buttons to dismiss the Message Box.
   186 
   191 
   187     Example code for launching MessageBox using static convenience functions:
   192     Example code for launching MessageBox using static convenience functions:
   188 
   193 
   189     \code
   194     \code
   190     //Information MessageBox
   195     //Information MessageBox
   193     //Warning MessageBox
   198     //Warning MessageBox
   194     HbMessageBox::warning(warningText, this, SLOT(onDialogClose(HbAction*)), headWidget, scene, parent);
   199     HbMessageBox::warning(warningText, this, SLOT(onDialogClose(HbAction*)), headWidget, scene, parent);
   195 
   200 
   196     //Question MessageBox
   201     //Question MessageBox
   197     HbMessageBox::question(questionText, this, SLOT(onDialogClose(HbAction*)), primaryButtonText, secondaryButtonText, headWidget, scene, parent);
   202     HbMessageBox::question(questionText, this, SLOT(onDialogClose(HbAction*)), primaryButtonText, secondaryButtonText, headWidget, scene, parent);
   198     \endcode
       
   199 
       
   200     Example code to show an information messagebox:
       
   201 
       
   202     \code
       
   203     HbMessageBox *box = new HbMessageBox("This is an information dialog.");
       
   204     box->setAttribute(Qt::WA_DeleteOnClose);
       
   205     box->open();
       
   206     \endcode
       
   207 
       
   208     Example code to show an information messagebox with two action buttons:
       
   209     \code
       
   210     HbMessageBox *box = new HbMessageBox("XX will be deleted. Do you want to Continue ? ");
       
   211 
       
   212     //Add new action.
       
   213     box->addAction(new HbAction(HbWidget::tr("Cancel"), q));
       
   214 
       
   215     box->setAttribute(Qt::WA_DeleteOnClose);
       
   216 
       
   217     box->open();
       
   218     \endcode
   203     \endcode
   219 
   204 
   220     Example code to show a question messagebox with a return value based action
   205     Example code to show a question messagebox with a return value based action
   221     \code
   206     \code
   222     HbMessageBox *box = new HbMessageBox(" Delete file IC0002 ? ",HbMessageBox::MessageTypeQuestion);
   207     HbMessageBox *box = new HbMessageBox(" Delete file IC0002 ? ",HbMessageBox::MessageTypeQuestion);