18 #ifndef MSG_CONVERSATION_VIEW_H |
18 #ifndef MSG_CONVERSATION_VIEW_H |
19 #define MSG_CONVERSATION_VIEW_H |
19 #define MSG_CONVERSATION_VIEW_H |
20 |
20 |
21 // INCLUDES |
21 // INCLUDES |
22 #include "msgbaseview.h" |
22 #include "msgbaseview.h" |
|
23 #include "convergedmessage.h" |
23 |
24 |
24 //Forward declarations |
25 //Forward declarations |
25 class HbListView; |
26 class HbListView; |
26 class HbAbstractViewItem; |
27 class HbAbstractViewItem; |
27 class MsgUiUtilsManager; |
28 class MsgSendUtil; |
28 class ConvergedMessage; |
|
29 class QStandardItemModel; |
29 class QStandardItemModel; |
30 class MsgEditorWidget; |
30 class MsgEditorWidget; |
31 class MsgContactCardWidget; |
31 class MsgContactCardWidget; |
|
32 class MsgConversationViewItem; |
|
33 class HbStaticVkbHost; |
|
34 class QGraphicsLinearLayout; |
|
35 |
|
36 //Defines |
|
37 #define INVALID_MSG_ID -1 |
32 |
38 |
33 /** |
39 /** |
34 * This class provides the message chat view for the messaging application. |
40 * This class provides the message chat view for the messaging application. |
35 * Data source for this view is the conversation model. |
41 * Data source for this view is the conversation model. |
36 */ |
42 */ |
67 * Save the content inside editor to drafts |
68 * Save the content inside editor to drafts |
68 * @return true if save is success else false. |
69 * @return true if save is success else false. |
69 */ |
70 */ |
70 bool saveContentToDrafts(); |
71 bool saveContentToDrafts(); |
71 |
72 |
72 public: |
73 private slots: |
|
74 |
|
75 /** |
|
76 * Slot is called when menu is about to be shown. |
|
77 * Populates the menu with relevant actions. |
|
78 */ |
|
79 void menuAboutToShow(); |
|
80 |
|
81 private: |
73 |
82 |
74 /** |
83 /** |
75 * View initialization function. |
84 * View initialization function. |
76 */ |
85 */ |
77 void setupView(); |
86 void setupView(); |
78 |
87 |
79 /** |
88 /** |
80 * Creates view menu items. |
89 * Setup view menu items. |
81 */ |
90 */ |
82 void addMenu(); |
91 void setupMenu(); |
83 |
|
84 public slots: |
|
85 |
|
86 /** |
|
87 * Slot to receive error sign. |
|
88 * @param error The error as a string to be displayed on the screen. |
|
89 */ |
|
90 |
|
91 void serviceError(const QString& error); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * Load command plugin |
|
96 * @return true if plugin is loaded successfully else false |
|
97 */ |
|
98 bool loadCommandPlugin(); |
|
99 |
|
100 /** |
|
101 * This function shall parse the service Id and check for |
|
102 * type of client |
|
103 * @param serviceId string reference to service id |
|
104 * @return String type the server name |
|
105 */ |
|
106 QString parseServiceId(const QString &serviceId); |
|
107 |
|
108 /** |
|
109 * Returns the current message type selected in editor. |
|
110 * @return returns message type |
|
111 * @see ConvergedMessage::MessageType |
|
112 */ |
|
113 int currentMessageType(); |
|
114 |
92 |
115 /** |
93 /** |
116 * Populates ConvergedMessage for sending. |
94 * Populates ConvergedMessage for sending. |
117 * @param ConvergedMessage to be populated |
95 * @param ConvergedMessage to be populated |
118 * @see ConvergedMessage::MessageType |
96 * @see ConvergedMessage::MessageType |
119 */ |
97 */ |
120 void populateForSending(ConvergedMessage &message); |
98 void populateForSending(ConvergedMessage &message); |
|
99 |
|
100 /** |
|
101 * Adds context menu entries to context menu |
|
102 * @param HbMenu context menu |
|
103 * @param int sendingstate. |
|
104 * @see ConvergedMessage::MessageType |
|
105 */ |
|
106 void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
107 |
|
108 /** |
|
109 * Adds context menu entry to context menu for Opening items |
|
110 * @param MsgConversationViewItem* item whose information is needed. |
|
111 * @param HbMenu context menu |
|
112 * @param int sendingstate. |
|
113 * @see ConvergedMessage::MessageType |
|
114 */ |
|
115 void addOpenItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
116 |
|
117 /** |
|
118 * Adds context menu entry to context menu for Resending items |
|
119 * @param MsgConversationViewItem* item whose information is needed. |
|
120 * @param HbMenu context menu |
|
121 * @param int sendingstate. |
|
122 * @see ConvergedMessage::MessageType |
|
123 */ |
|
124 void addResendItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
125 |
|
126 /** |
|
127 * Adds context menu entry to context menu for Forwarding items |
|
128 * @param MsgConversationViewItem* item whose information is needed. |
|
129 * @param HbMenu context menu |
|
130 * @param int sendingstate. |
|
131 * @see ConvergedMessage::MessageType |
|
132 */ |
|
133 void addForwardItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
134 |
|
135 /** |
|
136 * Adds context menu entry to context menu for Deleting items |
|
137 * @param MsgConversationViewItem* item whose information is needed. |
|
138 * @param HbMenu context menu |
|
139 * @param int sendingstate. |
|
140 * @see ConvergedMessage::MessageType |
|
141 */ |
|
142 void addDeleteItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); |
|
143 |
|
144 /** |
|
145 * Adds context menu entry to context menu for Downloading items |
|
146 * @param MsgConversationViewItem* item whose information is needed. |
|
147 * @param HbMenu context menu |
|
148 * @see ConvergedMessage::MessageType |
|
149 */ |
|
150 void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu); |
|
151 |
|
152 /** |
|
153 * Validates if message can be forwarded |
|
154 * @param messageType |
|
155 * @param messageId |
|
156 * @return true if message can be forwarded |
|
157 * false if message cant be forwarded |
|
158 */ |
|
159 bool validateMsgForForward(int &messageType,qint32 &messageId); |
|
160 |
|
161 /** |
|
162 * Launches the BT message display service. |
|
163 * @param index Index of the item activated/touched |
|
164 */ |
|
165 void launchBtDisplayService(const QModelIndex & index); |
121 |
166 |
122 public slots: |
167 public slots: |
123 /** |
168 /** |
124 * Refreshes all widgets in the conversation view according to latest model |
169 * Refreshes all widgets in the conversation view according to latest model |
125 * data |
170 * data |
126 */ |
171 */ |
127 void refreshView(); |
172 void refreshView(); |
128 |
|
129 /** |
|
130 * Effect finish handler |
|
131 * data |
|
132 */ |
|
133 void effectFinished(const HbEffect::EffectStatus &status); |
|
134 |
173 |
135 private slots: |
174 private slots: |
136 |
175 |
137 /** |
176 /** |
138 * Utility method to scroll the list to show the bottom most item |
177 * Utility method to scroll the list to show the bottom most item |
157 */ |
196 */ |
158 void send(); |
197 void send(); |
159 |
198 |
160 // ----------------------------- View Specific Menu Slots--------------------// |
199 // ----------------------------- View Specific Menu Slots--------------------// |
161 |
200 |
162 /** |
201 |
163 * Deletes all the conversations |
202 /** |
164 */ |
203 * Fetch images |
165 void deleteAll(); |
204 */ |
|
205 void fetchImages(); |
|
206 |
|
207 /** |
|
208 * Fectch conatcts |
|
209 */ |
|
210 void fetchContacts(); |
|
211 |
|
212 /** |
|
213 * Fectch audio |
|
214 */ |
|
215 void fetchAudio(); |
166 |
216 |
167 /* |
217 /* |
168 * Get the photos and launch editor |
218 * Get the photos and launch editor |
169 */ |
219 */ |
170 void imagesFetched(const QVariant& result ); |
220 void imagesFetched(const QVariant& result ); |
|
221 |
|
222 /** |
|
223 * slot to receive fetched contacts for addition |
|
224 */ |
|
225 void contactsFetched(const QVariant& value); |
171 |
226 |
172 /* |
227 /* |
173 * Get audio files from audio-fetcher and launch editor |
228 * Get audio files from audio-fetcher and launch editor |
174 */ |
229 */ |
175 void audiosFetched(const QVariant& result ); |
230 void audiosFetched(const QVariant& result ); |
176 |
231 |
177 /* |
232 /** |
178 * Adds other recipients to editor |
233 * slot to receive fetched contacts for vcard addition |
179 */ |
234 */ |
180 void addRecipients(); |
235 void contactsFetchedForVCards(const QVariant& value); |
181 |
236 |
182 /* |
237 /* |
183 * Adds subject file to editor. |
238 * Adds subject file to editor. |
184 */ |
239 */ |
185 void addSubject(); |
240 void addSubject(); |
186 |
241 |
187 /** |
|
188 * Launches help |
|
189 */ |
|
190 void launchHelp(); |
|
191 |
|
192 /** |
|
193 * Exits the application |
|
194 */ |
|
195 void exitApp(); |
|
196 |
242 |
197 //----------------------Item Specific menu slots ---------------------// |
243 //----------------------Item Specific menu slots ---------------------// |
198 |
244 |
199 /** |
245 /** |
200 * Forwards the message |
246 * Forwards the message |
231 |
292 |
232 /** |
293 /** |
233 * Emitted when editor is tapped to reply. |
294 * Emitted when editor is tapped to reply. |
234 */ |
295 */ |
235 void replyStarted(); |
296 void replyStarted(); |
236 |
297 |
|
298 /** |
|
299 * This signal is emitted when vkb is open. |
|
300 */ |
|
301 void hideChrome(bool); |
|
302 |
|
303 private slots: |
|
304 /** |
|
305 * Resizes the view when VKB is opened. |
|
306 * This slot is triggered when user taps on the CV editor |
|
307 */ |
|
308 void vkbOpened(); |
|
309 |
|
310 /** |
|
311 * Resizes the view when VKB is closed. |
|
312 * This slot is triggered when VKB focus is lost. |
|
313 */ |
|
314 void vkbClosed(); |
|
315 |
237 private: |
316 private: |
238 /** |
317 /** |
239 * launch editor when attachment is inserted |
318 * launch editor when attachment is inserted |
240 * @params eflag Editor content to be shown |
319 * @params data used for launching editor with pre-populated content |
241 * @params attachment file attachment for editor |
320 */ |
242 */ |
321 void launchUniEditor(const QVariantList& data); |
243 void launchUniEditor(const int editorFields, QString& attachment); |
322 |
|
323 /** |
|
324 * Signal emitted when an error is generated. |
|
325 * @param errorCode Error code. |
|
326 * @param errorMessage Error description. |
|
327 */ |
|
328 void serviceRequestError(int errorCode, const QString& errorMessage); |
|
329 |
|
330 /** |
|
331 * Activate Input Blocker |
|
332 */ |
|
333 void activateInputBlocker(); |
|
334 |
|
335 /** |
|
336 * Deactivate Input Blocker |
|
337 */ |
|
338 void deactivateInputBlocker(); |
244 |
339 |
245 private: |
340 private: |
246 |
341 |
247 /** |
342 /** |
248 * List to hold the conversations |
343 * List to hold the conversations |