author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:28:39 +0300 | |
changeset 70 | a15d9966050f |
parent 52 | 12db4185673b |
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 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef __UNIEDITORSMSPLUGINPRIVATE_H |
|
19 |
#define __UNIEDITORSMSPLUGINPRIVATE_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <msvapi.h> |
|
23 |
#include <gsmuelem.h> |
|
24 |
#include <mtclbase.h> |
|
25 |
#include "unieditorplugininterface.h" |
|
26 |
#include "UniSendingSettings.h" |
|
27 |
||
28 |
// DATA TYPES |
|
29 |
||
30 |
// FORWARD DECLARATIONS |
|
31 |
class CClientMtmRegistry; |
|
32 |
class CSmsClientMtm; |
|
33 |
class CSmsHeader; |
|
34 |
class CParaFormatLayer; |
|
35 |
class CCharFormatLayer; |
|
36 |
class CRichText; |
|
37 |
class CMsgSmsEmailOverSmsFunc; |
|
38 |
class CSmsNumber; |
|
39 |
class CSmsMessage; |
|
40 |
class ConvergedMessage; |
|
41 |
class UniEditorGenUtils; |
|
42 |
||
43 |
// CLASS DECLARATION |
|
44 |
||
45 |
/** |
|
46 |
* UniEditorSmsPluginPrivate |
|
47 |
*/ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
48 |
class UniEditorSmsPluginPrivate :public CBase, public MMsvSessionObserver |
31 | 49 |
{ |
50 |
public: // Constructors and destructor |
|
51 |
||
52 |
/** |
|
53 |
* Two-phased constructor. |
|
54 |
*/ |
|
55 |
static UniEditorSmsPluginPrivate* NewL(); |
|
56 |
||
57 |
/** |
|
58 |
* Destructor. |
|
59 |
*/ |
|
60 |
virtual ~UniEditorSmsPluginPrivate(); |
|
61 |
||
62 |
public: // From CUniEditorPlugin |
|
63 |
||
64 |
/** |
|
65 |
* load sms headers either from store, if provided, |
|
66 |
* or from global settings |
|
67 |
* @param aStore message store |
|
68 |
*/ |
|
69 |
void LoadHeadersL( CMsvStore* aStore ); |
|
70 |
||
71 |
/** |
|
72 |
* Converts message from message store into ConvergedMessage |
|
73 |
* based on the operation |
|
74 |
* @param TMsvId id |
|
75 |
* @param aOperation operation type |
|
76 |
* @return ConvergedMessage object is returned in successfull cases and |
|
77 |
* NULL is returned in failure cases. The ownership of the object |
|
78 |
* is transferred to the caller. |
|
79 |
*/ |
|
80 |
ConvergedMessage* ConvertFromL( TMsvId aId, |
|
81 |
UniEditorPluginInterface::EditorOperation aOperation ); |
|
82 |
||
83 |
/** |
|
84 |
* convert convergedmessage type to a message entry in store |
|
85 |
* @param message convergedmessage |
|
86 |
* @return message entry id |
|
87 |
*/ |
|
88 |
TMsvId ConvertToL( ConvergedMessage* message ); |
|
89 |
||
90 |
/** |
|
91 |
* send a message |
|
92 |
* @aId message entry id |
|
93 |
*/ |
|
94 |
void SendL( TMsvId aId ); |
|
95 |
||
96 |
/** |
|
97 |
* validate settings |
|
98 |
* @param aEmailOverSms if email over sms is supported or not |
|
99 |
*/ |
|
100 |
TBool ValidateServiceL( TBool aEmailOverSms = EFalse ); |
|
101 |
||
102 |
/** |
|
103 |
* validate the service |
|
104 |
*/ |
|
105 |
TBool IsServiceValidL(); |
|
106 |
||
107 |
/** |
|
108 |
* set unicode mode to true/false |
|
109 |
*/ |
|
110 |
inline void SetUnicodeMode( TBool aUnicodeMode ); |
|
111 |
||
112 |
//Turkish SMS(PREQ2265) specific... |
|
113 |
void SetEncodingSettingsL(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType); |
|
114 |
||
115 |
/** |
|
116 |
* for deciding on reduced or full charset support |
|
117 |
*/ |
|
118 |
void GetNumPDUsL ( |
|
119 |
TDesC& aBuf, |
|
120 |
TInt& aNumOfRemainingChars, |
|
121 |
TInt& aNumOfPDUs, |
|
122 |
TBool& aUnicodeMode, |
|
123 |
TSmsEncoding& aAlternativeEncodingType); |
|
124 |
||
125 |
/** |
|
126 |
* delete entry aId from drafts folder |
|
127 |
* @param aId entry to be deleted |
|
128 |
*/ |
|
129 |
void DeleteDraftsEntryL( TMsvId aId ); |
|
130 |
||
131 |
private: // Constructors |
|
132 |
||
133 |
/** |
|
134 |
* C++ default constructor. |
|
135 |
*/ |
|
136 |
UniEditorSmsPluginPrivate(); |
|
137 |
||
138 |
/** |
|
139 |
* By default Symbian 2nd phase constructor is private. |
|
140 |
*/ |
|
141 |
void ConstructL(); |
|
142 |
||
143 |
/** |
|
144 |
* Returns pointer to iSmsMtm member variable |
|
145 |
*/ |
|
146 |
CSmsClientMtm* SmsMtmL(); |
|
147 |
||
148 |
/** |
|
149 |
* Moves message into outbox for sending and creates copies of SMS messages |
|
150 |
* into outbox in case of multiple recipients |
|
151 |
*/ |
|
152 |
void MoveMessagesToOutboxL(); |
|
153 |
||
154 |
/** |
|
155 |
* Called in MoveMessagesToOutboxL, calls the actual moving |
|
156 |
* function |
|
157 |
*/ |
|
158 |
TMsvId MoveMessageEntryL( TMsvId aTarget ); |
|
159 |
||
160 |
||
161 |
/** |
|
162 |
* Creates messages into the Outbox if there are several recipients |
|
163 |
* @param TMsvEntry& a reference to entry to be copied |
|
164 |
* @param CSmsNumber& a reference to CSmsNumber to be copied |
|
165 |
* @param CRichText& a reference to msg body contents |
|
166 |
* @return TMsvId of the created msg entry |
|
167 |
*/ |
|
168 |
TMsvId CreateMessageInOutboxL( |
|
169 |
const TMsvEntry& aEntry, |
|
170 |
const CSmsNumber& aRecipient, |
|
171 |
const CRichText& aBody ); |
|
172 |
||
173 |
/** |
|
174 |
* Creates messages into the Outbox if there are several recipients |
|
175 |
* and the message is E-Mail over SMS message |
|
176 |
* @param aEntry a reference to entry to be copied |
|
177 |
* @param aAddress a reference to address to be copied |
|
178 |
* @return TMsvId of the created msg entry |
|
179 |
*/ |
|
180 |
virtual TMsvId CreateMessageInOutboxL( |
|
181 |
const TMsvEntry& aEntry, |
|
182 |
const TDesC& aAddress ); |
|
183 |
||
184 |
||
185 |
/** |
|
186 |
* Calls the actual sending method of SMS Client MTM |
|
187 |
*/ |
|
188 |
void SetScheduledSendingStateL( CMsvEntrySelection* aSelection ); |
|
189 |
||
190 |
/** |
|
191 |
* Extracts name and address |
|
192 |
*/ |
|
193 |
void NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress ); |
|
194 |
||
195 |
/** |
|
196 |
* Creates text for TMsvEntry::iDescription. It could be subject or |
|
197 |
* if subject does not exist a beginning of the message body |
|
198 |
*/ |
|
199 |
void ExtractDescriptionFromMessageL( |
|
200 |
const CSmsMessage& aMessage, |
|
201 |
TDes& aDescription, |
|
202 |
TInt aMaxLength); |
|
203 |
||
204 |
/** |
|
205 |
* Copies text from attachment into the body of the SMS |
|
206 |
*/ |
|
207 |
void CreatePlainTextSMSL( RFile& aFile ); |
|
208 |
||
209 |
/** |
|
210 |
* Insert subject into the body of the SMS |
|
211 |
*/ |
|
212 |
void InsertSubjectL( CSmsHeader& aHeader, CRichText& aText ); |
|
213 |
||
214 |
/** |
|
215 |
* Copies data from VCard attachment into body of the SMS |
|
216 |
*/ |
|
217 |
void CreateVCardSMSL( RFile& aFile ); |
|
218 |
||
219 |
/** |
|
220 |
* Copies data from VCCalendar attachment into body of the SMS |
|
221 |
*/ |
|
222 |
void CreateVCalSMSL( RFile& aFile ); |
|
223 |
||
224 |
/** |
|
225 |
* Checks service center address |
|
226 |
*/ |
|
227 |
TBool ValidateSCNumberL(); |
|
228 |
||
229 |
/** |
|
230 |
* Checks service center address for E-Mail over SMS messages |
|
231 |
*/ |
|
232 |
TBool ValidateSCNumberForEmailOverSmsL(); |
|
233 |
||
234 |
/** |
|
235 |
* Saves E-Mail specific information in header |
|
236 |
*/ |
|
237 |
void FillEmailInformationDataL( CSmsHeader& aHeader, const TPtrC& aAddress ); |
|
238 |
||
239 |
/** |
|
240 |
* Checks if the address is E-Mail address |
|
241 |
*/ |
|
242 |
TBool IsEmailAddress( const TPtrC& aAddress ) const; |
|
243 |
||
244 |
/** |
|
245 |
* Converts sms message to uni message format. |
|
246 |
* @param aId message id |
|
247 |
* @param [OUT]aMessage convergedmessage |
|
248 |
* @param aOperation operation type |
|
249 |
*/ |
|
250 |
void DoConvertFromL( TMsvId aId, |
|
251 |
ConvergedMessage* aMessage, |
|
252 |
UniEditorPluginInterface::EditorOperation aOperation ); |
|
253 |
||
254 |
/** |
|
255 |
* create Sms entry into draft folder |
|
256 |
*/ |
|
257 |
TMsvId CreateNativeSmsL(); |
|
258 |
||
259 |
/** |
|
260 |
* set/update sms settings |
|
261 |
*/ |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
52
diff
changeset
|
262 |
void SetSmsSettingsL(ConvergedMessage* message); |
31 | 263 |
|
264 |
/** |
|
265 |
* set data to the sms |
|
266 |
*/ |
|
267 |
void SetSmsDataL(ConvergedMessage* message); |
|
268 |
||
269 |
/** |
|
270 |
* set recipient / subject to the message entry |
|
271 |
*/ |
|
272 |
void SetSmsHeaderL(ConvergedMessage* message); |
|
273 |
||
274 |
/** |
|
275 |
* set body text from converged message into |
|
276 |
* message entry in store |
|
277 |
*/ |
|
278 |
void SetSmsBodyL(ConvergedMessage* message); |
|
279 |
||
280 |
/** |
|
281 |
* set attachment info from converged message into |
|
282 |
* message entry in store |
|
283 |
*/ |
|
284 |
void SetSmsAttachmentsL(ConvergedMessage* message); |
|
285 |
||
286 |
/** |
|
287 |
* create attachment in message store for the |
|
288 |
* message under composition |
|
289 |
* @param aFilePath file for which attachment is created |
|
290 |
* @param aStore message store |
|
291 |
*/ |
|
292 |
void CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath); |
|
293 |
||
294 |
/** |
|
295 |
* Populates address feilds into converged message |
|
296 |
*/ |
|
297 |
void populateRecipientsL(ConvergedMessage* aMessage); |
|
298 |
||
299 |
/** |
|
300 |
* Populates body into converged message |
|
301 |
*/ |
|
302 |
void populateMessageBodyL(ConvergedMessage* aMessage, |
|
303 |
TMsvEntry &aEntry); |
|
304 |
||
305 |
/** |
|
306 |
* @see MMsvSessionObserver |
|
307 |
*/ |
|
308 |
void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
309 |
TAny* aArg3); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
310 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
311 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
312 |
* Populate recipients for reply case |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
313 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
314 |
void populateMessageForReplyL(ConvergedMessage* aMessage); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
315 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
316 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
317 |
* Extract from address from Deliver PDU |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
318 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
319 |
void fromAddress(QString& messageAddress); |
31 | 320 |
|
321 |
private: // Data |
|
322 |
||
323 |
/** |
|
324 |
* message service session |
|
325 |
* Owned |
|
326 |
*/ |
|
327 |
CMsvSession* iSession; |
|
328 |
||
329 |
/** |
|
330 |
* Mtm registry |
|
331 |
* Owned |
|
332 |
*/ |
|
333 |
CClientMtmRegistry* iMtmRegistry; |
|
334 |
||
335 |
/** |
|
336 |
* sms mtm |
|
337 |
* Owned |
|
338 |
*/ |
|
339 |
CSmsClientMtm* iSmsMtm; |
|
340 |
||
341 |
/** |
|
342 |
* sms service id |
|
343 |
*/ |
|
344 |
TMsvId iSmsServiceId; |
|
345 |
||
346 |
/** |
|
347 |
* sms header |
|
348 |
* Owned |
|
349 |
*/ |
|
350 |
CSmsHeader* iSmsHeader; |
|
351 |
||
352 |
/** |
|
353 |
* Owned |
|
354 |
*/ |
|
355 |
CParaFormatLayer* iParaFormatLayer; |
|
356 |
||
357 |
/** |
|
358 |
* Owned |
|
359 |
*/ |
|
360 |
CCharFormatLayer* iCharFormatLayer; |
|
361 |
||
362 |
/** |
|
363 |
* Owned |
|
364 |
*/ |
|
365 |
CRichText* iRichText; |
|
366 |
||
367 |
/** |
|
368 |
* recipient array |
|
369 |
* Owned |
|
370 |
*/ |
|
371 |
CDesCArray* iRecipients; |
|
372 |
||
373 |
/** |
|
374 |
* flag for biomsg distinction |
|
375 |
*/ |
|
376 |
TBool iBioMsg; |
|
377 |
||
378 |
enum TUniPluginPanic |
|
379 |
{ |
|
380 |
EIllegalArguments |
|
381 |
}; |
|
382 |
||
383 |
/** |
|
384 |
* email gateway address/alias |
|
385 |
* Owned |
|
386 |
*/ |
|
387 |
CSmsNumber* iEmailOverSmsC; |
|
388 |
||
389 |
/** |
|
390 |
* flag for setting unicodemode true/false |
|
391 |
*/ |
|
392 |
TBool iUnicodeMode; |
|
393 |
||
394 |
/** |
|
395 |
* feature flag to check if offline is supported or not |
|
396 |
*/ |
|
397 |
TBool iOfflineSupported; |
|
398 |
||
399 |
//Turkish SMS(PREQ2265) specific... |
|
400 |
TInt iCharSupportType; |
|
401 |
TSmsEncoding iAlternativeEncodingType; |
|
402 |
TBool iNLTFeatureSupport; |
|
403 |
||
404 |
/** |
|
405 |
* general utility class |
|
406 |
* Owned |
|
407 |
*/ |
|
408 |
UniEditorGenUtils* iGenUtils; |
|
409 |
}; |
|
410 |
||
411 |
inline void UniEditorSmsPluginPrivate::SetUnicodeMode( TBool aUnicodeMode ) |
|
412 |
{ |
|
413 |
iUnicodeMode = aUnicodeMode; |
|
414 |
} |
|
415 |
||
416 |
#endif // __UNIEDITORSMSPLUGINPRIVATE_H |
|
417 |
||
418 |
// End of File |