|
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:Message chat View decorator item prototype |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CNTHISTORYVIEWITEM_H |
|
19 #define CNTHISTORYVIEWITEM_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <hblistviewitem.h> |
|
23 |
|
24 class HbFrameItem; |
|
25 |
|
26 /** |
|
27 * This class represents the item decorator of |
|
28 * the comm history view. |
|
29 */ |
|
30 class CntHistoryViewItem : public HbListViewItem |
|
31 { |
|
32 Q_OBJECT |
|
33 Q_PROPERTY( bool incoming READ getIncoming ) |
|
34 Q_PROPERTY( bool newmessage READ isNewMessage ) |
|
35 |
|
36 public: |
|
37 /* |
|
38 * Constructor |
|
39 * @param parent, reference of QGraphicsItem |
|
40 * default set to 0 |
|
41 */ |
|
42 CntHistoryViewItem(QGraphicsItem* parent=0); |
|
43 |
|
44 /* |
|
45 * Factory method to the items |
|
46 */ |
|
47 HbAbstractViewItem* createItem(); |
|
48 |
|
49 /* |
|
50 * Overriden method to draw the custom item in the list view |
|
51 */ |
|
52 void updateChildItems(); |
|
53 |
|
54 bool getIncoming() const { return mIncoming; } |
|
55 bool isNewMessage() const { return mNewMessage; } |
|
56 |
|
57 protected: |
|
58 /* |
|
59 * Overriden method to overwrite the default "pressed" effect |
|
60 */ |
|
61 void pressStateChanged(bool pressed, bool animate); |
|
62 |
|
63 private: |
|
64 bool mIncoming; |
|
65 bool mNewMessage; |
|
66 |
|
67 HbFrameItem* mNewItem; |
|
68 HbFrameItem* mFocusItem; |
|
69 }; |
|
70 |
|
71 #endif // CNTHISTORYVIEWITEM_H |