1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
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 "nmcommon.h" |
22 |
23 |
23 class NmHsWidgetEmailEngine; |
24 class NmHsWidgetEmailEngine; |
24 class NmHsWidgetTitleRow; |
25 class NmHsWidgetTitleRow; |
25 class NmHsWidgetEmailRow; |
26 class NmHsWidgetEmailRow; |
26 class QGraphicsLinearLayout; |
27 class QGraphicsLinearLayout; |
27 |
28 |
28 class NmHsWidget : public HbWidget |
29 class NmHsWidget : public HbWidget |
29 { |
30 { |
30 Q_OBJECT |
31 Q_OBJECT |
|
32 |
|
33 Q_PROPERTY(QString accountId READ accountId WRITE setAccountId) |
31 |
34 |
32 public: |
35 public: |
33 NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
36 NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
34 ~NmHsWidget(); |
37 ~NmHsWidget(); |
35 |
38 |
36 public slots: |
39 public slots: |
37 void onInitialize(); |
40 void onInitialize(); |
|
41 void onShow(); |
|
42 void onHide(); |
38 void onUninitialize(); |
43 void onUninitialize(); |
39 |
44 |
40 void updateAccountName(const QString& accountName); |
45 |
41 void updateUnreadCount(const int& unreadCount); |
|
42 void updateMailData(); |
46 void updateMailData(); |
|
47 void setAccountId(const QString &text); |
|
48 QString accountId() const; |
43 |
49 |
44 protected: |
50 protected: |
45 void updateMailRowsList(int mailCount); |
51 void updateMailRowsList(int mailCount); |
46 void paint(QPainter *painter, |
52 void paint(QPainter *painter, |
47 const QStyleOptionGraphicsItem *option, |
53 const QStyleOptionGraphicsItem *option, |
48 QWidget *widget); |
54 QWidget *widget); |
|
55 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
49 |
56 |
50 private: |
57 private: |
51 NmHsWidgetEmailEngine* mEngine; |
58 NmHsWidgetEmailEngine* mEngine; |
52 QGraphicsLinearLayout *mRowLayout; |
59 QGraphicsLinearLayout *mRowLayout; |
53 NmHsWidgetTitleRow* mTitleRow; |
60 NmHsWidgetTitleRow* mTitleRow; |
54 QList<NmHsWidgetEmailRow*> mMailRows; |
61 QList<NmHsWidgetEmailRow*> mMailRows; |
|
62 NmId mAccountId; |
55 |
63 |
56 public: |
64 public: |
57 friend class TestNmHsWidget; |
65 friend class TestNmHsWidget; |
58 }; |
66 }; |
59 |
67 |