38 Q_PROPERTY(QString widgetState READ widgetStateProperty WRITE setWidgetStateProperty) |
40 Q_PROPERTY(QString widgetState READ widgetStateProperty WRITE setWidgetStateProperty) |
39 |
41 |
40 public: |
42 public: |
41 NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
43 NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
42 ~NmHsWidget(); |
44 ~NmHsWidget(); |
|
45 |
|
46 QPainterPath shape() const; |
43 |
47 |
44 public slots: |
48 public slots: |
45 //from home screen fw |
49 //from home screen fw |
46 void onInitialize(); |
50 void onInitialize(); |
47 void onShow(); |
51 void onShow(); |
48 void onHide(); |
52 void onHide(); |
49 void onUninitialize(); |
|
50 //engine |
53 //engine |
51 void updateMailData(); |
54 void updateMailData(); |
52 void onEngineException(const int& exc); |
55 void onEngineException(const int& exc); |
53 //properties |
56 //properties |
54 void setAccountId(const QString &text); |
57 void setAccountId(const QString &text); |
63 signals: |
66 signals: |
64 void finished(); |
67 void finished(); |
65 void setPreferences(const QStringList &names); |
68 void setPreferences(const QStringList &names); |
66 void error(); |
69 void error(); |
67 private: |
70 private: |
68 bool setupLocalization(); |
71 void setupLocalization(); |
69 void setupUi(); |
72 void setupUi(); |
|
73 bool loadDocML(HbDocumentLoader &loader); |
70 void updateMailRowsVisibility(const int visibleCount); |
74 void updateMailRowsVisibility(const int visibleCount); |
|
75 void addNoMailsLabelToLayout(); |
|
76 void removeNoMailsLabelFromLayout(); |
|
77 void addEmailRowsToLayout(); |
|
78 void removeEmailRowsFromLayout(); |
|
79 void updateLayout(const int visibleCount); |
71 void toggleExpansionState(); |
80 void toggleExpansionState(); |
72 |
81 |
73 protected: |
82 protected: |
74 void updateMailRowsList(const int mailCount); |
83 void createMailRowsList(); |
75 |
84 |
76 private: |
85 private: |
77 NmHsWidgetEmailEngine* mEngine; |
86 NmHsWidgetEmailEngine* mEngine; |
78 QGraphicsLinearLayout *mRowLayout; |
87 NmHsWidgetTitleRow* mTitleRow; |
79 NmHsWidgetTitleRow* mTitleRow; |
88 QList<NmHsWidgetEmailRow*> mMailRows; //list including mail row instances |
80 QList<NmHsWidgetEmailRow*> mMailRows; |
89 NmId mAccountId; //mail account id widget is monitoring |
81 NmId mAccountId; |
90 QString mAccountIconName; //name of mailbox icon shown in titlerow |
82 QString mAccountIconName; |
91 QTranslator* mTranslator; |
83 QTranslator *mTranslator; |
92 HbFrameDrawer* mBackgroundFrameDrawer; //drawer for widget backgound |
84 HbFrameDrawer* mBackgroundFrameDrawer; |
93 bool mIsExpanded; //true when widget expanded, false when collapsed |
85 bool mIsExpanded; |
94 NmHsWidgetDateTimeObserver* mDateObserver; //observer for time/locale changes |
86 bool mStaticWidget; |
95 HbLabel* mNoMailsLabel; //label shown in widget when no mails in inbox |
87 NmHsWidgetDateTimeObserver* mDateObserver; |
96 HbWidget* mWidgetContainer; //container including title row and content container |
|
97 HbWidget* mContentContainer; //container including mail rows and mNoMailsLabel |
|
98 QGraphicsLinearLayout* mContentLayout; //layout for mail rows |
88 |
99 |
89 public: |
100 public: |
90 friend class TestNmHsWidget; |
101 friend class TestNmHsWidget; |
91 }; |
102 }; |
92 |
103 |