102 mUiEngine(NULL), |
102 mUiEngine(NULL), |
103 mEditorToolBarRequest(NULL), |
103 mEditorToolBarRequest(NULL), |
104 mViewerToolBarRequest(NULL), |
104 mViewerToolBarRequest(NULL), |
105 mViewerViewRequest(NULL) |
105 mViewerViewRequest(NULL) |
106 { |
106 { |
107 NMLOG("NmBaseClientPlugin::NmBaseClientPlugin()-->"); |
107 NM_FUNCTION; |
|
108 |
108 mUiEngine = NmUiEngine::instance(); |
109 mUiEngine = NmUiEngine::instance(); |
109 NMLOG("<--NmBaseClientPlugin::NmBaseClientPlugin()"); |
|
110 } |
110 } |
111 |
111 |
112 /*! |
112 /*! |
113 Destructor. |
113 Destructor. |
114 */ |
114 */ |
115 NmBaseClientPlugin::~NmBaseClientPlugin() |
115 NmBaseClientPlugin::~NmBaseClientPlugin() |
116 { |
116 { |
117 NMLOG("NmBaseClientPlugin::~NmBaseClientPlugin()-->"); |
117 NM_FUNCTION; |
|
118 |
118 NmUiEngine::releaseInstance(mUiEngine); |
119 NmUiEngine::releaseInstance(mUiEngine); |
119 mUiEngine = NULL; |
120 mUiEngine = NULL; |
120 NMLOG("<--NmBaseClientPlugin::~NmBaseClientPlugin()"); |
121 } |
121 } |
122 |
122 |
123 |
123 /*! |
124 /*! |
124 Provides list of supported NmActions. |
125 Provides a list of supported NmActions. |
125 Implementation of NmUiExtensionInterface. |
126 Implementation of NmUiExtensionInterface. |
|
127 |
126 Parameter \a request controls list of request services. |
128 Parameter \a request controls list of request services. |
127 Parameter \a actionList is updated by supported NmActions. |
129 Parameter \a actionList is updated by supported NmActions. |
128 */ |
130 */ |
129 void NmBaseClientPlugin::getActions( |
131 void NmBaseClientPlugin::getActions(const NmActionRequest &request, |
130 const NmActionRequest &request, |
132 QList<NmAction *> &actionList) |
131 QList<NmAction *> &actionList) |
133 { |
132 { |
134 NM_FUNCTION; |
133 NMLOG("NmBaseClientPlugin::getActions()-->"); |
135 |
134 |
|
135 if (request.observer()) { |
136 if (request.observer()) { |
136 switch (request.contextView()) { |
137 switch (request.contextView()) { |
137 case NmActionContextViewMessageList: |
138 case NmActionContextViewMessageList: |
|
139 case NmActionContextViewMessageSearchList: |
138 { |
140 { |
139 createMessageListCommands(request, actionList); |
141 createMessageListCommands(request, actionList); |
140 break; |
142 break; |
141 } |
143 } |
142 case NmActionContextViewViewer: |
144 case NmActionContextViewViewer: |
149 createEditorViewCommands(request, actionList); |
151 createEditorViewCommands(request, actionList); |
150 break; |
152 break; |
151 } |
153 } |
152 default: |
154 default: |
153 { |
155 { |
154 NMLOG(QString("NmBaseClientPlugin::getActions(): Unknown contextView()=%1").arg(request.contextView())); |
156 NM_COMMENT(QString("NmBaseClientPlugin::getActions(): unknown contextView()=%1").arg(request.contextView())); |
155 break; |
157 break; |
156 } |
158 } |
157 } |
159 } |
158 } |
160 } |
159 NMLOG("<--NmBaseClientPlugin::getActions()"); |
161 } |
160 } |
162 |
161 |
163 |
162 /*! |
164 /*! |
163 Public slot connected to options menu refresh NmAction. |
165 Public slot connected to options menu refresh NmAction. |
164 Refreshes mailbox using the NmUiEngine instance. |
166 Refreshes mailbox using the NmUiEngine instance. |
165 */ |
167 */ |
166 void NmBaseClientPlugin::refresh() |
168 void NmBaseClientPlugin::refresh() |
167 { |
169 { |
168 NMLOG("NmBaseClientPlugin::refresh()-->"); |
170 NM_FUNCTION; |
169 |
171 |
170 int err = mUiEngine->refreshMailbox(mMenuRequest.mailboxId()); |
172 int err = mUiEngine->refreshMailbox(mMenuRequest.mailboxId()); |
171 |
173 |
172 if (NmNoError != err) { |
174 if (NmNoError != err) { |
173 // Failed to refresh the mailbox! |
175 // Failed to refresh the mailbox! |
174 NMLOG(QString("NmBaseClientPlugin::refresh(): failed err=%1").arg(err)); |
176 NM_ERROR(1,QString("NmBaseClientPlugin::refresh(): failed err=%1").arg(err)); |
175 } |
177 } |
176 |
|
177 NMLOG("<--NmBaseClientPlugin::refresh()"); |
|
178 } |
178 } |
179 |
179 |
180 /*! |
180 /*! |
181 Public slot connected to triggered() signal of open message action instance. |
181 Public slot connected to triggered() signal of open message action instance. |
182 The method sends an open response command to the action observer. |
182 The method sends an open response command to the action observer. |
183 */ |
183 */ |
184 void NmBaseClientPlugin::openMessage() |
184 void NmBaseClientPlugin::openMessage() |
185 { |
185 { |
|
186 NM_FUNCTION; |
|
187 |
186 handleRequest(NmActionResponseCommandOpen, mMenuRequest); |
188 handleRequest(NmActionResponseCommandOpen, mMenuRequest); |
187 } |
189 } |
188 |
190 |
189 /*! |
191 /*! |
190 Public slot connected to delete message. Method asks UI engine to delete messages |
192 Public slot connected to delete message. Method asks UI engine to delete messages |
191 */ |
193 */ |
192 void NmBaseClientPlugin::deleteMessage() |
194 void NmBaseClientPlugin::deleteMessage() |
193 { |
195 { |
194 NMLOG("NmBaseClientPlugin::deleteMessage()-->"); |
196 NM_FUNCTION; |
195 |
197 |
196 QList<NmId> messageList; |
198 QList<NmId> messageList; |
197 messageList.append(mMenuRequest.messageId()); |
199 messageList.append(mMenuRequest.messageId()); |
198 |
200 |
199 int err = mUiEngine->deleteMessages(mMenuRequest.mailboxId(), |
201 int err = mUiEngine->deleteMessages(mMenuRequest.mailboxId(), |
200 mMenuRequest.folderId(), |
202 mMenuRequest.folderId(), |
201 messageList); |
203 messageList); |
202 if (NmNoError != err) { |
204 if (NmNoError != err) { |
203 // Failed to delete the messages! |
205 // Failed to delete the messages! |
204 NMLOG(QString("NmBaseClientPlugin::deleteMessage(): failed err=%1").arg(err)); |
206 NM_ERROR(1,QString("NmBaseClientPlugin::deleteMessage(): failed err=%1").arg(err)); |
205 } |
207 } |
206 messageList.clear(); |
208 messageList.clear(); |
207 NMLOG("<--NmBaseClientPlugin::deleteMessage()"); |
|
208 } |
209 } |
209 |
210 |
210 /*! |
211 /*! |
211 Public slot connected to triggered() signal of delete action instance. |
212 Public slot connected to triggered() signal of delete action instance. |
212 The method sends a delete mail command to the action observer. |
213 The method sends a delete mail command to the action observer. |
213 */ |
214 */ |
214 void NmBaseClientPlugin::deleteMessageFromViewerView() |
215 void NmBaseClientPlugin::deleteMessageFromViewerView() |
215 { |
216 { |
|
217 NM_FUNCTION; |
|
218 |
216 handleRequest(NmActionResponseCommandDeleteMail, mViewerViewRequest); |
219 handleRequest(NmActionResponseCommandDeleteMail, mViewerViewRequest); |
217 } |
220 } |
218 |
221 |
219 /*! |
222 /*! |
220 Public slot connected to triggered() signal of create mail action instance. |
223 Public slot connected to triggered() signal of create mail action instance. |
221 The method sends a new mail command to the action observer. |
224 The method sends a new mail command to the action observer. |
222 */ |
225 */ |
223 void NmBaseClientPlugin::createNewMailViewerToolBar() |
226 void NmBaseClientPlugin::createNewMailViewerToolBar() |
224 { |
227 { |
|
228 NM_FUNCTION; |
|
229 |
225 handleRequest(NmActionResponseCommandNewMail, mViewerToolBarRequest); |
230 handleRequest(NmActionResponseCommandNewMail, mViewerToolBarRequest); |
226 } |
231 } |
227 |
232 |
228 /*! |
233 /*! |
229 Public slot for handling the event of menu request for creating a new email. |
234 Public slot for handling the event of menu request for creating a new email. |
230 The method sends a new mail command to the action observer of the menu request. |
235 The method sends a new mail command to the action observer of the menu request. |
231 */ |
236 */ |
232 void NmBaseClientPlugin::createNewMail() |
237 void NmBaseClientPlugin::createNewMail() |
233 { |
238 { |
|
239 NM_FUNCTION; |
|
240 |
234 handleRequest(NmActionResponseCommandNewMail, mMenuRequest); |
241 handleRequest(NmActionResponseCommandNewMail, mMenuRequest); |
235 } |
242 } |
236 |
243 |
237 /*! |
244 /*! |
238 Public slot connected to options menu settings NmAction. |
245 Public slot connected to options menu settings NmAction. |
239 Opens mailbox settings. |
246 Opens mailbox settings. |
240 */ |
247 */ |
241 void NmBaseClientPlugin::settings() |
248 void NmBaseClientPlugin::settings() |
242 { |
249 { |
|
250 NM_FUNCTION; |
|
251 |
243 handleRequest(NmActionResponseCommandSettings, mMenuRequest); |
252 handleRequest(NmActionResponseCommandSettings, mMenuRequest); |
244 } |
253 } |
245 |
254 |
246 /*! |
255 /*! |
247 Public slot connected to triggered() signal of send mail action instance. |
256 Public slot connected to triggered() signal of send mail action instance. |
248 Sends the send mail command to the action observer. |
257 Sends the send mail command to the action observer. |
249 */ |
258 */ |
250 void NmBaseClientPlugin::sendMail() |
259 void NmBaseClientPlugin::sendMail() |
251 { |
260 { |
|
261 NM_FUNCTION; |
|
262 |
252 handleRequest(NmActionResponseCommandSendMail, mEditorToolBarRequest); |
263 handleRequest(NmActionResponseCommandSendMail, mEditorToolBarRequest); |
253 } |
264 } |
254 |
265 |
255 /*! |
266 /*! |
256 Public slot connected to triggered() signal of reply action instance of the |
267 Public slot connected to triggered() signal of reply action instance of the |
257 toolbar. Sends a reply mail command to the action observer. |
268 toolbar. Sends a reply mail command to the action observer. |
258 */ |
269 */ |
259 |
270 |
260 void NmBaseClientPlugin::replyMail() |
271 void NmBaseClientPlugin::replyMail() |
261 { |
272 { |
|
273 NM_FUNCTION; |
|
274 |
262 handleRequest(NmActionResponseCommandReply, mViewerViewRequest); |
275 handleRequest(NmActionResponseCommandReply, mViewerViewRequest); |
263 } |
276 } |
264 |
277 |
265 /*! |
278 /*! |
266 Public slot connected to triggered signal of reply all action instance of |
279 Public slot connected to triggered signal of reply all action instance of |
267 the toolbar. Sends a reply all mail command to the action observer. |
280 the toolbar. Sends a reply all mail command to the action observer. |
268 */ |
281 */ |
269 |
282 |
270 void NmBaseClientPlugin::replyAllMail() |
283 void NmBaseClientPlugin::replyAllMail() |
271 { |
284 { |
|
285 NM_FUNCTION; |
|
286 |
272 handleRequest(NmActionResponseCommandReplyAll, mViewerViewRequest); |
287 handleRequest(NmActionResponseCommandReplyAll, mViewerViewRequest); |
273 } |
288 } |
274 |
289 |
275 /*! |
290 /*! |
276 Public slot connected to triggered() signal of forward action instance of |
291 Public slot connected to triggered() signal of forward action instance of |
277 the toolbar. Sends a forward mail command to the action observer. |
292 the toolbar. Sends a forward mail command to the action observer. |
278 */ |
293 */ |
279 void NmBaseClientPlugin::forwardMail() |
294 void NmBaseClientPlugin::forwardMail() |
280 { |
295 { |
|
296 NM_FUNCTION; |
|
297 |
281 handleRequest(NmActionResponseCommandForward, mViewerViewRequest); |
298 handleRequest(NmActionResponseCommandForward, mViewerViewRequest); |
282 } |
299 } |
283 |
300 |
284 /*! |
301 /*! |
285 Public slot connected to set high priority toolbar action. |
302 Public slot connected to set high priority toolbar action. |
286 */ |
303 */ |
287 void NmBaseClientPlugin::setPriorityHigh() |
304 void NmBaseClientPlugin::setPriorityHigh() |
288 { |
305 { |
|
306 NM_FUNCTION; |
|
307 |
289 handleRequest(NmActionResponseCommandPriorityHigh, mMenuRequest); |
308 handleRequest(NmActionResponseCommandPriorityHigh, mMenuRequest); |
290 } |
309 } |
291 |
310 |
292 /*! |
311 /*! |
293 Public slot connected to set normal priority toolbar action. |
312 Public slot connected to set normal priority toolbar action. |
294 */ |
313 */ |
295 void NmBaseClientPlugin::setPriorityNormal() |
314 void NmBaseClientPlugin::setPriorityNormal() |
296 { |
315 { |
|
316 NM_FUNCTION; |
|
317 |
297 handleRequest(NmActionResponseCommandNone, mMenuRequest); |
318 handleRequest(NmActionResponseCommandNone, mMenuRequest); |
298 } |
319 } |
299 |
320 |
300 /*! |
321 /*! |
301 Public slot connected to set low priority toolbar action. |
322 Public slot connected to set low priority toolbar action. |
302 */ |
323 */ |
303 void NmBaseClientPlugin::setPriorityLow() |
324 void NmBaseClientPlugin::setPriorityLow() |
304 { |
325 { |
|
326 NM_FUNCTION; |
|
327 |
305 handleRequest(NmActionResponseCommandPriorityLow, mMenuRequest); |
328 handleRequest(NmActionResponseCommandPriorityLow, mMenuRequest); |
306 } |
329 } |
307 |
330 |
308 /*! |
331 /*! |
309 Public slot connected to attach toolbar action. |
332 Public slot connected to attach toolbar action. |
310 */ |
333 */ |
311 void NmBaseClientPlugin::attach() |
334 void NmBaseClientPlugin::attach() |
312 { |
335 { |
|
336 NM_FUNCTION; |
|
337 |
313 handleRequest(NmActionResponseCommandAttach, mEditorToolBarRequest); |
338 handleRequest(NmActionResponseCommandAttach, mEditorToolBarRequest); |
314 } |
339 } |
315 |
340 |
316 /*! |
341 /*! |
317 Public slot connected to remove attachment context menu action |
342 Public slot connected to remove attachment context menu action |
318 */ |
343 */ |
319 void NmBaseClientPlugin::removeAttachment() |
344 void NmBaseClientPlugin::removeAttachment() |
320 { |
345 { |
|
346 NM_FUNCTION; |
|
347 |
321 handleRequest(NmActionResponseCommandRemoveAttachment, mMenuRequest); |
348 handleRequest(NmActionResponseCommandRemoveAttachment, mMenuRequest); |
322 } |
349 } |
323 |
350 |
324 /*! |
351 /*! |
325 Public slot connected to open attachment context menu action |
352 Public slot connected to open attachment context menu action |
326 */ |
353 */ |
327 void NmBaseClientPlugin::openAttachment() |
354 void NmBaseClientPlugin::openAttachment() |
328 { |
355 { |
|
356 NM_FUNCTION; |
|
357 |
329 handleRequest(NmActionResponseCommandOpenAttachment, mMenuRequest); |
358 handleRequest(NmActionResponseCommandOpenAttachment, mMenuRequest); |
330 } |
359 } |
331 |
360 |
332 /*! |
361 /*! |
333 Requests the handling of the search action. |
362 Requests the handling of the search action. |
334 This public slot gets called when the search button in a toolbar is clicked. |
363 This public slot gets called when the search button in a toolbar is clicked. |
335 */ |
364 */ |
336 void NmBaseClientPlugin::search() |
365 void NmBaseClientPlugin::search() |
337 { |
366 { |
|
367 NM_FUNCTION; |
|
368 |
338 handleRequest(NmActionResponseCommandSearch, mViewerToolBarRequest); |
369 handleRequest(NmActionResponseCommandSearch, mViewerToolBarRequest); |
339 } |
370 } |
340 |
371 |
341 /*! |
372 /*! |
342 Private slot connected to settings view launcher. |
373 Private slot connected to settings view launcher. |