17 |
17 |
18 #ifndef MSGCONTACTCARDWIDGET_H |
18 #ifndef MSGCONTACTCARDWIDGET_H |
19 #define MSGCONTACTCARDWIDGET_H |
19 #define MSGCONTACTCARDWIDGET_H |
20 |
20 |
21 // SYSTEM INCLUDES |
21 // SYSTEM INCLUDES |
22 #include <HbAbstractButton> |
22 #include <HbWidget> |
23 |
23 |
24 // FORWORD DECLARATIONS |
24 // FORWORD DECLARATIONS |
25 class HbIconItem; |
25 class HbIconItem; |
26 class HbTextItem; |
26 class HbTextItem; |
27 class HbIcon; |
27 class HbIcon; |
28 class HbPushButton; |
|
29 class QGraphicsSceneMouseEvent; |
28 class QGraphicsSceneMouseEvent; |
|
29 class HbGestureSceneFilter; |
30 |
30 |
31 #include "convergedmessageaddress.h" |
31 #include "convergedmessageaddress.h" |
32 |
32 |
33 /** |
33 /** |
34 * This class is a custom layout widget for Contact Card layout. |
34 * This class is a custom layout widget for Contact Card layout. |
35 */ |
35 */ |
36 class MsgContactCardWidget : public HbAbstractButton |
36 class MsgContactCardWidget : public HbWidget |
37 { |
37 { |
38 Q_OBJECT |
38 Q_OBJECT |
39 |
39 |
40 public: |
40 public: |
41 |
41 |
82 |
82 |
83 /** |
83 /** |
84 * Clears all the Contact card fields. |
84 * Clears all the Contact card fields. |
85 */ |
85 */ |
86 void clearContent(); |
86 void clearContent(); |
87 |
87 |
|
88 /** |
|
89 * for tactile feed back. |
|
90 */ |
|
91 HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; |
|
92 |
|
93 /** |
|
94 * To connect/disconnect clicked signal |
|
95 */ |
|
96 void connectSignals(bool yes); |
|
97 |
|
98 protected: |
|
99 /** |
|
100 * reimplemented from base class. |
|
101 */ |
|
102 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
103 |
|
104 /** |
|
105 * reimplemented from base class. |
|
106 */ |
|
107 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 * Initialization function. |
|
113 */ |
|
114 void init(); |
|
115 |
|
116 /** Helper method to get contact id against phone number. |
|
117 * @param value phone number. |
|
118 */ |
|
119 int resolveContactId(const QString& value); |
|
120 |
|
121 /** |
|
122 * Helper method to set back ground. |
|
123 */ |
|
124 void setBackGround(const QString& bg); |
|
125 |
|
126 private slots: |
|
127 /** |
|
128 * show longpress menu for attachment object |
|
129 */ |
|
130 void handleLongPress(QPointF position); |
|
131 |
|
132 /** |
|
133 * Helper method to initialize gesture. |
|
134 */ |
|
135 void initGesture(); |
|
136 |
|
137 /** |
|
138 * Slot for handling valid returns from the framework. |
|
139 * Updates the display name in the contact card widget. |
|
140 * @param result const QVariant& |
|
141 */ |
|
142 void handleOk(const QVariant& result); |
|
143 |
|
144 /** |
|
145 * Slot for handling errors. Error ids are provided as |
|
146 * 32-bit integers. |
|
147 * @param errorCode qint32 |
|
148 */ |
|
149 void handleError(int errorCode, const QString& errorMessage); |
|
150 |
|
151 /** |
|
152 * Called when clicked() signal is emitted |
|
153 * Launches phonebook to view an existing contact |
|
154 * or to add a new contact |
|
155 */ |
|
156 void openContactInfo(); |
|
157 |
|
158 /** |
|
159 * Launches Dialer Service |
|
160 */ |
|
161 void call(); |
|
162 |
|
163 /** |
|
164 * Adds unknown number to phonebook |
|
165 */ |
|
166 void addToContacts(); |
|
167 |
|
168 /** |
|
169 * Called after service request is completed. |
|
170 */ |
|
171 void onServiceRequestCompleted(); |
|
172 |
88 signals: |
173 signals: |
89 |
174 /** |
90 /** |
175 * Emitted when contact card is short tapped. |
91 * Signal emitted when widget is clicked. |
176 */ |
92 */ |
|
93 void clicked(); |
177 void clicked(); |
94 |
178 |
95 private: |
|
96 |
|
97 /** |
|
98 * Initialization function. |
|
99 */ |
|
100 void init(); |
|
101 |
179 |
102 private: |
180 private: |
103 // Data |
181 // Data |
104 |
182 |
|
183 |
|
184 /** |
|
185 * To supress short tap if long tap triggered. |
|
186 */ |
|
187 bool mMenuShown; |
|
188 |
|
189 /** |
|
190 * Contact Number for the conversation |
|
191 */ |
|
192 QString mContactNumber; |
|
193 |
105 /** |
194 /** |
106 * Address string. |
195 * Address string. |
107 */ |
196 */ |
108 QString mAddress; |
197 QString mAddress; |
109 |
198 |