|
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 MSG_CONVERSATION_VIEW_ITEM_H |
|
19 #define MSG_CONVERSATION_VIEW_ITEM_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <HbListViewItem> |
|
23 |
|
24 //Forward Declarations |
|
25 class MsgConversationWidget; |
|
26 class HbTextItem; |
|
27 class HbIconItem; |
|
28 |
|
29 /** |
|
30 * This class represents the item decorator of |
|
31 * the conversation view. |
|
32 */ |
|
33 class MsgConversationViewItem : public HbListViewItem |
|
34 { |
|
35 Q_OBJECT |
|
36 |
|
37 Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming) |
|
38 |
|
39 public: |
|
40 /** |
|
41 * Constructor |
|
42 * @param parent, reference of QGraphicsItem |
|
43 * default set to 0 |
|
44 */ |
|
45 MsgConversationViewItem(QGraphicsItem* parent = 0); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~MsgConversationViewItem(); |
|
51 |
|
52 /** |
|
53 * Factory method to the items |
|
54 */ |
|
55 virtual MsgConversationViewItem* createItem(); |
|
56 |
|
57 /** |
|
58 * Overridden method to draw the custom item in the list view |
|
59 */ |
|
60 void updateChildItems(); |
|
61 |
|
62 /** |
|
63 * Checks if point in question is within bubble frame or not. |
|
64 * @param point, point to be checked. |
|
65 * @return returns true is point is within bubble frame geometry. |
|
66 */ |
|
67 bool containsPoint(const QPointF& point); |
|
68 |
|
69 /** |
|
70 * Specify if this widget's message is incoming |
|
71 * @param incoming |
|
72 */ |
|
73 void setIncoming(bool incoming = true); |
|
74 |
|
75 /** |
|
76 * Get to find if this is incoming message |
|
77 * @return bool |
|
78 */ |
|
79 bool isIncoming(); |
|
80 |
|
81 private: |
|
82 |
|
83 void setMessageStateIcon(int messageState); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * Info about received or outgoing message. |
|
89 * true if received message else false. |
|
90 */ |
|
91 bool mIncoming; |
|
92 |
|
93 /* |
|
94 * The chat custom control to show the conversation item |
|
95 * Owned |
|
96 */ |
|
97 MsgConversationWidget *mConversation; |
|
98 |
|
99 /** |
|
100 * Graphics Item to hold message sending state. |
|
101 * Owned |
|
102 */ |
|
103 HbIconItem *mMessageStateIconItem; |
|
104 }; |
|
105 |
|
106 #endif // MSG_CONVERSATION_VIEW_ITEM_H |
|
107 // EOF |