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 "UniSendingSettings.h" |
|
26 |
|
27 // DATA TYPES |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CClientMtmRegistry; |
|
31 class CSmsClientMtm; |
|
32 class CSmsHeader; |
|
33 class CParaFormatLayer; |
|
34 class CCharFormatLayer; |
|
35 class CRichText; |
|
36 class CMsgSmsEmailOverSmsFunc; |
|
37 class CSmsNumber; |
|
38 class CSmsMessage; |
|
39 class ConvergedMessage; |
|
40 class UniEditorGenUtils; |
|
41 class SessionEventHandler; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * UniEditorSmsPluginPrivate |
|
47 */ |
|
48 class UniEditorSmsPluginPrivate |
|
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 * convert message entry to convergedmessage type |
|
73 * @param aId message entry id |
|
74 * @return convergedmessage |
|
75 */ |
|
76 ConvergedMessage* ConvertFromL( TMsvId aId ); |
|
77 |
|
78 /** |
|
79 * convert convergedmessage type to a message entry in store |
|
80 * @param message convergedmessage |
|
81 * @return message entry id |
|
82 */ |
|
83 TMsvId ConvertToL( ConvergedMessage* message ); |
|
84 |
|
85 /** |
|
86 * send a message |
|
87 * @aId message entry id |
|
88 */ |
|
89 void SendL( TMsvId aId ); |
|
90 |
|
91 /** |
|
92 * validate settings |
|
93 * @param aEmailOverSms if email over sms is supported or not |
|
94 */ |
|
95 TBool ValidateServiceL( TBool aEmailOverSms = EFalse ); |
|
96 |
|
97 /** |
|
98 * validate the service |
|
99 */ |
|
100 TBool IsServiceValidL(); |
|
101 |
|
102 /** |
|
103 * set unicode mode to true/false |
|
104 */ |
|
105 inline void SetUnicodeMode( TBool aUnicodeMode ); |
|
106 |
|
107 //Turkish SMS(PREQ2265) specific... |
|
108 void SetEncodingSettings(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType); |
|
109 |
|
110 /** |
|
111 * for deciding on reduced or full charset support |
|
112 */ |
|
113 void GetNumPDUsL ( |
|
114 TDesC& aBuf, |
|
115 TInt& aNumOfRemainingChars, |
|
116 TInt& aNumOfPDUs, |
|
117 TBool& aUnicodeMode, |
|
118 TSmsEncoding& aAlternativeEncodingType); |
|
119 |
|
120 /** |
|
121 * delete entry aId from drafts folder |
|
122 * @param aId entry to be deleted |
|
123 */ |
|
124 void DeleteDraftsEntryL( TMsvId aId ); |
|
125 |
|
126 private: // Constructors |
|
127 |
|
128 /** |
|
129 * C++ default constructor. |
|
130 */ |
|
131 UniEditorSmsPluginPrivate(); |
|
132 |
|
133 /** |
|
134 * By default Symbian 2nd phase constructor is private. |
|
135 */ |
|
136 void ConstructL(); |
|
137 |
|
138 /** |
|
139 * Returns pointer to iSmsMtm member variable |
|
140 */ |
|
141 CSmsClientMtm* SmsMtmL(); |
|
142 |
|
143 /** |
|
144 * Moves message into outbox for sending and creates copies of SMS messages |
|
145 * into outbox in case of multiple recipients |
|
146 */ |
|
147 void MoveMessagesToOutboxL(); |
|
148 |
|
149 /** |
|
150 * Called in MoveMessagesToOutboxL, calls the actual moving |
|
151 * function |
|
152 */ |
|
153 TMsvId MoveMessageEntryL( TMsvId aTarget ); |
|
154 |
|
155 |
|
156 /** |
|
157 * Creates messages into the Outbox if there are several recipients |
|
158 * @param TMsvEntry& a reference to entry to be copied |
|
159 * @param CSmsNumber& a reference to CSmsNumber to be copied |
|
160 * @param CRichText& a reference to msg body contents |
|
161 * @return TMsvId of the created msg entry |
|
162 */ |
|
163 TMsvId CreateMessageInOutboxL( |
|
164 const TMsvEntry& aEntry, |
|
165 const CSmsNumber& aRecipient, |
|
166 const CRichText& aBody ); |
|
167 |
|
168 /** |
|
169 * Creates messages into the Outbox if there are several recipients |
|
170 * and the message is E-Mail over SMS message |
|
171 * @param aEntry a reference to entry to be copied |
|
172 * @param aAddress a reference to address to be copied |
|
173 * @return TMsvId of the created msg entry |
|
174 */ |
|
175 virtual TMsvId CreateMessageInOutboxL( |
|
176 const TMsvEntry& aEntry, |
|
177 const TDesC& aAddress ); |
|
178 |
|
179 |
|
180 /** |
|
181 * Calls the actual sending method of SMS Client MTM |
|
182 */ |
|
183 void SetScheduledSendingStateL( CMsvEntrySelection* aSelection ); |
|
184 |
|
185 /** |
|
186 * Extracts name and address |
|
187 */ |
|
188 void NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress ); |
|
189 |
|
190 /** |
|
191 * Creates text for TMsvEntry::iDescription. It could be subject or |
|
192 * if subject does not exist a beginning of the message body |
|
193 */ |
|
194 void ExtractDescriptionFromMessageL( |
|
195 const CSmsMessage& aMessage, |
|
196 TDes& aDescription, |
|
197 TInt aMaxLength); |
|
198 |
|
199 /** |
|
200 * Copies text from attachment into the body of the SMS |
|
201 */ |
|
202 void CreatePlainTextSMSL( RFile& aFile ); |
|
203 |
|
204 /** |
|
205 * Insert subject into the body of the SMS |
|
206 */ |
|
207 void InsertSubjectL( CSmsHeader& aHeader, CRichText& aText ); |
|
208 |
|
209 /** |
|
210 * Copies data from VCard attachment into body of the SMS |
|
211 */ |
|
212 void CreateVCardSMSL( RFile& aFile ); |
|
213 |
|
214 /** |
|
215 * Copies data from VCCalendar attachment into body of the SMS |
|
216 */ |
|
217 void CreateVCalSMSL( RFile& aFile ); |
|
218 |
|
219 /** |
|
220 * Checks service center address |
|
221 */ |
|
222 TBool ValidateSCNumberL(); |
|
223 |
|
224 /** |
|
225 * Checks service center address for E-Mail over SMS messages |
|
226 */ |
|
227 TBool ValidateSCNumberForEmailOverSmsL(); |
|
228 |
|
229 /** |
|
230 * Saves E-Mail specific information in header |
|
231 */ |
|
232 void FillEmailInformationDataL( CSmsHeader& aHeader, const TPtrC& aAddress ); |
|
233 |
|
234 /** |
|
235 * Checks if the address is E-Mail address |
|
236 */ |
|
237 TBool IsEmailAddress( const TPtrC& aAddress ) const; |
|
238 |
|
239 /** |
|
240 * Converts sms message to uni message format. |
|
241 * @param aId message id |
|
242 * @param [OUT]aMessage convergedmessage |
|
243 * @param aIsForward true if message is forwared |
|
244 */ |
|
245 void DoConvertFromL( TMsvId aId, ConvergedMessage* aMessage, TBool aIsForward ); |
|
246 |
|
247 /** |
|
248 * create Sms entry into draft folder |
|
249 */ |
|
250 TMsvId CreateNativeSmsL(); |
|
251 |
|
252 /** |
|
253 * set/update sms settings |
|
254 */ |
|
255 void SetSmsSettingsL(); |
|
256 |
|
257 /** |
|
258 * set data to the sms |
|
259 */ |
|
260 void SetSmsDataL(ConvergedMessage* message); |
|
261 |
|
262 /** |
|
263 * set recipient / subject to the message entry |
|
264 */ |
|
265 void SetSmsHeaderL(ConvergedMessage* message); |
|
266 |
|
267 /** |
|
268 * set body text from converged message into |
|
269 * message entry in store |
|
270 */ |
|
271 void SetSmsBodyL(ConvergedMessage* message); |
|
272 |
|
273 /** |
|
274 * set attachment info from converged message into |
|
275 * message entry in store |
|
276 */ |
|
277 void SetSmsAttachmentsL(ConvergedMessage* message); |
|
278 |
|
279 /** |
|
280 * create attachment in message store for the |
|
281 * message under composition |
|
282 * @param aFilePath file for which attachment is created |
|
283 * @param aStore message store |
|
284 */ |
|
285 void CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath); |
|
286 |
|
287 private: // Data |
|
288 |
|
289 /** |
|
290 * message service session |
|
291 * Owned |
|
292 */ |
|
293 CMsvSession* iSession; |
|
294 |
|
295 /** |
|
296 * Mtm registry |
|
297 * Owned |
|
298 */ |
|
299 CClientMtmRegistry* iMtmRegistry; |
|
300 |
|
301 /** |
|
302 * sms mtm |
|
303 * Owned |
|
304 */ |
|
305 CSmsClientMtm* iSmsMtm; |
|
306 |
|
307 /** |
|
308 * sms service id |
|
309 */ |
|
310 TMsvId iSmsServiceId; |
|
311 |
|
312 /** |
|
313 * sms header |
|
314 * Owned |
|
315 */ |
|
316 CSmsHeader* iSmsHeader; |
|
317 |
|
318 /** |
|
319 * Owned |
|
320 */ |
|
321 CParaFormatLayer* iParaFormatLayer; |
|
322 |
|
323 /** |
|
324 * Owned |
|
325 */ |
|
326 CCharFormatLayer* iCharFormatLayer; |
|
327 |
|
328 /** |
|
329 * Owned |
|
330 */ |
|
331 CRichText* iRichText; |
|
332 |
|
333 /** |
|
334 * recipient array |
|
335 * Owned |
|
336 */ |
|
337 CDesCArray* iRecipients; |
|
338 |
|
339 /** |
|
340 * flag for biomsg distinction |
|
341 */ |
|
342 TBool iBioMsg; |
|
343 |
|
344 enum TUniPluginPanic |
|
345 { |
|
346 EIllegalArguments |
|
347 }; |
|
348 |
|
349 /** |
|
350 * email gateway address/alias |
|
351 * Owned |
|
352 */ |
|
353 CSmsNumber* iEmailOverSmsC; |
|
354 |
|
355 /** |
|
356 * flag for setting unicodemode true/false |
|
357 */ |
|
358 TBool iUnicodeMode; |
|
359 |
|
360 /** |
|
361 * feature flag to check if offline is supported or not |
|
362 */ |
|
363 TBool iOfflineSupported; |
|
364 |
|
365 //Turkish SMS(PREQ2265) specific... |
|
366 TInt iCharSupportType; |
|
367 TSmsEncoding iAlternativeEncodingType; |
|
368 TBool iNLTFeatureSupport; |
|
369 |
|
370 /** |
|
371 * general utility class |
|
372 * Owned |
|
373 */ |
|
374 UniEditorGenUtils* iGenUtils; |
|
375 SessionEventHandler *iSessionHandler; |
|
376 }; |
|
377 |
|
378 inline void UniEditorSmsPluginPrivate::SetUnicodeMode( TBool aUnicodeMode ) |
|
379 { |
|
380 iUnicodeMode = aUnicodeMode; |
|
381 } |
|
382 |
|
383 #endif // __UNIEDITORSMSPLUGINPRIVATE_H |
|
384 |
|
385 // End of File |
|