author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:28:39 +0300 | |
changeset 70 | a15d9966050f |
parent 31 | ebfee66fde93 |
permissions | -rw-r--r-- |
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 |
* Description: This is the implementation class for ConvergedMessage |
|
14 |
* |
|
15 |
*/ |
|
16 |
||
17 |
#ifndef CONVERGED_MESSAGE_IMPL_H |
|
18 |
#define CONVERGED_MESSAGE_IMPL_H |
|
19 |
||
20 |
||
21 |
#include "convergedmessageattachment.h" |
|
22 |
#include "convergedmessage.h" |
|
23 |
#include "convergedmessageid.h" |
|
24 |
#include "convergedmessageaddress.h" |
|
25 |
/** |
|
26 |
* Implementation of ConvergedMessage interface. |
|
27 |
* Encapsulates the message data for sending services. |
|
28 |
*/ |
|
29 |
class ConvergedMessageImpl |
|
30 |
{ |
|
31 |
public: |
|
32 |
||
33 |
/** |
|
34 |
* Constructor |
|
35 |
*/ |
|
36 |
ConvergedMessageImpl( |
|
37 |
||
38 |
ConvergedMessage::MessageType messageType = ConvergedMessage::None); |
|
39 |
||
40 |
/** |
|
41 |
* Constructor |
|
42 |
*/ |
|
43 |
ConvergedMessageImpl(const ConvergedMessageId &id); |
|
44 |
||
45 |
/** |
|
46 |
* Copy Constructor |
|
47 |
*/ |
|
48 |
ConvergedMessageImpl(const ConvergedMessage& msg); |
|
49 |
||
50 |
/** |
|
51 |
* Destructor |
|
52 |
*/ |
|
53 |
~ConvergedMessageImpl(); |
|
54 |
||
55 |
/** |
|
56 |
* This shall return the convergedmessageid |
|
57 |
* @return |
|
58 |
*/ |
|
59 |
ConvergedMessageId* id() const; |
|
60 |
||
61 |
/** |
|
62 |
* sets the convergedmessage id |
|
63 |
* @param id |
|
64 |
*/ |
|
65 |
void setMessageId(ConvergedMessageId &id); |
|
66 |
||
67 |
/** |
|
68 |
* Get the message type |
|
69 |
* @return message type |
|
70 |
*/ |
|
71 |
ConvergedMessage::MessageType messageType() const; |
|
72 |
||
73 |
/** |
|
74 |
* Set the message type |
|
75 |
* @param type message type |
|
76 |
*/ |
|
77 |
void setMessageType(ConvergedMessage::MessageType type); |
|
78 |
||
79 |
/** |
|
80 |
* Get the message sub-type |
|
81 |
* @return message sub-type |
|
82 |
*/ |
|
83 |
ConvergedMessage::MessageSubType messageSubType() const; |
|
84 |
||
85 |
/** |
|
86 |
* Set the message sub-type |
|
87 |
* @param type message sub-type |
|
88 |
*/ |
|
89 |
void setMessageSubType(ConvergedMessage::MessageSubType type); |
|
90 |
||
91 |
/** |
|
92 |
* Get the message priority |
|
93 |
* @return message priority |
|
94 |
*/ |
|
95 |
ConvergedMessage::Priority priority() const; |
|
96 |
||
97 |
/** |
|
98 |
* Set the message priority |
|
99 |
* @param newPriority message priority |
|
100 |
*/ |
|
101 |
void setPriority(ConvergedMessage::Priority newPriority); |
|
102 |
||
103 |
/** |
|
104 |
* Get the message direction |
|
105 |
* @return the direction |
|
106 |
*/ |
|
107 |
ConvergedMessage::Direction direction() const; |
|
108 |
||
109 |
/** |
|
110 |
* Set the message direction |
|
111 |
* @param direction direction of message |
|
112 |
*/ |
|
113 |
void setDirection(ConvergedMessage::Direction direction); |
|
114 |
||
115 |
/** |
|
116 |
* Get the message sending state |
|
117 |
* @return the SendingState of message |
|
118 |
*/ |
|
119 |
ConvergedMessage::SendingState sendingState() const; |
|
120 |
||
121 |
/** |
|
122 |
* Set the message sending state |
|
123 |
* @param state message sending status |
|
124 |
*/ |
|
125 |
void setSendingState(ConvergedMessage::SendingState state); |
|
126 |
||
127 |
/** |
|
128 |
* Get the message status is Unread |
|
129 |
* @return bool if the message Unread |
|
130 |
*/ |
|
131 |
bool isUnread() const; |
|
132 |
||
133 |
/** |
|
134 |
* Get the message attachment status |
|
135 |
* @return bool if the message has attachment Unread |
|
136 |
*/ |
|
137 |
bool hasAttachment() const; |
|
138 |
||
139 |
/** |
|
140 |
* Get the message location |
|
141 |
* @return the MessageLocation |
|
142 |
*/ |
|
143 |
ConvergedMessage::MessageLocation location() const; |
|
144 |
||
145 |
/** |
|
146 |
* Set the message location |
|
147 |
* @param cation as message location |
|
148 |
*/ |
|
149 |
void setLocation(ConvergedMessage::MessageLocation location); |
|
150 |
||
151 |
/** |
|
152 |
* Set the message property |
|
153 |
* @param property as message property |
|
154 |
*/ |
|
155 |
void setProperty(ConvergedMessage::MessageProperty property); |
|
156 |
||
157 |
/** |
|
158 |
* Returns the message properties |
|
159 |
* @return integer for message property |
|
160 |
*/ |
|
161 |
quint16 properties() const; |
|
162 |
||
163 |
/** |
|
164 |
* Get the subject |
|
165 |
* @return message subject |
|
166 |
*/ |
|
167 |
const QString& subject() const; |
|
168 |
||
169 |
/** |
|
170 |
* Set the message subject |
|
171 |
* @param subject message subject |
|
172 |
*/ |
|
173 |
void setSubject(const QString &subject); |
|
174 |
||
175 |
/** |
|
176 |
* Get the message received/sent date |
|
177 |
* @return The message timestamp |
|
178 |
*/ |
|
179 |
qint64 timeStamp() const; |
|
180 |
||
181 |
/** |
|
182 |
* Set the message received date |
|
183 |
* @param timeStamp The message timestamp |
|
184 |
*/ |
|
185 |
void setTimeStamp(qint64 timeStamp); |
|
186 |
||
187 |
/** |
|
188 |
* Set message body text |
|
189 |
* @param bodyText message body text |
|
190 |
*/ |
|
191 |
void setBodyText(const QString &bodyText); |
|
192 |
||
193 |
/** |
|
194 |
* Returns message body text. |
|
195 |
* @return Message body text. |
|
196 |
*/ |
|
197 |
const QString& bodyText() const; |
|
198 |
||
199 |
/** |
|
200 |
* Add a recipient of type To |
|
201 |
* @param recipient recipient address |
|
202 |
*/ |
|
203 |
void addToRecipient(ConvergedMessageAddress &recipient); |
|
204 |
/** |
|
205 |
* Add recipients of type To |
|
206 |
* This method takes the ownership of recipients array |
|
207 |
* |
|
208 |
* @param recipients array of recipient address |
|
209 |
*/ |
|
210 |
void addToRecipients(ConvergedMessageAddressList &recipients); |
|
211 |
/** |
|
212 |
* Add a recipient of type Cc |
|
213 |
* @param recipient recipient address |
|
214 |
*/ |
|
215 |
void addCcRecipient(ConvergedMessageAddress &recipient); |
|
216 |
||
217 |
/** |
|
218 |
* Add recipients of type Cc |
|
219 |
* This method takes the ownership of recipients array |
|
220 |
* |
|
221 |
* @param recipients array of recipient address |
|
222 |
*/ |
|
223 |
void addCcRecipients(ConvergedMessageAddressList &recipients); |
|
224 |
/** |
|
225 |
* Add a recipient of type Bcc |
|
226 |
* @param recipient recipient address |
|
227 |
*/ |
|
228 |
void addBccRecipient(ConvergedMessageAddress &recipient); |
|
229 |
/** |
|
230 |
* Add recipients of type Bcc |
|
231 |
* This method takes the ownership of recipients array |
|
232 |
* |
|
233 |
* @param recipients array of recipient address |
|
234 |
*/ |
|
235 |
void addBccRecipients(ConvergedMessageAddressList &recipients); |
|
236 |
||
237 |
/** |
|
238 |
* Add a recipient of type From |
|
239 |
* @param recipient recipient address |
|
240 |
*/ |
|
241 |
void addFromRecipient(ConvergedMessageAddress &recipient); |
|
242 |
/** |
|
243 |
* Returns array of To addresses and their aliases. |
|
244 |
* @return Array of To addresses and their aliases. |
|
245 |
*/ |
|
246 |
const ConvergedMessageAddressList toAddressList() const; |
|
247 |
||
248 |
/** |
|
249 |
* Returns array of Cc addresses and their aliases. |
|
250 |
* @return Array of Cc addresses and their aliases. |
|
251 |
*/ |
|
252 |
const ConvergedMessageAddressList ccAddressList() const; |
|
253 |
||
254 |
/** |
|
255 |
* Returns array of Bcc addresses and aliases. |
|
256 |
* @return Array of Bcc addresses and aliases. |
|
257 |
*/ |
|
258 |
const ConvergedMessageAddressList bccAddressList() const; |
|
259 |
/** |
|
260 |
* Returns array of From addresses and aliases. |
|
261 |
* @return Array of From addresses and aliases. |
|
262 |
*/ |
|
263 |
ConvergedMessageAddress* fromAddress() const; |
|
264 |
||
265 |
/** |
|
266 |
* Get the attachment list |
|
267 |
* @return Attachment list |
|
268 |
*/ |
|
269 |
ConvergedMessageAttachmentList attachments() const; |
|
270 |
||
271 |
/** |
|
272 |
* Add a list of attachments to the message |
|
273 |
* @param attachmentList List of attachments |
|
274 |
*/ |
|
275 |
||
276 |
void addAttachments(ConvergedMessageAttachmentList attachmentList); |
|
277 |
||
278 |
/** |
|
279 |
* Serialize the data memebers into the stream. |
|
280 |
* @param stream data stream to which data is serialized. |
|
281 |
*/ |
|
282 |
void serialize(QDataStream &stream) const; |
|
283 |
||
284 |
/** |
|
285 |
* Deserialize the stream to data members. |
|
286 |
* @param stream data stream from which data is deserialized. |
|
287 |
*/ |
|
288 |
void deserialize(QDataStream &stream); |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
289 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
290 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
291 |
* Sets the message property, if reply-path is present |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
292 |
* @param replypath, TP-RP (Reply Path) Found in first octet of |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
293 |
* Submit and Deliver PDU |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
294 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
295 |
void setReplyPath(bool replypath); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
296 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
297 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
298 |
* Tells if the reply-path is set for this message |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
299 |
* @return bool, if the reply-path exists |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
300 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
301 |
bool replyPath(); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
302 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
303 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
304 |
* Set originating service center address. This is used for reply |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
305 |
* purposes, if the reply-via-same-smsc flag is ON |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
306 |
* @param scaddress, service center address |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
307 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
308 |
void setOriginatingSC(const QString& scaddress); |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
309 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
310 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
311 |
* Get originating service center address, |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
312 |
* if preserved for reply-via-same-smsc |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
313 |
* @return originating service center address |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
314 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
315 |
const QString& originatingSC() const; |
31 | 316 |
|
317 |
private: |
|
318 |
/** |
|
319 |
* Operator= overloading. Making it private with no implementation to prevent its usage |
|
320 |
*/ |
|
321 |
ConvergedMessageImpl& operator=(const ConvergedMessage &msg); |
|
322 |
||
323 |
private: |
|
324 |
//data |
|
325 |
||
326 |
/** |
|
327 |
* Converge MessageId |
|
328 |
*/ |
|
329 |
ConvergedMessageId* mId; |
|
330 |
||
331 |
/** |
|
332 |
* Message Subject |
|
333 |
*/ |
|
334 |
QString mSubject; |
|
335 |
||
336 |
/** |
|
337 |
* Message Body Text |
|
338 |
*/ |
|
339 |
QString mBodyText; |
|
340 |
||
341 |
/** |
|
342 |
* Array of real addresses and aliases. |
|
343 |
*/ |
|
344 |
ConvergedMessageAddressList mToAddresses; |
|
345 |
||
346 |
/** |
|
347 |
* Array of real CC addresses and aliases. |
|
348 |
*/ |
|
349 |
ConvergedMessageAddressList mCcAddresses; |
|
350 |
||
351 |
/** |
|
352 |
* Array of real BC addresses and aliases. |
|
353 |
*/ |
|
354 |
ConvergedMessageAddressList mBccAddresses; |
|
355 |
/** |
|
356 |
* Array of real FROM addresses and aliases. |
|
357 |
*/ |
|
358 |
ConvergedMessageAddressList mFromAddresses; |
|
359 |
/** |
|
360 |
* Message From Address |
|
361 |
*/ |
|
362 |
ConvergedMessageAddress* mFromAddress; |
|
363 |
||
364 |
/** |
|
365 |
* Message Attachments |
|
366 |
*/ |
|
367 |
ConvergedMessageAttachmentList mAttachments; |
|
368 |
||
369 |
/** |
|
370 |
* Message Timestamp |
|
371 |
*/ |
|
372 |
qint64 mTimeStamp; |
|
373 |
||
374 |
/** |
|
375 |
* Message Attribute |
|
376 |
*/ |
|
377 |
quint16 mProperty; |
|
378 |
||
379 |
/** |
|
380 |
* Message type |
|
381 |
*/ |
|
382 |
quint8 mMessageType; |
|
383 |
||
384 |
/** |
|
385 |
* Message type |
|
386 |
*/ |
|
387 |
quint8 mMessageSubType; |
|
388 |
||
389 |
/** |
|
390 |
* Message priority |
|
391 |
*/ |
|
392 |
quint8 mPriority; |
|
393 |
||
394 |
/** |
|
395 |
* Message location |
|
396 |
*/ |
|
397 |
quint8 mLocation; |
|
398 |
||
399 |
/** |
|
400 |
* Message Direction |
|
401 |
* as incoming/outgoing etc. |
|
402 |
*/ |
|
403 |
quint8 mDirection; |
|
404 |
||
405 |
/** |
|
406 |
* Messaging sending states |
|
407 |
*/ |
|
408 |
quint8 mSendingState; |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
409 |
|
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
410 |
/** |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
411 |
* Originating SC, |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
412 |
* to be used only when reply-path is available |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
413 |
*/ |
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
414 |
QString mOriginatingSC; |
31 | 415 |
}; |
416 |
||
417 |
#endif // CONVERGED_MESSAGE_IMPL_H |