|
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: Custom layout widget for Contact Card layout. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MSGCONTACTCARDWIDGET_H |
|
19 #define MSGCONTACTCARDWIDGET_H |
|
20 |
|
21 // SYSTEM INCLUDES |
|
22 #include <HbAbstractButton> |
|
23 |
|
24 // FORWORD DECLARATIONS |
|
25 class HbIconItem; |
|
26 class HbTextItem; |
|
27 class HbIcon; |
|
28 class HbPushButton; |
|
29 class QGraphicsSceneMouseEvent; |
|
30 |
|
31 #include "convergedmessageaddress.h" |
|
32 |
|
33 /** |
|
34 * This class is a custom layout widget for Contact Card layout. |
|
35 */ |
|
36 class MsgContactCardWidget : public HbAbstractButton |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Constructor |
|
44 */ |
|
45 explicit MsgContactCardWidget(QGraphicsItem *parent = 0); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~MsgContactCardWidget(); |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Sets the avatar |
|
56 * @param avatar Avatar to be set. |
|
57 */ |
|
58 void setAvatar(const HbIcon &avatar); |
|
59 |
|
60 /** |
|
61 * Sets the presence icon |
|
62 * @param presenceIcon Presence icon to set. |
|
63 */ |
|
64 void setPresenceIcon(const HbIcon &presenceIcon); |
|
65 |
|
66 /** |
|
67 * Sets the address to be displayed. |
|
68 * @param address Address string to be set. |
|
69 */ |
|
70 void setAddress(const QString &address); |
|
71 |
|
72 /** |
|
73 * Returns the address displayed in the Contact card. |
|
74 */ |
|
75 ConvergedMessageAddressList address(); |
|
76 |
|
77 /** |
|
78 * Refreshes all the Contact card fields. |
|
79 */ |
|
80 void updateContents(); |
|
81 |
|
82 |
|
83 /** |
|
84 * Clears all the Contact card fields. |
|
85 */ |
|
86 void clearContent(); |
|
87 |
|
88 signals: |
|
89 |
|
90 /** |
|
91 * Signal emitted when widget is clicked. |
|
92 */ |
|
93 void clicked(); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * Initialization function. |
|
99 */ |
|
100 void init(); |
|
101 |
|
102 private: |
|
103 // Data |
|
104 |
|
105 /** |
|
106 * Address string. |
|
107 */ |
|
108 QString mAddress; |
|
109 |
|
110 /** |
|
111 * Avatar icon item. |
|
112 * Own. |
|
113 */ |
|
114 HbIconItem *mAvatarIconItem; |
|
115 |
|
116 /** |
|
117 * Presence icon item. |
|
118 * Own. |
|
119 */ |
|
120 HbIconItem *mPresenceIconItem; |
|
121 |
|
122 /** |
|
123 * Address text item. |
|
124 * Own. |
|
125 */ |
|
126 HbTextItem *mAddressTextItem; |
|
127 |
|
128 /** |
|
129 * Background frame item. |
|
130 * Own. |
|
131 */ |
|
132 HbPushButton *mBackgroundItem; |
|
133 }; |
|
134 |
|
135 #endif // MSGCONTACTCARDWIDGET_H |
|
136 // EOF |