31
|
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 |
* Restores the model for editing purpose
|
|
236 |
* @param CBaseMtm
|
|
237 |
*/
|
|
238 |
virtual void restore(CBaseMtm& mtm)=0;
|
|
239 |
|
|
240 |
/**
|
|
241 |
* Subject associated with the message
|
|
242 |
* @return QString
|
|
243 |
*/
|
|
244 |
virtual QString subject()=0;
|
|
245 |
|
|
246 |
/**
|
|
247 |
* Session with the Messaging Server
|
|
248 |
* @return CMsvSession*
|
|
249 |
*/
|
|
250 |
virtual CMsvSession* session() =0;
|
|
251 |
};
|
|
252 |
|
|
253 |
Q_DECLARE_INTERFACE(UniDataModelPluginInterface,
|
|
254 |
"org.nokia.messaging.UniDataModelPluginInterface/1.0")
|
|
255 |
|
|
256 |
#include "unidatamodelplugininterface.inl"
|
|
257 |
|
|
258 |
#endif //UNIDATAMODELPLUGININTERFACE_H_
|