13 * |
13 * |
14 * Description:uni editor view class. |
14 * Description:uni editor view class. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #ifndef UNIFIED_EDITOR_VIEW_H |
18 #ifndef MSG_UNIFIED_EDITOR_VIEW_H |
19 #define UNIFIED_EDITOR_VIEW_H |
19 #define MSG_UNIFIED_EDITOR_VIEW_H |
20 |
20 |
21 #ifdef UNIFIEDEDITOR_DLL |
21 #ifdef UNIFIEDEDITOR_DLL |
22 #define UNIFIEDEDITOR_EXPORT Q_DECL_EXPORT |
22 #define UNIFIEDEDITOR_EXPORT Q_DECL_EXPORT |
23 #else |
23 #else |
24 #define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT |
24 #define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT |
25 #endif |
25 #endif |
26 |
26 |
27 #include <qmobilityglobal.h> |
|
28 #include "msgbaseview.h" |
27 #include "msgbaseview.h" |
29 #include "convergedmessage.h" |
28 #include "convergedmessage.h" |
30 #include "convergedmessageid.h" |
29 #include "convergedmessageid.h" |
31 |
|
32 QTM_BEGIN_NAMESPACE |
|
33 QTM_END_NAMESPACE |
|
34 QTM_USE_NAMESPACE |
|
35 |
30 |
36 class HbWidget; |
31 class HbWidget; |
37 class HbAction; |
32 class HbAction; |
38 class HbGroupBox; |
33 class HbGroupBox; |
39 class QGraphicsLinearLayout; |
34 class QGraphicsLinearLayout; |
40 class MsgUnifiedEditorSubject; |
35 class MsgUnifiedEditorSubject; |
41 class MsgUnifiedEditorAddress; |
36 class MsgUnifiedEditorAddress; |
42 class MsgUnifiedEditorBody; |
37 class MsgUnifiedEditorBody; |
43 class MsgMonitor; |
38 class MsgUnifiedEditorMonitor; |
44 class MsgAttachmentContainer; |
39 class MsgAttachmentContainer; |
45 class UniEditorPluginLoader; |
40 class UniEditorPluginLoader; |
46 class HbListWidgetItem; |
41 class HbListWidgetItem; |
|
42 class HbAbstractVkbHost; |
|
43 class MsgUnifiedEditorBaseWidget; |
|
44 class HbListWidget; |
47 |
45 |
48 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView |
46 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView |
49 { |
47 { |
50 Q_OBJECT |
48 Q_OBJECT |
51 |
49 |
96 * helper method to add tool bar. |
94 * helper method to add tool bar. |
97 */ |
95 */ |
98 void addToolBar(); |
96 void addToolBar(); |
99 |
97 |
100 /** |
98 /** |
101 * helper method to get style plugin path. |
|
102 */ |
|
103 QString pluginPath(); |
|
104 |
|
105 /** |
|
106 * Packs the content inside editor into converged message |
99 * Packs the content inside editor into converged message |
107 */ |
100 * @param [OUT]msg, converged message to hold editor data |
108 void packMessage(ConvergedMessage &msg); |
101 * @param isSave, flag to indicate that msg needs to be packed |
|
102 * for saving to draft or not |
|
103 */ |
|
104 void packMessage(ConvergedMessage &msg, bool isSave=false); |
109 |
105 |
110 /** |
106 /** |
111 * Populate editor with prepopulated msg content |
107 * Populate editor with prepopulated msg content |
|
108 * @param messageDetails message details |
|
109 * @param draftMessage boolean for specifying draft message |
112 */ |
110 */ |
113 void populateContentIntoEditor( |
111 void populateContentIntoEditor( |
114 const ConvergedMessage& messageDetails); |
112 const ConvergedMessage& messageDetails, bool draftMessage = false); |
115 |
113 |
116 /** |
114 /** |
117 * Populate the editor with the forwarded message's content |
115 * Populate the editor with the forwarded message's content |
118 */ |
116 */ |
119 void forwardMessage(ConvergedMessageId& messageId, |
117 void forwardMessage(ConvergedMessageId& messageId, |
138 * Fetch images |
136 * Fetch images |
139 */ |
137 */ |
140 void fetchImages(); |
138 void fetchImages(); |
141 |
139 |
142 /** |
140 /** |
143 * Fectch conatcts |
141 * Fetch contacts |
144 */ |
142 */ |
145 void fetchContacts(); |
143 void fetchContacts(); |
146 |
144 |
147 /** |
145 /** |
148 * Fectch audio |
146 * Fetch audio |
149 */ |
147 */ |
150 void fetchAudio(); |
148 void fetchAudio(); |
151 |
149 |
|
150 /** |
|
151 * To hide/show chrome. |
|
152 */ |
|
153 void hideChrome(bool hide); |
|
154 |
|
155 /** |
|
156 * To initialize view. |
|
157 */ |
|
158 void initView(); |
|
159 |
|
160 /** |
|
161 * Creates temp folder for editor. |
|
162 */ |
|
163 bool createTempFolder(); |
|
164 |
|
165 /** |
|
166 * Removes editors temp folder. |
|
167 */ |
|
168 void removeTempFolder(); |
|
169 |
|
170 /** |
|
171 * Attachment options in TBE |
|
172 * Row number of the TBE actions |
|
173 */ |
|
174 enum TBE_AttachOption |
|
175 { |
|
176 TBE_PHOTO = 0x00, TBE_SOUND = 0x01, TBE_VCARD = 0x02 |
|
177 }; |
|
178 |
|
179 /** |
|
180 * Enable/Disable attachment options for slide-conformance |
|
181 * @param opt, row number of action in TBE |
|
182 * @param isEnabled, true/false |
|
183 */ |
|
184 void setAttachOptionEnabled(MsgUnifiedEditorView::TBE_AttachOption opt, |
|
185 bool enable); |
|
186 |
152 private slots: |
187 private slots: |
153 |
188 |
154 /** |
189 /** |
155 * slot to add subject field. |
190 * slot to add subject field. |
156 */ |
191 */ |
170 * slot to change priority. |
205 * slot to change priority. |
171 */ |
206 */ |
172 void changePriority(); |
207 void changePriority(); |
173 |
208 |
174 /** |
209 /** |
175 * slot for different sending options. |
|
176 */ |
|
177 void sendingOptions(); |
|
178 |
|
179 /** |
|
180 * slot to current delete message. |
210 * slot to current delete message. |
181 */ |
211 */ |
182 void deleteMessage(); |
212 void deleteMessage(); |
183 |
213 |
184 /** |
214 /** |
185 * slot to images fetched. |
215 * slot to images fetched. |
186 */ |
216 */ |
187 void imagesFetched(const QVariant& result ); |
217 void imagesFetched(const QVariant& result ); |
188 |
218 |
189 /** |
|
190 * slot to fetch audio files |
|
191 */ |
|
192 void audiosFetched(const QVariant& result ); |
|
193 |
|
194 /** |
219 /** |
195 * slot to receive fetched contacts |
220 * slot to receive fetched contacts |
196 */ |
221 */ |
197 void contactsFetched(const QVariant& value); |
222 void contactsFetched(const QVariant& value); |
198 |
223 |
237 |
262 |
238 /** |
263 /** |
239 * Deactivate Input Blocker |
264 * Deactivate Input Blocker |
240 */ |
265 */ |
241 void deactivateInputBlocker(); |
266 void deactivateInputBlocker(); |
242 |
267 |
|
268 /** |
|
269 * Resizes the view when VKB is opened. |
|
270 * This slot is triggered when vkb is opened. |
|
271 */ |
|
272 void vkbOpened(); |
|
273 |
|
274 /** |
|
275 * Resizes the view when VKB is closed. |
|
276 * This slot is triggered when VKB focus is lost. |
|
277 */ |
|
278 void vkbClosed(); |
|
279 |
|
280 /** |
|
281 * Slot to do delayed construction. |
|
282 */ |
|
283 void doDelayedConstruction(); |
|
284 |
|
285 /** |
|
286 * Sets focus to item. |
|
287 */ |
|
288 void setFocus(MsgUnifiedEditorBaseWidget* item); |
|
289 |
|
290 /** |
|
291 * Listens to contentChanged signal of various fields. |
|
292 */ |
|
293 void onContentChanged(); |
|
294 |
|
295 /** |
|
296 * This slot is called when delete message dialog is launched. |
|
297 * @param action selected action (yes or no). |
|
298 */ |
|
299 void onDialogDeleteMsg(HbAction* action); |
|
300 |
|
301 /** |
|
302 * This slot is called when define sms settings dialog is launched. |
|
303 * @param action selected action (yes or no). |
|
304 */ |
|
305 void onDialogSmsSettings(HbAction* action); |
|
306 |
|
307 /** |
|
308 * This slot is called when define mms settings dialog is launched. |
|
309 * @param action selected action (yes or no). |
|
310 */ |
|
311 void onDialogMmsSettings(HbAction* action); |
|
312 |
|
313 /** |
|
314 * Enable/Disable send tool button. |
|
315 * @param true/false to enable/disable. |
|
316 */ |
|
317 void enableSendButton(bool enable); |
|
318 |
243 private: |
319 private: |
244 HbAction* mSubjectAction; |
320 HbAction* mSubjectAction; |
245 HbAction* mCcBccAction; |
321 HbAction* mCcBccAction; |
|
322 HbAction* mSendAction; |
246 QGraphicsLinearLayout* mMainLayout; |
323 QGraphicsLinearLayout* mMainLayout; |
247 MsgUnifiedEditorSubject* mSubjectField; |
324 MsgUnifiedEditorSubject* mSubjectField; |
248 MsgUnifiedEditorAddress* mToField; |
325 MsgUnifiedEditorAddress* mToField; |
249 MsgUnifiedEditorAddress* mCcField; |
326 MsgUnifiedEditorAddress* mCcField; |
250 MsgUnifiedEditorAddress* mBccField; |
327 MsgUnifiedEditorAddress* mBccField; |
251 MsgUnifiedEditorBody* mBody; |
328 MsgUnifiedEditorBody* mBody; |
252 |
329 |
253 HbWidget* mContentWidget; |
330 HbWidget* mContentWidget; |
254 QString mPluginPath; |
331 |
255 |
332 MsgUnifiedEditorMonitor* mMsgMonitor; |
256 MsgMonitor* mMsgMonitor; |
|
257 MsgAttachmentContainer* mAttachmentContainer; |
333 MsgAttachmentContainer* mAttachmentContainer; |
258 UniEditorPluginLoader* mPluginLoader; |
334 UniEditorPluginLoader* mPluginLoader; |
259 ConvergedMessageId mOpenedMessageId; |
335 ConvergedMessageId mOpenedMessageId; |
260 ConvergedMessage::MessageType mmOpenedMessageType; |
336 ConvergedMessage::MessageType mmOpenedMessageType; |
261 bool mCanSaveToDrafts; |
337 bool mCanSaveToDrafts; |
262 friend class MsgMonitor; |
338 |
|
339 /** |
|
340 * TBE's content widget |
|
341 */ |
|
342 HbListWidget* mTBExtnContentWidget; |
|
343 |
|
344 /** |
|
345 * Instance of VKB host |
|
346 */ |
|
347 HbAbstractVkbHost* mVkbHost; |
|
348 |
|
349 friend class MsgUnifiedEditorMonitor; |
263 }; |
350 }; |
264 |
351 |
265 #endif //UNIFIED_EDITOR_VIEW_H |
352 #endif //MSG_UNIFIED_EDITOR_VIEW_H |