17 */ |
17 */ |
18 |
18 |
19 #ifndef FMSINGLETEXTQUERY_H |
19 #ifndef FMSINGLETEXTQUERY_H |
20 #define FMSINGLETEXTQUERY_H |
20 #define FMSINGLETEXTQUERY_H |
21 |
21 |
22 #include <hbdialog.h> |
22 #include "fmdialog.h" |
23 #include <hblineedit.h> |
23 #include <hblineedit.h> |
24 |
24 |
25 class HbWidget; |
25 class HbWidget; |
26 |
26 |
27 class FmSingleTextQuery : public HbDialog |
27 class FmSingleTextQuery : public FmDialog |
28 { |
28 { |
29 Q_OBJECT |
29 Q_OBJECT |
30 public: |
30 public: |
31 enum Option |
|
32 { |
|
33 DimPrimereActionWhenEmpty = 0x00000001 |
|
34 }; |
|
35 Q_DECLARE_FLAGS(Options, Option) |
|
36 |
31 |
37 FmSingleTextQuery( Options options = 0, |
32 explicit FmSingleTextQuery( HbLineEdit::EchoMode echoMode = HbLineEdit::Normal, QGraphicsItem *parent = 0 ); |
38 HbLineEdit::EchoMode echoMode = HbLineEdit::Normal, QGraphicsItem *parent = 0 ); |
|
39 ~FmSingleTextQuery(); |
33 ~FmSingleTextQuery(); |
40 |
34 |
41 public: |
35 public: |
42 void setLineEditText( const QString &text ); |
36 void setLineEditText( const QString &text ); |
43 QString getLineEditText(); |
37 QString getLineEditText(); |
44 void setLineEditMaxLength( int length ); |
38 void setLineEditMaxLength( int length ); |
|
39 void setRegExpStringList( QStringList regExpStringList ); |
45 |
40 |
46 public slots: |
41 public slots: |
47 void checkActions(); |
42 void checkActions(); |
48 |
43 |
49 private: |
44 private: |
50 void init(); |
45 void init(); |
51 |
46 |
52 private: |
47 private: |
53 HbWidget *mContentWidget; |
48 HbWidget *mContentWidget; |
54 HbLineEdit *mTextEdit; |
49 HbLineEdit *mTextEdit; |
55 Options mOptions; |
|
56 HbLineEdit::EchoMode mEchoMode; |
50 HbLineEdit::EchoMode mEchoMode; |
|
51 |
|
52 // used to check if input text is valid. Disable primary action when text is not valid |
|
53 QStringList mRegExpStringList; |
57 }; |
54 }; |
58 Q_DECLARE_OPERATORS_FOR_FLAGS(FmSingleTextQuery::Options) |
55 |
59 #endif |
56 #endif |