|
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: This is the domain header API for general message data model |
|
15 * plugin behavior |
|
16 */ |
|
17 |
|
18 #ifndef UNIDATAMODELPLUGININTERFACE_H_ |
|
19 #define UNIDATAMODELPLUGININTERFACE_H_ |
|
20 |
|
21 #include <QtPlugin> |
|
22 #include <msvstd.h> |
|
23 #include <QDateTime> |
|
24 #include <msvapi.h> |
|
25 #include <cmsvattachment.h> |
|
26 #include "convergedmessageaddress.h" |
|
27 |
|
28 /** |
|
29 * Enum defining Message priority |
|
30 * @attention This enum can have values from 0 to 2 only. |
|
31 */ |
|
32 enum MsgPriority |
|
33 { |
|
34 Low = 0, Normal, High |
|
35 }; |
|
36 |
|
37 /** |
|
38 * UniMessageInfo |
|
39 * Definition of Message's media objects |
|
40 */ |
|
41 |
|
42 class UniMessageInfo |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Constructor |
|
47 */ |
|
48 inline UniMessageInfo(const QString& filepath, const int size, |
|
49 const QString& mimetype); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 inline ~UniMessageInfo(); |
|
55 |
|
56 /** |
|
57 * setPath |
|
58 * @param file's path |
|
59 */ |
|
60 inline void setPath(const QString& filepath); |
|
61 |
|
62 /** |
|
63 * setMimeType |
|
64 * @param file's mimetype |
|
65 */ |
|
66 inline void setMimeType(const QString& mimetype); |
|
67 |
|
68 /** |
|
69 * path |
|
70 * @return file's path |
|
71 */ |
|
72 inline const QString& path(); |
|
73 |
|
74 /** |
|
75 * size |
|
76 * @return file's size |
|
77 */ |
|
78 inline const int size(); |
|
79 |
|
80 /** |
|
81 * mimetype |
|
82 * @return file's mimetype |
|
83 */ |
|
84 inline const QString& mimetype(); |
|
85 |
|
86 /** |
|
87 * Serialize the data memebers into the stream. |
|
88 * @param stream data stream to which data is serialized. |
|
89 */ |
|
90 inline void serialize(QDataStream &stream) const; |
|
91 |
|
92 /** |
|
93 * Deserialize the stream to data members. |
|
94 * @param stream data stream from which data is deserialized. |
|
95 */ |
|
96 inline void deserialize(QDataStream &stream); |
|
97 |
|
98 private: |
|
99 QString mPath; |
|
100 int mSize; |
|
101 QString mMimeType; |
|
102 |
|
103 }; |
|
104 |
|
105 |
|
106 typedef QList<UniMessageInfo*> UniMessageInfoList; |
|
107 |
|
108 class UniDataModelPluginInterface |
|
109 { |
|
110 public: |
|
111 |
|
112 /** |
|
113 * Destructor |
|
114 */ |
|
115 virtual ~UniDataModelPluginInterface() |
|
116 { |
|
117 } |
|
118 |
|
119 /** |
|
120 * Creates the new instance of the plugin |
|
121 * @return plugin instance |
|
122 */ |
|
123 virtual QObject* createInstance()=0; |
|
124 |
|
125 /** |
|
126 * Sets the id of the message whose details needs to be extacted. |
|
127 * @param TMsvId of the message. |
|
128 */ |
|
129 |
|
130 virtual int setMessageId(int messageId)=0; |
|
131 |
|
132 /** Reset the datamodel |
|
133 * Resets the data model to be used again |
|
134 */ |
|
135 virtual void reset() =0; |
|
136 |
|
137 /** |
|
138 * Get the body of the message |
|
139 * @param aBodyText , a QString to hold the message body |
|
140 */ |
|
141 virtual void body(QString& aBodyText)=0; |
|
142 |
|
143 /** |
|
144 * Size of the message |
|
145 * @return message size |
|
146 */ |
|
147 virtual int messageSize()=0; |
|
148 |
|
149 /** |
|
150 * List of the message To recipients |
|
151 * @param mAddressList, list of all addresses in the message |
|
152 */ |
|
153 virtual void toRecipientList(ConvergedMessageAddressList& mAddressList)=0; |
|
154 |
|
155 /** |
|
156 * List of the message CC recipients |
|
157 * @param mAddressList, list of all addresses in the message |
|
158 */ |
|
159 virtual void ccRecipientList(ConvergedMessageAddressList& mAddressList)=0; |
|
160 |
|
161 /** |
|
162 * List of the message bCC recipients |
|
163 * @param mAddressList, list of all addresses in the message |
|
164 */ |
|
165 virtual void bccRecipientList(ConvergedMessageAddressList& mAddressList)=0; |
|
166 |
|
167 /** |
|
168 * The from address of a message |
|
169 * @param messageAddress |
|
170 */ |
|
171 virtual void fromAddress(QString& messageAddress)=0; |
|
172 |
|
173 /** |
|
174 * List of attachments in the message. |
|
175 * @return the attachment list for the message. |
|
176 */ |
|
177 virtual UniMessageInfoList attachmentList()=0; |
|
178 |
|
179 /** |
|
180 * Type of the message (SMS/MMS etc..) |
|
181 * @return message type |
|
182 */ |
|
183 virtual QString messageType()=0; |
|
184 |
|
185 /** |
|
186 * Priority of the message (low/medium/high) |
|
187 * @return MsgPriority. |
|
188 */ |
|
189 virtual MsgPriority messagePriority()=0; |
|
190 |
|
191 /** |
|
192 * Number of attachments with the message |
|
193 * @return count of attachment |
|
194 */ |
|
195 virtual int attachmentCount()=0; |
|
196 |
|
197 /** |
|
198 * To check if the message has attachments |
|
199 * @return true/false |
|
200 */ |
|
201 |
|
202 virtual bool hasAttachment()=0; |
|
203 |
|
204 /** |
|
205 * Number of objects asociated with a MMS message |
|
206 * @return object count |
|
207 */ |
|
208 virtual int objectCount()=0; |
|
209 |
|
210 /** |
|
211 * The MMS object list asociated with a MMS message |
|
212 * @return object list |
|
213 */ |
|
214 virtual UniMessageInfoList objectList()=0; |
|
215 |
|
216 /** |
|
217 * Number of slides asociated with a MMS message |
|
218 * @return slide count |
|
219 */ |
|
220 virtual int slideCount()=0; |
|
221 |
|
222 /** |
|
223 * The content of a Slide in case of a MMS message |
|
224 * @param list of messageinfo objects. |
|
225 */ |
|
226 virtual UniMessageInfoList slideContent(int count)=0; |
|
227 |
|
228 /** |
|
229 * Time stamp of the message when it was created/received. |
|
230 * @param message time |
|
231 */ |
|
232 virtual QDateTime timeStamp()=0; |
|
233 |
|
234 /** |
|
235 * Adds object into smil model |
|
236 * @param slide number |
|
237 * @param UniMessageInfo obj |
|
238 */ |
|
239 virtual void addObject( int aslideNum,UniMessageInfo* aInfo )=0; |
|
240 |
|
241 /** |
|
242 * Adds text object into smil model |
|
243 * @param slide number |
|
244 * @param text |
|
245 */ |
|
246 virtual void addTextObject(int aSlideNum,QString aText )=0; |
|
247 |
|
248 /** |
|
249 * Adds slide into smil model |
|
250 * @param slide number |
|
251 */ |
|
252 virtual void addSlide( int aSlideNum )=0; |
|
253 |
|
254 /** |
|
255 * Compose Smil |
|
256 * @param Edit store |
|
257 */ |
|
258 virtual void composeSmil(CMsvStore& aEditStore)=0; |
|
259 |
|
260 /** |
|
261 * Save Objects inside smil model |
|
262 */ |
|
263 virtual void saveObjects()=0; |
|
264 |
|
265 /** |
|
266 * Get the smil attachment index |
|
267 * @return TMsvAttachmentId |
|
268 */ |
|
269 virtual TMsvAttachmentId getSmilAttachmentByIndex()=0; |
|
270 |
|
271 /** |
|
272 * Restores the model for editing purpose |
|
273 * @param CBaseMtm |
|
274 */ |
|
275 virtual void restore(CBaseMtm& mtm)=0; |
|
276 |
|
277 /** |
|
278 * Add attachment |
|
279 * @param UniMessageInfo |
|
280 */ |
|
281 virtual void addAttachment( UniMessageInfo* aInfo )=0; |
|
282 |
|
283 /** |
|
284 * Remove slide from smil model |
|
285 * @param slide number |
|
286 */ |
|
287 virtual void removeSlide(int aSlideNumber)=0; |
|
288 |
|
289 |
|
290 /** |
|
291 * Subject associated with the message |
|
292 * @return QString |
|
293 */ |
|
294 virtual QString subject()=0; |
|
295 |
|
296 /** |
|
297 * Session with the Messaging Server |
|
298 * @return CMsvSession* |
|
299 */ |
|
300 virtual CMsvSession* session() =0; |
|
301 }; |
|
302 |
|
303 Q_DECLARE_INTERFACE(UniDataModelPluginInterface, |
|
304 "org.nokia.messaging.UniDataModelPluginInterface/1.0") |
|
305 |
|
306 #include "unidatamodelplugininterface.inl" |
|
307 |
|
308 #endif //UNIDATAMODELPLUGININTERFACE_H_ |