Re-factored the basic idea of the application: Engine is the main class that ownsWind...
[qtmeetings] / src / UserInterface / Utils / PasswordDialog.h
1 #ifndef PASSWORDDIALOG_H_
2 #define PASSWORDDIALOG_H_
3
4 #include <QDialog>
5
6 class QLineEdit;
7 class QByteArray;
8
9 //! UserInterface class. Responsible for poping-up password query on the screen.
10 /*!
11  * UserInterface class. Responsible for poping-up password query on the screen. The class is used
12  * through static method, just like the QMessageBox in the standard Qt library.
13  */
14 class PasswordDialog : public QDialog
15 {
16         Q_OBJECT
17
18 public:
19         //! Enumeration of password authenticity.
20         /*!
21          * Password authenticity.
22          */
23         enum PasswordStatus
24         {
25                 Correct, /*!< Correct password. */
26                 Incorrect, /*!< Incorrect password. */
27                 Canceled
28         };
29
30         //! Creates a new PasswordDialog instance and shows the dialog on the screen.
31         /*!
32          * Creates a new Password query dialog.
33          * \param aParent The parent object.
34          * \param aPassword The password.
35          * \param aText Optional. Text displayed in the dialog.
36          * \param aTitle Optional. Dialog title, defaults to "Enter password".
37          * \return The instance which was created.
38         static PasswordDialog * query( QWidget *aParent, const QString &aPassword,
39                                                  const QString &aText = 0, const QString &aTitle = 0 );
40                                                  */
41
42 signals:
43         //! Signals the authenticity of the password when the uuser dismisses the dialog.
44         /*!
45          * The signal is emitted if user presses a key available for the dialog.
46          * \param aStatus Password authenticity.
47          */
48         void passwordEntered( PasswordDialog::PasswordStatus aStatus );
49
50 private slots:
51         void okButtonPressed();
52         void cancelButtonPressed();
53
54 public:
55         //! Constructor.
56         /*!
57          * Constructor to initialize a PasswordDialog instance.
58          * \param aParent The parent object.
59          * \param aPassword The password.
60          */
61         PasswordDialog( const QString &aPassword, const QString &aText, const QString &aTitle = "", QWidget *aParent = 0 );
62         //! Destructor.
63         virtual ~PasswordDialog();
64
65         QLineEdit *iPasswordEdit;
66         QByteArray iPasswordHash;
67 };
68
69 #endif /*PASSWORDDIALOG_H_*/