23 |
23 |
24 #include <QString> |
24 #include <QString> |
25 #include <QStringList> |
25 #include <QStringList> |
26 #include <QTime> |
26 #include <QTime> |
27 |
27 |
28 class HbDialog; |
28 #include <hbglobal.h> |
|
29 #include <hbmessagebox.h> |
|
30 |
|
31 class FmDialog; |
29 class HbAction; |
32 class HbAction; |
30 |
33 |
|
34 /*! |
|
35 \class FmDlgUtils |
|
36 \brief The class FmDlgUtils is static utility class. Used to popup dialogs |
|
37 */ |
31 class FmDlgUtils : public QObject |
38 class FmDlgUtils : public QObject |
32 { |
39 { |
33 Q_OBJECT |
40 Q_OBJECT |
34 public: |
41 public: |
35 |
|
36 /** |
|
37 * Shows single select setting page |
|
38 * |
|
39 * @param title Title text |
|
40 * @param textList Text list for available settings |
|
41 * @param selectedIndex For storing selected index |
|
42 * @return true if selection made, otherwise false |
|
43 */ |
|
44 static bool showSingleSettingQuery( |
42 static bool showSingleSettingQuery( |
45 const QString &title, |
43 const QString &title, |
46 const QStringList &textList, |
44 const QStringList &textList, |
47 int &selectedIndex, |
45 int &selectedIndex, |
48 const QString &associatedDrives = QString() ); |
46 const QString &associatedDrives = QString() ); |
49 |
47 |
50 /** |
|
51 * Shows multi select setting page |
|
52 * |
|
53 * @param title Title text |
|
54 * @param textList Text list for available settings |
|
55 * @param selection For storing selected indexes as bitmask |
|
56 * @param dominantIndex Dominant index for select all behaviour |
|
57 * @return true if selection made, otherwise false |
|
58 */ |
|
59 static bool showMultiSettingQuery( |
48 static bool showMultiSettingQuery( |
60 const QString &title, |
49 const QString &title, |
61 const QStringList &textList, |
50 const QStringList &textList, |
62 quint32 &selection, |
51 quint32 &selection, |
63 int dominantIndex, |
52 int dominantIndex, |
64 const QString &associatedDrives = QString() ); |
53 const QString &associatedDrives = QString() ); |
65 |
54 |
66 /** |
|
67 * Shows time setting page |
|
68 * |
|
69 * @param title Title text id |
|
70 * @param time Selected time |
|
71 * @return true if selection made, otherwise false |
|
72 */ |
|
73 static bool showTimeSettingQuery( |
55 static bool showTimeSettingQuery( |
74 const QString &title, QTime &time, |
56 const QString &title, QTime &time, |
75 const QString &associatedDrives = QString() ); |
57 const QString &associatedDrives = QString() ); |
76 |
58 |
77 static bool showTextQuery( |
59 static bool showTextQuery( |
78 const QString &title, QString &driveName, bool isDimPrimaryActionWhenEmpty, int maxLength = -1, |
60 const QString &title, QString &text, QStringList validRegExpStringList = QStringList( Regex_ValidUnEmpty ), |
79 const QString &associatedDrives = QString() ); |
61 int maxLength = -1, const QString &associatedDrives = QString(), bool isReturnFalseWhenNoTextChanged = true ); |
80 |
62 |
81 static bool showSinglePasswordQuery( |
63 static bool showSinglePasswordQuery( |
82 const QString &title, QString &pwd, |
64 const QString &title, QString &pwd, int maxLength = -1, |
83 const QString &associatedDrives = QString() ); |
65 const QString &associatedDrives = QString() ); |
84 |
66 |
85 static bool showMultiPasswordQuery( |
67 static bool showMultiPasswordQuery( |
86 const QString &firstLabel, const QString &secondLabel, QString &pwd, |
68 const QString &firstLabel, const QString &secondLabel, QString &pwd, int maxLength = -1, |
87 const QString &associatedDrives = QString() ); |
69 const QString &associatedDrives = QString() ); |
|
70 |
|
71 static bool question( const QString &questionText, |
|
72 HbMessageBox::StandardButtons buttons = HbMessageBox::Yes | HbMessageBox::No ); |
88 |
73 |
89 ~FmDlgUtils(void); |
74 static void information( const QString &informationText, |
|
75 HbMessageBox::StandardButtons buttons = HbMessageBox::Ok ); |
|
76 |
|
77 static QString showBackupDriveQuery( const QString& title ); |
|
78 |
|
79 ~FmDlgUtils(); |
90 private: |
80 private: |
91 FmDlgUtils(void); |
81 FmDlgUtils(); |
92 static HbAction *executeDialog( HbDialog *dialog, const QString &associatedDrives ); |
82 static HbAction *executeDialog( FmDialog *dialog, const QString &associatedDrives ); |
93 }; |
83 }; |
94 |
84 |
95 |
85 |
96 #endif |
86 #endif |