equal
deleted
inserted
replaced
17 |
17 |
18 #ifndef NMHSWIDGET_H |
18 #ifndef NMHSWIDGET_H |
19 #define NMHSWIDGET_H |
19 #define NMHSWIDGET_H |
20 |
20 |
21 #include <hbwidget.h> |
21 #include <hbwidget.h> |
|
22 #include <hbeffect.h> |
22 #include "nmcommon.h" |
23 #include "nmcommon.h" |
23 |
24 |
24 class NmHsWidgetEmailEngine; |
25 class NmHsWidgetEmailEngine; |
25 class NmHsWidgetTitleRow; |
26 class NmHsWidgetTitleRow; |
26 class QGraphicsLinearLayout; |
27 class QGraphicsLinearLayout; |
30 class HbLabel; |
31 class HbLabel; |
31 class HbDocumentLoader; |
32 class HbDocumentLoader; |
32 class HbListView; |
33 class HbListView; |
33 class NmHsWidgetListModel; |
34 class NmHsWidgetListModel; |
34 class QModelIndex; |
35 class QModelIndex; |
|
36 class QTimer; |
35 |
37 |
36 |
38 |
37 class NmHsWidget : public HbWidget |
39 class NmHsWidget : public HbWidget |
38 { |
40 { |
39 Q_OBJECT |
41 Q_OBJECT |
53 void onInitialize(); |
55 void onInitialize(); |
54 void onUninitialize(); |
56 void onUninitialize(); |
55 void onShow(); |
57 void onShow(); |
56 void onHide(); |
58 void onHide(); |
57 //engine |
59 //engine |
58 void updateMailData(); |
|
59 void onEngineException(const int& exc); |
60 void onEngineException(const int& exc); |
60 //properties |
61 //properties |
61 void setAccountId(const QString &text); |
62 void setAccountId(const QString &text); |
62 QString accountId() const; |
63 QString accountId() const; |
63 void setAccountIconName(const QString &text); |
64 void setAccountIconName(const QString &text); |
65 void setWidgetStateProperty(QString value); |
66 void setWidgetStateProperty(QString value); |
66 QString widgetStateProperty(); |
67 QString widgetStateProperty(); |
67 //user actions |
68 //user actions |
68 void handleExpandCollapseEvent(); |
69 void handleExpandCollapseEvent(); |
69 |
70 |
|
71 void handleMessagesAddedToModel(); |
70 void openMessage(const QModelIndex& index); |
72 void openMessage(const QModelIndex& index); |
71 |
73 void scrollListToStart(); |
|
74 void updateLayout(); |
72 signals: |
75 signals: |
73 void finished(); |
76 void finished(); |
74 void setPreferences(const QStringList &names); |
77 void setPreferences(const QStringList &names); |
75 void error(); |
78 void error(); |
76 private: |
79 private: |
79 bool loadDocML(HbDocumentLoader &loader); |
82 bool loadDocML(HbDocumentLoader &loader); |
80 void addNoMailsLabelToLayout(); |
83 void addNoMailsLabelToLayout(); |
81 void removeNoMailsLabelFromLayout(); |
84 void removeNoMailsLabelFromLayout(); |
82 void addEmailRowsToLayout(); |
85 void addEmailRowsToLayout(); |
83 void removeEmailRowsFromLayout(); |
86 void removeEmailRowsFromLayout(); |
84 void updateLayout(const int visibleCount); |
|
85 void toggleExpansionState(); |
87 void toggleExpansionState(); |
86 void createMailRowsList(); |
88 void createMailRowsList(); |
87 protected: |
89 protected: |
|
90 bool event( QEvent *event ); |
|
91 private slots: |
|
92 void toggleExpansion(const HbEffect::EffectStatus &status); |
88 |
93 |
89 private: |
94 private: |
90 //UI components |
95 //UI components |
91 HbWidget* mMainContainer; //container including all UI components |
96 HbWidget* mMainContainer; //container including all UI components |
92 HbWidget* mEmptySpaceContainer; //container for empty space above mWidgetContainer |
97 HbWidget* mEmptySpaceContainer; //container for empty space above mWidgetContainer |
103 QString mAccountIconName; //name of mailbox icon shown in titlerow |
108 QString mAccountIconName; //name of mailbox icon shown in titlerow |
104 NmHsWidgetDateTimeObserver* mDateObserver; //observer for time/locale changes |
109 NmHsWidgetDateTimeObserver* mDateObserver; //observer for time/locale changes |
105 bool mIsExpanded; //true when widget expanded, false when collapsed |
110 bool mIsExpanded; //true when widget expanded, false when collapsed |
106 HbListView* mListView; //list view for messages |
111 HbListView* mListView; //list view for messages |
107 NmHsWidgetListModel* mListModel; //list model for mListView |
112 NmHsWidgetListModel* mListModel; //list model for mListView |
108 |
113 QTimer *mListActivityTimer; //Timer for delaying activities after list scrolling |
109 public: |
114 public: |
110 friend class TestNmHsWidget; |
115 friend class TestNmHsWidget; |
111 }; |
116 }; |
112 |
117 |
113 #endif // NMHSWIDGET_H |
118 #endif // NMHSWIDGET_H |