|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef NMMESSAGELISTVIEWITEM_H_ |
|
19 #define NMMESSAGELISTVIEWITEM_H_ |
|
20 |
|
21 #include <hbtreeviewitem.h> |
|
22 |
|
23 class HbLabel; |
|
24 class HbTextItem; |
|
25 class HbFrameItem; |
|
26 class QStyleOptionGraphicsItem; |
|
27 class QGraphicsLayoutItem; |
|
28 class HbWidgetBase; |
|
29 class HbStyleOptionAbstractViewItem; |
|
30 class NmMessageListModel; |
|
31 class NmMessageListModelItem; |
|
32 class NmMessageEnvelope; |
|
33 class HbIconItem; |
|
34 class QColor; |
|
35 |
|
36 class NmMessageListViewItem : public HbTreeViewItem |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 explicit NmMessageListViewItem(QGraphicsItem *parent = 0); |
|
42 virtual ~NmMessageListViewItem(); |
|
43 enum { ItemType = Hb::ItemType_Last + 2 }; |
|
44 int type() const; |
|
45 void updateChildItems(); |
|
46 HbTreeViewItem *createItem(); |
|
47 bool canSetModelIndex(const QModelIndex &index) const; |
|
48 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
49 QRectF contiguousSelectionArea() const { return QRectF(); }; |
|
50 |
|
51 private: |
|
52 void createMessageItemLayout(); |
|
53 void setContentsToMessageItem(const NmMessageEnvelope &envelope, bool dividersActive); |
|
54 void setFontsRead(); |
|
55 void setFontsUnread(); |
|
56 void setFonts(const QColor &colorRole, HbFontSpec &spekki); |
|
57 void getFontSizes(); |
|
58 |
|
59 private: |
|
60 HbTextItem *mSender; // Owned |
|
61 HbTextItem *mSubject; // Owned |
|
62 HbTextItem *mTime; // Owned |
|
63 HbLabel *mDividerTitle; // Owned |
|
64 HbFrameItem *mNewMsgIcon; // Owned |
|
65 HbIconItem *mIcon1; // Owned |
|
66 HbIconItem *mIcon2; // Owned |
|
67 qreal mPrimarySize; |
|
68 qreal mSecondarySize; |
|
69 qreal mTinySize; |
|
70 }; |
|
71 |
|
72 |
|
73 #endif /* NMMESSAGELISTVIEWITEM_H_ */ |