|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NMHSWIDGETEMAILROW_H_ |
|
20 #define NMHSWIDGETEMAILROW_H_ |
|
21 |
|
22 #include <QDateTime> |
|
23 #include <hbwidget.h> |
|
24 #include "nmcommon.h" |
|
25 #include "nmmessageenvelope.h" |
|
26 |
|
27 //FORWARD DECLARATIONS: |
|
28 class HbLabel; |
|
29 class HbFrameItem; |
|
30 |
|
31 class NmHsWidgetEmailRow : public HbWidget |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 NmHsWidgetEmailRow(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); |
|
37 ~NmHsWidgetEmailRow(); |
|
38 NmId messageId(); |
|
39 bool setupUI(); |
|
40 void gestureEvent(QGestureEvent *event); |
|
41 |
|
42 public slots: |
|
43 void updateMailData( const NmMessageEnvelope& envelope ); |
|
44 void updateDateTime(); |
|
45 |
|
46 signals: |
|
47 void mailViewerLaunchTriggered(const NmId& messageId); |
|
48 |
|
49 private: |
|
50 void setIconsToWidget( const NmMessageEnvelope& envelope ); |
|
51 void hideIcons(); |
|
52 bool loadDocML(); |
|
53 bool setupGraphics(); |
|
54 void setFontsSize( bool read ); |
|
55 void setHighlighedFontsColor( bool pressed ); |
|
56 void showHighlight( bool pressed ); |
|
57 |
|
58 protected: |
|
59 bool event( QEvent *event ); |
|
60 |
|
61 private: |
|
62 HbLabel *mSenderLabel; |
|
63 HbLabel *mSubjectLabel; |
|
64 HbLabel *mTimeLabel; |
|
65 HbWidget *mNewMailIcon; |
|
66 HbLabel *mSeparatorIcon; |
|
67 NmId mMessageId; |
|
68 QDateTime mMessageSentTime; |
|
69 QList <HbLabel*> mStatusIcons; |
|
70 NmMessageEnvelope mEnvelope; |
|
71 HbFrameItem* mBackgroundLayoutItem; |
|
72 |
|
73 }; |
|
74 |
|
75 #endif // NMHSWIDGETEMAILROW_H_ |