author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:28:39 +0300 | |
changeset 70 | a15d9966050f |
parent 52 | 12db4185673b |
permissions | -rw-r--r-- |
31 | 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 for the messaging application. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef MSG_CONVERSATION_VIEW_H |
|
19 |
#define MSG_CONVERSATION_VIEW_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include "msgbaseview.h" |
|
23 |
#include "convergedmessage.h" |
|
24 |
||
25 |
//Forward declarations |
|
26 |
class HbListView; |
|
27 |
class HbAbstractViewItem; |
|
28 |
class MsgSendUtil; |
|
29 |
class QStandardItemModel; |
|
30 |
class MsgEditorWidget; |
|
31 |
class MsgContactCardWidget; |
|
32 |
class MsgConversationViewItem; |
|
33 |
class HbStaticVkbHost; |
|
34 |
class QGraphicsLinearLayout; |
|
35 |
class HbAction; |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
36 |
class MsgAudioFetcherDialog; |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
37 |
|
31 | 38 |
//Defines |
39 |
#define INVALID_MSG_ID -1 |
|
40 |
||
41 |
/** |
|
42 |
* This class provides the message chat view for the messaging application. |
|
43 |
* Data source for this view is the conversation model. |
|
44 |
*/ |
|
45 |
class MsgConversationView : public MsgBaseView |
|
46 |
{ |
|
47 |
Q_OBJECT |
|
48 |
||
49 |
public: |
|
50 |
||
51 |
/** |
|
52 |
* Constructor |
|
53 |
*/ |
|
54 |
MsgConversationView(MsgContactCardWidget *contactCardWidget, |
|
55 |
QGraphicsItem *parent = 0); |
|
56 |
||
57 |
/** |
|
58 |
* Destructor |
|
59 |
*/ |
|
60 |
~MsgConversationView(); |
|
61 |
||
62 |
||
63 |
/** |
|
64 |
* Clear editors |
|
65 |
* clear message and address editors |
|
66 |
*/ |
|
67 |
void clearEditors(); |
|
68 |
||
69 |
/** |
|
70 |
* Save the content inside editor to drafts |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
71 |
* @return valid message id if save is success |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
72 |
* else invalid message id ( i.e. -1 ) |
31 | 73 |
*/ |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
74 |
int saveContentToDrafts(); |
31 | 75 |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
76 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
77 |
* Event handler |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
78 |
* @param key Key code |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
79 |
* @return true if key event handled else false. |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
80 |
* @see MsgBaseView |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
81 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
82 |
bool handleKeyEvent(int key); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
83 |
|
31 | 84 |
private slots: |
85 |
||
86 |
/** |
|
87 |
* Slot is called when menu is about to be shown. |
|
88 |
* Populates the menu with relevant actions. |
|
89 |
*/ |
|
90 |
void menuAboutToShow(); |
|
91 |
||
92 |
/** |
|
93 |
* This slot is called when settings dialog is launched. |
|
94 |
* @param action selected action (yes or no). |
|
95 |
*/ |
|
96 |
void onDialogSettingsLaunch(HbAction* action); |
|
97 |
||
98 |
/** |
|
99 |
* This slot is called when delete message centre dialog is launched. |
|
100 |
* @param action selected action (yes or no). |
|
101 |
*/ |
|
102 |
void onDialogdeleteMsg(HbAction* action); |
|
103 |
||
104 |
/** |
|
105 |
* This slot is called when download message centre dialog is launched. |
|
106 |
* @param action selected action (yes or no). |
|
107 |
*/ |
|
108 |
void onDialogDownLoadMsg(HbAction* action); |
|
109 |
||
110 |
/** |
|
111 |
* This slot is called when save tone dialog is launched. |
|
112 |
* @param action selected action (yes or no). |
|
113 |
*/ |
|
114 |
void onDialogSaveTone(HbAction* action); |
|
115 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
116 |
/** |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
117 |
* This slot is called when the orientation is changed |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
118 |
* @param newOrientation orientation |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
119 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
120 |
void onOrientationChanged(Qt::Orientation newOrientation); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
121 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
122 |
/** |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
123 |
* This slot is called when the orientation is about to bechanged |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
124 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
125 |
void onOrientationAboutToBeChanged(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
126 |
|
31 | 127 |
private: |
128 |
||
129 |
/** |
|
130 |
* View initialization function. |
|
131 |
*/ |
|
132 |
void setupView(); |
|
133 |
||
134 |
/** |
|
135 |
* Setup view menu items. |
|
136 |
*/ |
|
137 |
void setupMenu(); |
|
138 |
||
139 |
/** |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
140 |
* Triggers model to fetch more conversations. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
141 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
142 |
void fetchMoreConversations(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
143 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
144 |
/** |
31 | 145 |
* Populates ConvergedMessage for sending. |
146 |
* @param ConvergedMessage to be populated |
|
147 |
* @see ConvergedMessage::MessageType |
|
148 |
*/ |
|
149 |
void populateForSending(ConvergedMessage &message); |
|
150 |
||
151 |
/** |
|
152 |
* Adds context menu entries to context menu |
|
153 |
* @param HbMenu context menu |
|
154 |
* @param int sendingstate. |
|
155 |
* @see ConvergedMessage::MessageType |
|
156 |
*/ |
|
157 |
void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
158 |
||
159 |
/** |
|
160 |
* Adds context menu entry to context menu for saving items |
|
161 |
* @param MsgConversationViewItem* item whose information is needed. |
|
162 |
* @param HbMenu context menu |
|
163 |
* @param int sendingstate. |
|
164 |
* @see ConvergedMessage::MessageType |
|
165 |
*/ |
|
166 |
void addSaveItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
167 |
||
168 |
/** |
|
169 |
* Adds context menu entry to context menu for Opening items |
|
170 |
* @param MsgConversationViewItem* item whose information is needed. |
|
171 |
* @param HbMenu context menu |
|
172 |
* @param int sendingstate. |
|
173 |
* @see ConvergedMessage::MessageType |
|
174 |
*/ |
|
175 |
void addOpenItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
176 |
||
177 |
/** |
|
178 |
* Adds context menu entry to context menu for Resending items |
|
179 |
* @param MsgConversationViewItem* item whose information is needed. |
|
180 |
* @param HbMenu context menu |
|
181 |
* @param int sendingstate. |
|
182 |
* @see ConvergedMessage::MessageType |
|
183 |
*/ |
|
184 |
void addResendItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
185 |
||
186 |
/** |
|
187 |
* Adds context menu entry to context menu for Forwarding items |
|
188 |
* @param MsgConversationViewItem* item whose information is needed. |
|
189 |
* @param HbMenu context menu |
|
190 |
* @param int sendingstate. |
|
191 |
* @see ConvergedMessage::MessageType |
|
192 |
*/ |
|
193 |
void addForwardItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
194 |
||
195 |
/** |
|
196 |
* Adds context menu entry to context menu for Deleting items |
|
197 |
* @param MsgConversationViewItem* item whose information is needed. |
|
198 |
* @param HbMenu context menu |
|
199 |
* @param int sendingstate. |
|
200 |
* @see ConvergedMessage::MessageType |
|
201 |
*/ |
|
202 |
void addDeleteItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
203 |
||
204 |
/** |
|
205 |
* Adds context menu entry to context menu for Downloading items |
|
206 |
* @param MsgConversationViewItem* item whose information is needed. |
|
207 |
* @param HbMenu context menu |
|
208 |
* @see ConvergedMessage::MessageType |
|
209 |
*/ |
|
210 |
void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu); |
|
211 |
||
212 |
/** |
|
213 |
* Launches the BT message display service. |
|
214 |
* @param index Index of the item activated/touched |
|
215 |
*/ |
|
216 |
void launchBtDisplayService(const QModelIndex & index); |
|
217 |
||
218 |
public slots: |
|
219 |
/** |
|
220 |
* Refreshes all widgets in the conversation view according to latest model |
|
221 |
* data |
|
222 |
*/ |
|
223 |
void refreshView(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
224 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
225 |
/** |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
226 |
* This slot is called when the view is successfully added to main window |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
227 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
228 |
void onViewReady(); |
31 | 229 |
|
230 |
private slots: |
|
231 |
||
232 |
/** |
|
233 |
* Utility method to scroll the list to show the bottom most item |
|
234 |
*/ |
|
235 |
void scrollToBottom(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
236 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
237 |
void onConversationViewEmpty(); |
31 | 238 |
|
239 |
/** |
|
240 |
* Handler for long tap of a list item. |
|
241 |
* @param viewItem Long tapped view item |
|
242 |
* @param point X and Y co-ordinates of long tap |
|
243 |
*/ |
|
244 |
void longPressed(HbAbstractViewItem* viewItem, const QPointF& point); |
|
245 |
||
246 |
/** |
|
247 |
* Handler for short tap/direct touch of a list item. |
|
248 |
* @param index index of the item activated/touched |
|
249 |
*/ |
|
250 |
void openItem(const QModelIndex & index); |
|
251 |
||
252 |
/** |
|
253 |
* Sends the message |
|
254 |
*/ |
|
255 |
void send(); |
|
256 |
||
257 |
// ----------------------------- View Specific Menu Slots--------------------// |
|
258 |
||
259 |
||
260 |
/** |
|
261 |
* Fetch images |
|
262 |
*/ |
|
263 |
void fetchImages(); |
|
264 |
||
265 |
/** |
|
266 |
* Fectch conatcts |
|
267 |
*/ |
|
268 |
void fetchContacts(); |
|
269 |
||
270 |
/** |
|
271 |
* Fectch audio |
|
272 |
*/ |
|
273 |
void fetchAudio(); |
|
274 |
||
275 |
/* |
|
276 |
* Get the photos and launch editor |
|
277 |
*/ |
|
278 |
void imagesFetched(const QVariant& result ); |
|
279 |
||
280 |
/** |
|
281 |
* slot to receive fetched contacts for addition |
|
282 |
*/ |
|
283 |
void contactsFetched(const QVariant& value); |
|
284 |
||
285 |
/** |
|
286 |
* slot to receive fetched contacts for vcard addition |
|
287 |
*/ |
|
288 |
void contactsFetchedForVCards(const QVariant& value); |
|
289 |
||
290 |
/* |
|
291 |
* Adds subject file to editor. |
|
292 |
*/ |
|
293 |
void addSubject(); |
|
294 |
||
295 |
||
296 |
//----------------------Item Specific menu slots ---------------------// |
|
297 |
||
298 |
/** |
|
299 |
* Forwards the message |
|
300 |
*/ |
|
301 |
void forwardMessage(); |
|
302 |
||
303 |
/** |
|
304 |
* Deletes the item |
|
305 |
*/ |
|
306 |
void deleteItem(); |
|
307 |
||
308 |
/** |
|
309 |
* Resends the item. This is only valid in the failed message case. |
|
310 |
*/ |
|
311 |
void resendMessage(); |
|
312 |
||
313 |
/** |
|
314 |
* Download the specified message |
|
315 |
*/ |
|
316 |
void downloadMessage(); |
|
317 |
||
318 |
/** |
|
319 |
* Open the item |
|
320 |
*/ |
|
321 |
void openItem(); |
|
322 |
||
323 |
/** |
|
324 |
* Set model to the view |
|
325 |
*/ |
|
326 |
void populateConversationsView(); |
|
327 |
||
328 |
/** |
|
329 |
* Save ringing tone |
|
330 |
*/ |
|
331 |
void saveRingingTone(); |
|
332 |
||
333 |
/** |
|
334 |
* Launch Editor since sms character limit reached |
|
335 |
*/ |
|
336 |
void handleSmsCharLimitReached(); |
|
337 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
338 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
339 |
* Hanldes saving of vcard. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
340 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
341 |
void saveVCard(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
342 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
343 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
344 |
* Tells is mms is shared among conversations. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
345 |
* @param messageId, message id. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
346 |
* @return true is shared among conversations. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
347 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
348 |
bool isSharedMessage(qint32 messageId); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
349 |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
350 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
351 |
* This slot is called after sound clip is |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
352 |
* selected from audio fetcher dialog |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
353 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
354 |
void onAudioSelected(QString& filePath); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
355 |
|
31 | 356 |
signals: |
357 |
/** |
|
358 |
* Signal emitted to inform close the conversation view. |
|
359 |
* When Conversation view has opened in send mode, after sending |
|
360 |
* the message, this signal is emitted. |
|
361 |
*/ |
|
362 |
void closeConversationView(); |
|
363 |
||
364 |
/** |
|
365 |
* Emitted when editor is tapped to reply. |
|
366 |
*/ |
|
367 |
void replyStarted(); |
|
368 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
369 |
/** |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
370 |
* This signal is emitted when vkb is open/closed. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
371 |
* @param state True if keypad is opened else false. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
372 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
373 |
void vkbOpened(bool state); |
31 | 374 |
|
375 |
private slots: |
|
376 |
/** |
|
377 |
* Resizes the view when VKB is opened. |
|
378 |
* This slot is triggered when user taps on the CV editor |
|
379 |
*/ |
|
380 |
void vkbOpened(); |
|
381 |
||
382 |
/** |
|
383 |
* Resizes the view when VKB is closed. |
|
384 |
* This slot is triggered when VKB focus is lost. |
|
385 |
*/ |
|
386 |
void vkbClosed(); |
|
387 |
||
388 |
private: |
|
389 |
/** |
|
390 |
* launch editor when attachment is inserted |
|
391 |
* @params data used for launching editor with pre-populated content |
|
392 |
*/ |
|
393 |
void launchUniEditor(const QVariantList& data); |
|
394 |
||
395 |
/** |
|
396 |
* Signal emitted when an error is generated. |
|
397 |
* @param errorCode Error code. |
|
398 |
* @param errorMessage Error description. |
|
399 |
*/ |
|
400 |
void serviceRequestError(int errorCode, const QString& errorMessage); |
|
401 |
||
402 |
/** |
|
403 |
* Activate Input Blocker |
|
404 |
*/ |
|
405 |
void activateInputBlocker(); |
|
406 |
||
407 |
/** |
|
408 |
* Deactivate Input Blocker |
|
409 |
*/ |
|
410 |
void deactivateInputBlocker(); |
|
411 |
||
412 |
/** |
|
413 |
* Handle provisioning message |
|
414 |
* @param msgId message id |
|
415 |
*/ |
|
416 |
void handleProvisoningMsg(int msgId); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
417 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
418 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
419 |
* Handles short tap for vcard. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
420 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
421 |
void handleShortTap(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
422 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
423 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
424 |
* helper method to show long/short tap context menu. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
425 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
426 |
void showContextMenu(HbAbstractViewItem* viewItem,const QPointF& point, int placement); |
31 | 427 |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
428 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
429 |
* Launches Dialer Service |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
430 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
431 |
void call(const QString& address); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
432 |
|
31 | 433 |
private: |
434 |
||
435 |
/** |
|
436 |
* List to hold the conversations |
|
437 |
* Owned |
|
438 |
*/ |
|
439 |
HbListView *mConversationList; |
|
440 |
||
441 |
/** |
|
442 |
* Model to facilitate filtering and sorting |
|
443 |
* Owned |
|
444 |
*/ |
|
445 |
QStandardItemModel *mMessageModel; |
|
446 |
||
447 |
/** |
|
448 |
* Instance of messaged editor widget. |
|
449 |
*/ |
|
450 |
MsgEditorWidget *mEditorWidget; |
|
451 |
||
452 |
/** |
|
453 |
* Instance of Contact Card widget. |
|
454 |
*/ |
|
455 |
MsgContactCardWidget* mContactCardWidget; |
|
456 |
||
457 |
/** |
|
458 |
* Send utils instance |
|
459 |
*/ |
|
460 |
MsgSendUtil *mSendUtil; |
|
461 |
||
462 |
/** |
|
463 |
* Instance of the main layout. |
|
464 |
*/ |
|
465 |
QGraphicsLinearLayout *mMainLayout; |
|
466 |
||
467 |
/* |
|
468 |
* Instance of VKB |
|
469 |
*/ |
|
470 |
HbStaticVkbHost* mVkbHost; |
|
471 |
||
472 |
/** |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
473 |
* Instance of Audio Fetcher Dialog |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
474 |
* Need to show when attachment audio selected |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
475 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
476 |
MsgAudioFetcherDialog* mDialog; |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
477 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
478 |
/** |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
479 |
* variable holding the visible model index |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
480 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
481 |
QModelIndex mVisibleIndex; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
482 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
483 |
/** |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
484 |
* Flag is set when model is populated. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
485 |
* @see signal conversationModelPopulated() |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
486 |
*/ |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
487 |
bool mModelPopulated; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
488 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
489 |
/** |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
490 |
* Flag is set when |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
491 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
492 |
bool mViewReady; |
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
493 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
494 |
#ifdef MSGUI_UNIT_TEST |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
495 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
496 |
* Unit Testing |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
497 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
498 |
friend class TestMsgConversationView; |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
499 |
#endif |
31 | 500 |
}; |
501 |
||
502 |
#endif // MSG_CONVERSATION_VIEW_H |
|
503 |
// EOF |