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: MMS data model plugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef UNIMMSDATAPLUGIN_P_H_ |
|
19 #define UNIMMSDATAPLUGIN_P_H_ |
|
20 |
|
21 //SYSTEM INCLUDE |
|
22 #include <f32file.h> //for FileSession RFs |
|
23 #include <msvapi.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 #include "unidatamodelplugininterface.h" |
|
27 #include "UniDataModel.h" |
|
28 |
|
29 //Forward Declaration |
|
30 class CMmsClientMtm; |
|
31 class CUniDataModel; |
|
32 class CMsvSession; |
|
33 class CClientMtmRegistry; |
|
34 class CMsgMediaInfo; |
|
35 class CMDXMLDocument; |
|
36 class CDRMHelper; |
|
37 class MMediaInfoObserver; |
|
38 class SessionEventHandler; |
|
39 |
|
40 /** |
|
41 * Symbian specific implementation of the uni SMS plugin |
|
42 */ |
|
43 class UniMMSDataPluginPrivate : public MUniDataModelObserver, |
|
44 public MUniObjectSaveObserver, |
|
45 public MUniSmilComposeObserver, |
|
46 public MMediaInfoObserver |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Constructor |
|
51 */ |
|
52 UniMMSDataPluginPrivate(); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 ~UniMMSDataPluginPrivate(); |
|
58 |
|
59 /** |
|
60 * Sets the id of the message whose details needs to be extacted. |
|
61 * @param TMsvId of the message. |
|
62 */ |
|
63 int setMessageId(int messageId); |
|
64 |
|
65 /** Reset the datamodel |
|
66 * Resets the data model to be used again |
|
67 */ |
|
68 void reset(); |
|
69 |
|
70 /** |
|
71 * Get the body of the message |
|
72 * @param aBodyText , a QString to hold the message body |
|
73 */ |
|
74 void body(QString& aBodyText); |
|
75 |
|
76 /** |
|
77 * Size of the message |
|
78 * @return message size |
|
79 */ |
|
80 int messageSize(); |
|
81 |
|
82 /** |
|
83 * List of the message To recipients |
|
84 * @param mAddressList, list of all addresses in the message |
|
85 */ |
|
86 void toRecipientList(ConvergedMessageAddressList& mAddressList); |
|
87 |
|
88 /** |
|
89 * List of the message CC recipients |
|
90 * @param mAddressList, list of all addresses in the message |
|
91 */ |
|
92 void ccRecipientList(ConvergedMessageAddressList& mAddressList); |
|
93 |
|
94 /** |
|
95 * List of the message bCC recipients |
|
96 * @param mAddressList, list of all addresses in the message |
|
97 */ |
|
98 void bccRecipientList(ConvergedMessageAddressList& mAddressList); |
|
99 |
|
100 /** |
|
101 * The from address of a message |
|
102 * @param messageAddress |
|
103 */ |
|
104 void fromAddress(QString& messageAddress); |
|
105 |
|
106 /** |
|
107 * List of attachments in the message. |
|
108 * @return the attachment list for the message. |
|
109 */ |
|
110 UniMessageInfoList attachmentList(); |
|
111 |
|
112 /** |
|
113 * Type of the message (SMS/MMS etc..) |
|
114 * @return message type |
|
115 */ |
|
116 QString messageType(); |
|
117 |
|
118 /** |
|
119 * Priority of the message (low/medium/high) |
|
120 * @return MsgPriority. |
|
121 */ |
|
122 MsgPriority messagePriority(); |
|
123 |
|
124 /** |
|
125 * Number of attachments with the message |
|
126 * @return count of attachment |
|
127 */ |
|
128 int attachmentCount(); |
|
129 |
|
130 /** |
|
131 * To check if the message has attachments |
|
132 * @return true/false |
|
133 */ |
|
134 bool hasAttachment(); |
|
135 |
|
136 /** |
|
137 * Number of objects asociated with a MMS message |
|
138 * @return object count |
|
139 */ |
|
140 int objectCount(); |
|
141 |
|
142 /** |
|
143 * The MMS object list asociated with a MMS message |
|
144 * @return object list |
|
145 */ |
|
146 UniMessageInfoList objectList(); |
|
147 |
|
148 /** |
|
149 * Number of slides asociated with a MMS message |
|
150 * @return slide count |
|
151 */ |
|
152 int slideCount(); |
|
153 |
|
154 /** |
|
155 * The content of a Slide in case of a MMS message |
|
156 * @param list of messageinfo objects. |
|
157 */ |
|
158 UniMessageInfoList slideContent(TInt slidenum); |
|
159 |
|
160 /** |
|
161 * Time stamp of the message when it was created/recieved. |
|
162 * @param mesage time |
|
163 */ |
|
164 int timeStamp(); |
|
165 |
|
166 /** |
|
167 * Add object into smil |
|
168 * @param slide number |
|
169 * @param UniMessageInfo |
|
170 */ |
|
171 void addObjectL( int aslideNum,UniMessageInfo* aInfo ); |
|
172 |
|
173 /** |
|
174 * Add text object into smil |
|
175 * @param slide number |
|
176 * @param text |
|
177 */ |
|
178 void addTextObjectL(int aSlideNum,QString aText ); |
|
179 |
|
180 /** |
|
181 * Add slide into smil model |
|
182 * @param slide number |
|
183 */ |
|
184 void addSlideL( int aSlideNum ); |
|
185 |
|
186 /** |
|
187 * Compose smil attachment |
|
188 * @param CMsvStore |
|
189 */ |
|
190 void composeSmilL(CMsvStore& aEditStore); |
|
191 |
|
192 /** |
|
193 * Save objects inside model |
|
194 */ |
|
195 void saveObjects(); |
|
196 |
|
197 /** |
|
198 * get the smil attachment index |
|
199 * @return TMsvAttachmentId |
|
200 */ |
|
201 TMsvAttachmentId getSmilAttachmentByIndex(); |
|
202 |
|
203 /** |
|
204 * Restore the model for editing only |
|
205 * @param CBaseMtm |
|
206 */ |
|
207 void restoreL(CBaseMtm& mtm); |
|
208 |
|
209 /** |
|
210 * Add attachment |
|
211 * @param UniMessageInfo |
|
212 */ |
|
213 void addAttachmentL( UniMessageInfo* aInfo ); |
|
214 |
|
215 /** |
|
216 * Remove slide from smil model |
|
217 * @param slide number |
|
218 */ |
|
219 void removeSlide(int aSlideNumber); |
|
220 |
|
221 /** |
|
222 * Subject of the message |
|
223 * @QString subject |
|
224 */ |
|
225 QString subject(); |
|
226 |
|
227 /** |
|
228 * Session with the Messaging server |
|
229 * @return CMsvSession* |
|
230 */ |
|
231 CMsvSession* session(); |
|
232 |
|
233 public: |
|
234 |
|
235 /** |
|
236 * @see MUniObjectSaveObserver |
|
237 */ |
|
238 void ObjectSaveReady( TInt aError ); |
|
239 |
|
240 /** |
|
241 * @see MUniSmilComposeObserver |
|
242 */ |
|
243 void SmilComposeEvent( TInt aError ); |
|
244 |
|
245 /** |
|
246 * @see MMediaInfoObserver |
|
247 */ |
|
248 void MediaInfoParsed(); |
|
249 |
|
250 /** |
|
251 * @see MUniDataModelObserver |
|
252 */ |
|
253 void RestoreReady(TInt aParseResult, TInt aError); |
|
254 |
|
255 private: |
|
256 /** |
|
257 * Extracts the name and adress from the CMsvRecipientList |
|
258 */ |
|
259 void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName, |
|
260 TPtrC& aAddress); |
|
261 void initL(); |
|
262 |
|
263 void setMessageIdL(int messageId); |
|
264 private: |
|
265 |
|
266 CMsvSession* mSession; |
|
267 CClientMtmRegistry* mMtmRegistry; |
|
268 |
|
269 CUniDataModel *mUniDataModel; |
|
270 |
|
271 RFs mfsSession; |
|
272 |
|
273 TRequestStatus iStatus; |
|
274 CMmsClientMtm* mMmsClient; |
|
275 CMsgMediaInfo* mInsertingMedia; |
|
276 CEikRichTextEditor *iEditor; |
|
277 CMDXMLDocument* iDom; |
|
278 CDRMHelper *iDRMHelper; |
|
279 TMsvId iMessageId; |
|
280 TBool done; |
|
281 SessionEventHandler *iSessionHandler; |
|
282 }; |
|
283 |
|
284 #endif /* UNIMMSDATAPLUGIN_P_H_ */ |
|