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> |
27 #include "msgbaseview.h" |
28 #include "msgbaseview.h" |
28 #include "convergedmessage.h" |
29 #include "convergedmessage.h" |
29 #include "convergedmessageid.h" |
30 #include "convergedmessageid.h" |
|
31 |
|
32 QTM_BEGIN_NAMESPACE |
|
33 QTM_END_NAMESPACE |
|
34 QTM_USE_NAMESPACE |
30 |
35 |
31 class HbWidget; |
36 class HbWidget; |
32 class HbAction; |
37 class HbAction; |
33 class HbGroupBox; |
38 class HbGroupBox; |
34 class QGraphicsLinearLayout; |
39 class QGraphicsLinearLayout; |
35 class MsgUnifiedEditorSubject; |
40 class MsgUnifiedEditorSubject; |
36 class MsgUnifiedEditorAddress; |
41 class MsgUnifiedEditorAddress; |
37 class MsgUnifiedEditorBody; |
42 class MsgUnifiedEditorBody; |
38 class MsgTypeNotifier; |
|
39 class MsgMonitor; |
43 class MsgMonitor; |
40 class MsgUiUtilsManager; |
|
41 class MsgAttachmentContainer; |
44 class MsgAttachmentContainer; |
42 class UniEditorPluginLoader; |
45 class UniEditorPluginLoader; |
|
46 class HbListWidgetItem; |
43 |
47 |
44 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView |
48 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView |
45 { |
49 { |
46 Q_OBJECT |
50 Q_OBJECT |
47 |
51 |
57 */ |
61 */ |
58 ~MsgUnifiedEditorView(); |
62 ~MsgUnifiedEditorView(); |
59 |
63 |
60 /** |
64 /** |
61 * Populate editor with passed information |
65 * Populate editor with passed information |
62 */ |
66 * @param editorData data for editor's usage |
63 void populateContent(const ConvergedMessage& messageDetails, |
67 */ |
64 int editorFields = 0); |
68 void populateContent(const QVariantList& editorData); |
65 |
69 |
66 /** |
70 /** |
67 * Opens the drafts message into editor |
71 * Opens the drafts message into editor |
68 */ |
72 * @param editorData data for editor's usage |
69 void openDraftsMessage(ConvergedMessageId& messageId, |
73 */ |
|
74 void openDraftsMessage(const QVariantList& editorData); |
|
75 |
|
76 |
|
77 /** |
|
78 * Saves the content inside editor to save |
|
79 */ |
|
80 void saveContentToDrafts(); |
|
81 |
|
82 protected: |
|
83 /** |
|
84 * reimplemented from base class to provide proper geometry for scrolling. |
|
85 */ |
|
86 void resizeEvent( QGraphicsSceneResizeEvent * event ); |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * helper method to add menu. |
|
92 */ |
|
93 void addMenu(); |
|
94 |
|
95 /** |
|
96 * helper method to add tool bar. |
|
97 */ |
|
98 void addToolBar(); |
|
99 |
|
100 /** |
|
101 * helper method to get style plugin path. |
|
102 */ |
|
103 QString pluginPath(); |
|
104 |
|
105 /** |
|
106 * Packs the content inside editor into converged message |
|
107 */ |
|
108 void packMessage(ConvergedMessage &msg); |
|
109 |
|
110 /** |
|
111 * Populate editor with prepopulated msg content |
|
112 */ |
|
113 void populateContentIntoEditor( |
|
114 const ConvergedMessage& messageDetails); |
|
115 |
|
116 /** |
|
117 * Populate the editor with the forwarded message's content |
|
118 */ |
|
119 void forwardMessage(ConvergedMessageId& messageId, |
70 ConvergedMessage::MessageType messageType ); |
120 ConvergedMessage::MessageType messageType ); |
71 |
121 |
72 |
122 /** |
73 /** |
123 * Create VCards for all the contacts available in the list |
74 * Saves the content inside editor to save |
124 * @param value list of fetched contacts |
75 */ |
125 * @param [OUT]filelist list of newly added vcard files |
76 bool saveContentToDrafts(); |
126 * @return errId KErrNone if no error |
77 |
127 */ |
78 protected: |
128 int createVCards(const QVariant& value, QStringList& filelist); |
79 /** |
129 |
80 * reimplemented from base class to provide proper geometry for scrolling. |
130 /** |
81 */ |
131 * Resolve name conflict when adding attachments to editor |
82 void resizeEvent( QGraphicsSceneResizeEvent * event ); |
132 * @param suggestedName suggested file name to use |
83 |
133 * @return fully qualified path of the file in unieditor's temp folder |
84 private: |
134 */ |
85 |
135 QString generateFileName(QString& suggestedName); |
86 /** |
136 |
87 * helper method to add menu. |
137 /** |
88 */ |
138 * Fetch images |
89 void addMenu(); |
139 */ |
90 |
140 void fetchImages(); |
91 /** |
141 |
92 * helper method to add tool bar. |
142 /** |
93 */ |
143 * Fectch conatcts |
94 void addToolBar(); |
144 */ |
95 |
145 void fetchContacts(); |
96 /** |
146 |
97 * helper method to get style plugin path. |
147 /** |
98 */ |
148 * Fectch audio |
99 QString pluginPath(); |
149 */ |
100 |
150 void fetchAudio(); |
101 /** |
|
102 * Packs the content inside editor into converged message |
|
103 */ |
|
104 void packMessage(ConvergedMessage &msg); |
|
105 |
|
106 /** |
|
107 * Populate editor with Drafts msg content |
|
108 */ |
|
109 void populateDraftsContent( |
|
110 const ConvergedMessage& messageDetails); |
|
111 |
151 |
112 private slots: |
152 private slots: |
113 |
153 |
114 /** |
154 /** |
115 * slot to add subject field. |
155 * slot to add subject field. |
140 * slot to current delete message. |
180 * slot to current delete message. |
141 */ |
181 */ |
142 void deleteMessage(); |
182 void deleteMessage(); |
143 |
183 |
144 /** |
184 /** |
145 * slot to launch help. |
|
146 */ |
|
147 void launchHelp(); |
|
148 |
|
149 /** |
|
150 * slot to show attachment popup. |
|
151 */ |
|
152 void showAttachmentPopup(); |
|
153 |
|
154 /** |
|
155 * slot to images fetched. |
185 * slot to images fetched. |
156 */ |
186 */ |
157 void imagesFetched(const QVariant& result ); |
187 void imagesFetched(const QVariant& result ); |
158 |
188 |
159 /** |
189 /** |
160 * slot to fetch audio files |
190 * slot to fetch audio files |
161 */ |
191 */ |
162 void audiosFetched(const QVariant& result ); |
192 void audiosFetched(const QVariant& result ); |
|
193 |
|
194 /** |
|
195 * slot to receive fetched contacts |
|
196 */ |
|
197 void contactsFetched(const QVariant& value); |
163 |
198 |
164 /** |
199 /** |
165 * slot to send message. |
200 * slot to send message. |
166 */ |
201 */ |
167 void send(); |
202 void send(); |
168 |
203 |
169 /** |
204 /** |
170 * slot to tell view to remove the attachment's container |
205 * slot to tell view to remove the attachment's container |
171 */ |
206 */ |
172 void removeAttachmentContainer(); |
207 void removeAttachmentContainer(); |
173 |
208 |
174 /** |
209 /** |
175 * add an attachment to editor |
210 * add attachments to the editor |
176 */ |
211 * @param files list of file paths |
177 void addAttachment(const QString& filepath); |
212 */ |
|
213 void addAttachments(QStringList files); |
|
214 |
|
215 /** |
|
216 * add an attachment to the editor |
|
217 * @return addition operation status |
|
218 */ |
|
219 int addAttachment(const QString& filepath); |
|
220 |
|
221 /** |
|
222 * called when extention item is clicked. |
|
223 */ |
|
224 void handleViewExtnActivated(HbListWidgetItem* item); |
|
225 |
|
226 /** |
|
227 * Signal emitted when an error is generated. |
|
228 * @param errorCode Error code. |
|
229 * @param errorMessage Error description. |
|
230 */ |
|
231 void serviceRequestError(int errorCode, const QString& errorMessage); |
|
232 |
|
233 /** |
|
234 * Activate Input Blocker |
|
235 */ |
|
236 void activateInputBlocker(); |
|
237 |
|
238 /** |
|
239 * Deactivate Input Blocker |
|
240 */ |
|
241 void deactivateInputBlocker(); |
178 |
242 |
179 private: |
243 private: |
180 HbAction* mSubjectAction; |
244 HbAction* mSubjectAction; |
181 HbAction* mCcBccAction; |
245 HbAction* mCcBccAction; |
182 QGraphicsLinearLayout* mMainLayout; |
246 QGraphicsLinearLayout* mMainLayout; |
184 MsgUnifiedEditorAddress* mToField; |
248 MsgUnifiedEditorAddress* mToField; |
185 MsgUnifiedEditorAddress* mCcField; |
249 MsgUnifiedEditorAddress* mCcField; |
186 MsgUnifiedEditorAddress* mBccField; |
250 MsgUnifiedEditorAddress* mBccField; |
187 MsgUnifiedEditorBody* mBody; |
251 MsgUnifiedEditorBody* mBody; |
188 |
252 |
189 HbMenu *mPrioritySubMenu; |
|
190 HbWidget* mContentWidget; |
253 HbWidget* mContentWidget; |
191 QString mPluginPath; |
254 QString mPluginPath; |
192 |
255 |
193 MsgTypeNotifier* mNotifier; |
|
194 MsgMonitor* mMsgMonitor; |
256 MsgMonitor* mMsgMonitor; |
195 MsgUiUtilsManager* mUtilsManager; |
|
196 MsgAttachmentContainer* mAttachmentContainer; |
257 MsgAttachmentContainer* mAttachmentContainer; |
197 UniEditorPluginLoader* mPluginLoader; |
258 UniEditorPluginLoader* mPluginLoader; |
198 ConvergedMessageId mOpenedMessageId; |
259 ConvergedMessageId mOpenedMessageId; |
199 ConvergedMessage::MessageType mmOpenedMessageType; |
260 ConvergedMessage::MessageType mmOpenedMessageType; |
|
261 bool mCanSaveToDrafts; |
|
262 friend class MsgMonitor; |
200 }; |
263 }; |
201 |
264 |
202 #endif //UNIFIED_EDITOR_VIEW_H |
265 #endif //UNIFIED_EDITOR_VIEW_H |