60 QString accountIconName() const; |
66 QString accountIconName() const; |
61 void setWidgetStateProperty(QString value); |
67 void setWidgetStateProperty(QString value); |
62 QString widgetStateProperty(); |
68 QString widgetStateProperty(); |
63 //user actions |
69 //user actions |
64 void handleExpandCollapseEvent(); |
70 void handleExpandCollapseEvent(); |
|
71 |
|
72 void openMessage(const QModelIndex& index); |
65 |
73 |
66 signals: |
74 signals: |
67 void finished(); |
75 void finished(); |
68 void setPreferences(const QStringList &names); |
76 void setPreferences(const QStringList &names); |
69 void error(); |
77 void error(); |
70 private: |
78 private: |
71 void setupLocalization(); |
79 void setupLocalization(); |
72 void setupUi(); |
80 void setupUi(); |
73 bool loadDocML(HbDocumentLoader &loader); |
81 bool loadDocML(HbDocumentLoader &loader); |
74 void updateMailRowsVisibility(const int visibleCount); |
|
75 void addNoMailsLabelToLayout(); |
82 void addNoMailsLabelToLayout(); |
76 void removeNoMailsLabelFromLayout(); |
83 void removeNoMailsLabelFromLayout(); |
77 void addEmailRowsToLayout(); |
84 void addEmailRowsToLayout(); |
78 void removeEmailRowsFromLayout(); |
85 void removeEmailRowsFromLayout(); |
79 void updateLayout(const int visibleCount); |
86 void updateLayout(const int visibleCount); |
80 void toggleExpansionState(); |
87 void toggleExpansionState(); |
81 |
88 void createMailRowsList(); |
82 protected: |
89 protected: |
83 void createMailRowsList(); |
|
84 |
90 |
85 private: |
91 private: |
86 //UI components |
92 //UI components |
87 HbWidget* mMainContainer; //container including all UI components |
93 HbWidget* mMainContainer; //container including all UI components |
88 HbWidget* mEmptySpaceContainer; //container for empty space above mWidgetContainer |
94 HbWidget* mEmptySpaceContainer; //container for empty space above mWidgetContainer |
89 HbWidget* mWidgetContainer; //container including title row and mContentContainer |
95 HbWidget* mWidgetContainer; //container including title row and mContentContainer |
90 NmHsWidgetTitleRow* mTitleRow; //mailbox icon, name, unread count and expand button |
96 NmHsWidgetTitleRow* mTitleRow; //mailbox icon, name, unread count and expand button |
91 HbWidget* mContentContainer; //container for mail rows or mNoMailsLabel |
97 HbWidget* mContentContainer; //container for mail rows or mNoMailsLabel |
92 QList<NmHsWidgetEmailRow*> mMailRows; //list including mail row instances |
|
93 HbLabel* mNoMailsLabel; //label shown in mContentContainer when no mails in inbox |
98 HbLabel* mNoMailsLabel; //label shown in mContentContainer when no mails in inbox |
94 QGraphicsLinearLayout* mContentLayout; //layout used in mContentContainer |
99 QGraphicsLinearLayout* mContentLayout; //layout used in mContentContainer |
95 HbFrameDrawer* mBackgroundFrameDrawer; //drawer for widget background shown in mWidgetContainer |
100 HbFrameDrawer* mBackgroundFrameDrawer; //drawer for widget background shown in mWidgetContainer |
96 QTranslator* mTranslator; |
101 QTranslator* mTranslator; |
97 |
102 |
98 NmHsWidgetEmailEngine* mEngine; |
103 NmHsWidgetEmailEngine* mEngine; |
99 NmId mAccountId; //mail account id widget is monitoring |
104 NmId mAccountId; //mail account id widget is monitoring |
100 QString mAccountIconName; //name of mailbox icon shown in titlerow |
105 QString mAccountIconName; //name of mailbox icon shown in titlerow |
101 NmHsWidgetDateTimeObserver* mDateObserver; //observer for time/locale changes |
106 NmHsWidgetDateTimeObserver* mDateObserver; //observer for time/locale changes |
102 bool mIsExpanded; //true when widget expanded, false when collapsed |
107 bool mIsExpanded; //true when widget expanded, false when collapsed |
|
108 HbListView* mListView; //list view for messages |
|
109 NmHsWidgetListModel* mListModel; //list model for mListView |
103 |
110 |
104 public: |
111 public: |
105 friend class TestNmHsWidget; |
112 friend class TestNmHsWidget; |
106 }; |
113 }; |
107 |
114 |