60
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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: SMSI.CPP*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// Standard includes
|
|
21 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
|
22 |
#include <mtmuidsdef.hrh>
|
|
23 |
#endif
|
|
24 |
#include <mtmdef.h> // MTM specific definitions for constants
|
|
25 |
#include <eikon.rsg> // Standard resources
|
|
26 |
// Messaging includes
|
|
27 |
#include <msvuids.h> // Msv UIDs
|
|
28 |
// Specific includes
|
|
29 |
#include <MtmExtendedCapabilities.hrh>
|
|
30 |
#include <SMUM.rsg> // for resource IDs
|
|
31 |
#include <muiu.mbg> // bitmaps
|
|
32 |
#include <avkon.rsg> // for resource IDs
|
|
33 |
#include <StringLoader.h> // stringloader
|
|
34 |
#include "SMSI.H"
|
|
35 |
#include "SMSU.HRH" // for KMtmUiFunctionSimDialog
|
|
36 |
#include "smsui.pan" // for panics
|
|
37 |
|
|
38 |
#include <AknUtils.h>
|
|
39 |
#include <AknsUtils.h>
|
|
40 |
#include <AknsConstants.h>//skinned icon ids
|
|
41 |
#include <data_caging_path_literals.hrh>
|
|
42 |
|
|
43 |
#include <csmsaccount.h>
|
|
44 |
#include <centralrepository.h>
|
|
45 |
#include <messaginginternalcrkeys.h>
|
|
46 |
#include <smutset.h> // CSmsSettings
|
|
47 |
|
|
48 |
|
|
49 |
//For logging
|
|
50 |
#include "SmumLogging.h"
|
|
51 |
|
|
52 |
// LOCAL CONSTANTS AND MACROS
|
|
53 |
const TInt KSmsViewerUid = 0x100058bd;
|
|
54 |
const TInt KSmsiNumberOfZoomStates = 2; // Nothing to do with zoomstates, picture + mask = 2
|
|
55 |
//const TUid KUidMsgTypeSMS = {0x1000102C};// already defined in <smut.h>
|
|
56 |
const TInt KTBuf80Length=80;
|
|
57 |
// Impossible for the next two figures to be accurate - sizes of messages
|
|
58 |
// etc. depend greatly on the encoding/compression used on the message
|
|
59 |
// Approximated to be 30 submessages long default 7 bit encoded sms.
|
|
60 |
// Note : Rarely or newer used
|
|
61 |
const TInt KSmsiMaxTotalMsgSize = 153 * 30;
|
|
62 |
|
|
63 |
_LIT(KSmsiResourceFile, "SMUM");
|
|
64 |
// Correct path is added to literal when it is used.
|
|
65 |
_LIT(KBitmapFile, "muiu.MBM");
|
|
66 |
|
|
67 |
// MEMBER FUNCTIONS
|
|
68 |
|
|
69 |
// Factory constructor function
|
|
70 |
CSmsMtmUiData* CSmsMtmUiData::NewL( CRegisteredMtmDll& aRegisteredDll )
|
|
71 |
{
|
|
72 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::NewL");
|
|
73 |
CSmsMtmUiData* smsmtmuidata=new ( ELeave ) CSmsMtmUiData( aRegisteredDll );
|
|
74 |
CleanupStack::PushL( smsmtmuidata );
|
|
75 |
smsmtmuidata->ConstructL();
|
|
76 |
CleanupStack::Pop();
|
|
77 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::NewL");
|
|
78 |
return smsmtmuidata;
|
|
79 |
}
|
|
80 |
|
|
81 |
// C++ constructor can NOT contain any code, that
|
|
82 |
// might leave.
|
|
83 |
CSmsMtmUiData::CSmsMtmUiData( CRegisteredMtmDll& aRegisteredDll ):
|
|
84 |
CBaseMtmUiData( aRegisteredDll )
|
|
85 |
{
|
|
86 |
}
|
|
87 |
|
|
88 |
// Symbian OS default constructor can leave.
|
|
89 |
void CSmsMtmUiData::ConstructL()
|
|
90 |
{
|
|
91 |
CBaseMtmUiData::ConstructL();
|
|
92 |
//Initalize SMS Settings for the first time
|
|
93 |
TInt timeStamp = 0;
|
|
94 |
TBool deleteMsgToUknowPort = EFalse;
|
|
95 |
CSmsSettings* serviceSettings = CSmsSettings::NewL();
|
|
96 |
CleanupStack::PushL( serviceSettings );
|
|
97 |
CSmsAccount* smsAccount = CSmsAccount::NewLC();
|
|
98 |
CRepository* cenRepSession = CRepository::NewLC( KCRUidSmum );
|
|
99 |
|
|
100 |
if ( cenRepSession->Get( KSmumShowSMSCTimeStamp, timeStamp ) != KErrNone )
|
|
101 |
{
|
|
102 |
//In case of any error,set the default value to 0, so that device timestamp is used
|
|
103 |
timeStamp = 0;
|
|
104 |
SMUMLOGGER_WRITE("CSmsMtmUiData::ConstructL: cenRep get error");
|
|
105 |
}
|
|
106 |
SMUMLOGGER_WRITE_FORMAT("CSmsMtmUiData::ConstructL: cenRep timesatmp value:%d", timeStamp);
|
|
107 |
smsAccount->LoadSettingsL( *serviceSettings );
|
|
108 |
serviceSettings->SetUseServiceCenterTimeStampForDate(timeStamp);
|
|
109 |
|
|
110 |
if ( cenRepSession->Get( KSmsSettingsDiscardUnknownPortMsgs, deleteMsgToUknowPort ) != KErrNone )
|
|
111 |
{
|
|
112 |
//In case of any error,set the default value to EFalse, so that default behaviour could be used
|
|
113 |
deleteMsgToUknowPort = EFalse;
|
|
114 |
SMUMLOGGER_WRITE("CSmsMtmUiData::ConstructL: cenRep get error");
|
|
115 |
}
|
|
116 |
SMUMLOGGER_WRITE_FORMAT("CSmsMtmUiData::ConstructL: cenRep deleteMsgToUknowPort value:%d", deleteMsgToUknowPort);
|
|
117 |
serviceSettings->SetDiscardUnknownPortMessage(deleteMsgToUknowPort);
|
|
118 |
|
|
119 |
TRAPD( err, smsAccount->SaveSettingsL( *serviceSettings ) );
|
|
120 |
if( err != KErrNone)
|
|
121 |
{
|
|
122 |
SMUMLOGGER_WRITE_FORMAT("CSmsMtmUiData::ConstructL: Settings saving error status: %d", err);
|
|
123 |
}
|
|
124 |
CleanupStack::PopAndDestroy( 3, serviceSettings ); // serviceSettings, smsAccount, cenRepSession
|
|
125 |
}
|
|
126 |
|
|
127 |
// Destructor
|
|
128 |
CSmsMtmUiData::~CSmsMtmUiData()
|
|
129 |
{
|
|
130 |
}
|
|
131 |
|
|
132 |
// ---------------------------------------------------------
|
|
133 |
// CSmsMtmUiData::ContextIcon
|
|
134 |
//
|
|
135 |
// ---------------------------------------------------------
|
|
136 |
const CBaseMtmUiData::CBitmapArray& CSmsMtmUiData::ContextIcon(
|
|
137 |
const TMsvEntry& aContext,
|
|
138 |
TInt /*aStateFlags*/ ) const
|
|
139 |
{
|
|
140 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::ContextIcon");
|
|
141 |
__ASSERT_DEBUG(aContext.iMtm==KUidMsgTypeSMS, Panic(ESmsiWrongMtm));
|
|
142 |
__ASSERT_DEBUG(aContext.iType.iUid!=KUidMsvFolderEntryValue, Panic(ESmsiFoldersNotSupported));
|
|
143 |
__ASSERT_DEBUG(aContext.iType.iUid!=KUidMsvAttachmentEntryValue, Panic(ESmsiNoIconForAttachment));
|
|
144 |
|
|
145 |
// Return the set of icons appropriate to the current context
|
|
146 |
TInt bmpIndex;
|
|
147 |
if (aContext.iBioType!=0)
|
|
148 |
{
|
|
149 |
bmpIndex = aContext.Unread() ?
|
|
150 |
EMbmMuiuQgn_prop_mce_smart_unread : EMbmMuiuQgn_prop_mce_smart_read;
|
|
151 |
}
|
|
152 |
else
|
|
153 |
{
|
|
154 |
bmpIndex = aContext.Unread() ?
|
|
155 |
EMbmMuiuQgn_prop_mce_sms_unread : EMbmMuiuQgn_prop_mce_sms_read;
|
|
156 |
}
|
|
157 |
|
|
158 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::ContextIcon");
|
|
159 |
|
|
160 |
return *iIconArrays->At(( bmpIndex - EMbmMuiuQgn_prop_mce_sms_read ) / KSmsiNumberOfZoomStates );
|
|
161 |
}
|
|
162 |
|
|
163 |
// ---------------------------------------------------------
|
|
164 |
// CSmsMtmUiData::OperationSupportedL
|
|
165 |
//
|
|
166 |
// ---------------------------------------------------------
|
|
167 |
TInt CSmsMtmUiData::OperationSupportedL( TInt aOperationId, const TMsvEntry& aContext ) const
|
|
168 |
{
|
|
169 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::OperationSupportedL");
|
|
170 |
// SMS mtm client only has two functions which may be of use to the user
|
|
171 |
// NB as this implies, there are other functions.
|
|
172 |
switch (aOperationId)
|
|
173 |
{
|
|
174 |
case KMtmUiFunctionSimDialog:
|
|
175 |
return NULL;
|
|
176 |
case KMtmUiFunctionMessageInfo:
|
|
177 |
if (aContext.iType==KUidMsvMessageEntry)
|
|
178 |
{
|
|
179 |
return NULL;
|
|
180 |
}
|
|
181 |
break;
|
|
182 |
default:
|
|
183 |
break;
|
|
184 |
}
|
|
185 |
|
|
186 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::OperationSupportedL");
|
|
187 |
return R_EIK_TBUF_NOT_AVAILABLE;
|
|
188 |
}
|
|
189 |
|
|
190 |
// ---------------------------------------------------------
|
|
191 |
// CSmsMtmUiData::QueryCapability
|
|
192 |
//
|
|
193 |
// ---------------------------------------------------------
|
|
194 |
TInt CSmsMtmUiData::QueryCapability( TUid aFunctionId, TInt& aResponse ) const
|
|
195 |
{
|
|
196 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::QueryCapability");
|
|
197 |
TInt retVal = KErrNone;
|
|
198 |
switch ( aFunctionId.iUid )
|
|
199 |
{
|
|
200 |
case KUidMsvMtmUiQueryMessagingInitialisation:
|
|
201 |
aResponse = ETrue;
|
|
202 |
break;
|
|
203 |
|
|
204 |
case KUidMtmQuerySupportsBioMsgValue: // Supports sending of Bio messages
|
|
205 |
aResponse = ETrue;
|
|
206 |
break;
|
|
207 |
|
|
208 |
case KUidMtmQueryMaxBodySizeValue:
|
|
209 |
aResponse = KSmsiMaxTotalMsgSize; // See notes at the definition
|
|
210 |
break;
|
|
211 |
|
|
212 |
case KUidMtmQueryMaxTotalMsgSizeValue:
|
|
213 |
aResponse = KSmsiMaxTotalMsgSize; // See notes at the definition
|
|
214 |
break;
|
|
215 |
case KUidMtmQuerySupportedBodyValue:
|
|
216 |
aResponse = KMtm7BitBody | KMtm8BitBody | KMtm16BitBody;
|
|
217 |
break;
|
|
218 |
|
|
219 |
case KUidMsvMtmQueryViewerUidValue:
|
|
220 |
aResponse = KSmsViewerUid;
|
|
221 |
break;
|
|
222 |
|
|
223 |
case KMtmUiFunctionMessageInfo:
|
|
224 |
aResponse = KErrNone;
|
|
225 |
break;
|
|
226 |
|
|
227 |
case KUidMtmQueryCanSendMsgValue:
|
|
228 |
case KUidMtmQueryCanReceiveMsgValue:
|
|
229 |
break;
|
|
230 |
|
|
231 |
default:
|
|
232 |
retVal=KErrNotSupported;
|
|
233 |
break;
|
|
234 |
}
|
|
235 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::QueryCapability");
|
|
236 |
return retVal;
|
|
237 |
}
|
|
238 |
|
|
239 |
// ---------------------------------------------------------
|
|
240 |
// CSmsMtmUiData::PopulateArraysL
|
|
241 |
//
|
|
242 |
// ---------------------------------------------------------
|
|
243 |
void CSmsMtmUiData::PopulateArraysL()
|
|
244 |
{
|
|
245 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::PopulateArraysL");
|
|
246 |
// Read additional functions
|
|
247 |
ReadFunctionsFromResourceFileL( R_SMSI_FUNCTION_ARRAY );
|
|
248 |
CreateSkinnedBitmapsL( KSmsiNumberOfZoomStates );
|
|
249 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::PopulateArraysL");
|
|
250 |
}
|
|
251 |
|
|
252 |
// ---------------------------------------------------------
|
|
253 |
// CSmsMtmUiData::GetResourceFileName
|
|
254 |
//
|
|
255 |
// ---------------------------------------------------------
|
|
256 |
void CSmsMtmUiData::GetResourceFileName( TFileName& aFileName ) const
|
|
257 |
{
|
|
258 |
aFileName = KSmsiResourceFile;
|
|
259 |
}
|
|
260 |
|
|
261 |
// ---------------------------------------------------------
|
|
262 |
// CSmsMtmUiData::CanCreateEntryL
|
|
263 |
//
|
|
264 |
// ---------------------------------------------------------
|
|
265 |
TBool CSmsMtmUiData::CanCreateEntryL(
|
|
266 |
const TMsvEntry& aParent,
|
|
267 |
TMsvEntry& aNewEntry,
|
|
268 |
TInt& aReasonResourceId ) const
|
|
269 |
{
|
|
270 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanCreateEntryL");
|
|
271 |
__ASSERT_DEBUG( aNewEntry.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
|
|
272 |
|
|
273 |
// We can create an entry if it is a message under the local service
|
|
274 |
if( aNewEntry.iType == KUidMsvMessageEntry &&
|
|
275 |
aNewEntry.iMtm == KUidMsgTypeSMS &&
|
|
276 |
aParent.iType == KUidMsvFolderEntry )
|
|
277 |
{
|
|
278 |
aReasonResourceId = NULL;
|
|
279 |
return ETrue;
|
|
280 |
}
|
|
281 |
|
|
282 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
283 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::CanCreateEntryL");
|
|
284 |
return EFalse;
|
|
285 |
}
|
|
286 |
|
|
287 |
// ---------------------------------------------------------
|
|
288 |
// CSmsMtmUiData::CanDeleteServiceL
|
|
289 |
//
|
|
290 |
// ---------------------------------------------------------
|
|
291 |
TBool CSmsMtmUiData::CanDeleteServiceL(
|
|
292 |
const TMsvEntry& /*aService*/,
|
|
293 |
TInt& aReasonResourceId ) const
|
|
294 |
{
|
|
295 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanDeleteServiceL");
|
|
296 |
// these CanXXX functions not used in Series 60, except
|
|
297 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
298 |
// CanUnDeleteFromEntryL
|
|
299 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
300 |
SMUMLOGGER_LEAVEFN("CSmsMtmUiData::CanDeleteServiceL");
|
|
301 |
return EFalse;
|
|
302 |
}
|
|
303 |
|
|
304 |
// ---------------------------------------------------------
|
|
305 |
// CSmsMtmUiData::CanReplyToEntryL
|
|
306 |
//
|
|
307 |
// ---------------------------------------------------------
|
|
308 |
TBool CSmsMtmUiData::CanReplyToEntryL(
|
|
309 |
const TMsvEntry& aContext,
|
|
310 |
TInt& aReasonResourceId ) const
|
|
311 |
{
|
|
312 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanReplyToEntryL");
|
|
313 |
__ASSERT_DEBUG( aContext.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
|
|
314 |
if ( aContext.iMtm == KUidMsgTypeSMS
|
|
315 |
&& aContext.iType == KUidMsvMessageEntry
|
|
316 |
&& aContext.ReadOnly()
|
|
317 |
&& !aContext.iBioType )
|
|
318 |
{
|
|
319 |
return ETrue;
|
|
320 |
}
|
|
321 |
else
|
|
322 |
{
|
|
323 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
324 |
return EFalse;
|
|
325 |
}
|
|
326 |
}
|
|
327 |
|
|
328 |
|
|
329 |
// ---------------------------------------------------------
|
|
330 |
// CSmsMtmUiData::CanForwardEntryL
|
|
331 |
//
|
|
332 |
// ---------------------------------------------------------
|
|
333 |
TBool CSmsMtmUiData::CanForwardEntryL(
|
|
334 |
const TMsvEntry& aContext,
|
|
335 |
TInt& aReasonResourceId ) const
|
|
336 |
{
|
|
337 |
SMUMLOGGER_ENTERFN("CSmsMtmUiData::CanForwardEntryL");
|
|
338 |
__ASSERT_DEBUG( aContext.iMtm == KUidMsgTypeSMS, Panic( ESmsiWrongMtm ));
|
|
339 |
if ( aContext.iMtm == KUidMsgTypeSMS
|
|
340 |
&& aContext.iType == KUidMsvMessageEntry
|
|
341 |
&& aContext.ReadOnly()
|
|
342 |
&& !aContext.iBioType )
|
|
343 |
{
|
|
344 |
return ETrue;
|
|
345 |
}
|
|
346 |
else
|
|
347 |
{
|
|
348 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
349 |
return EFalse;
|
|
350 |
}
|
|
351 |
}
|
|
352 |
|
|
353 |
// ---------------------------------------------------------
|
|
354 |
// CSmsMtmUiData::CanEditEntryL
|
|
355 |
//
|
|
356 |
// ---------------------------------------------------------
|
|
357 |
TBool CSmsMtmUiData::CanEditEntryL(
|
|
358 |
const TMsvEntry& /*aContext*/,
|
|
359 |
TInt& aReasonResourceId ) const
|
|
360 |
{
|
|
361 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanEditEntryL");
|
|
362 |
// these CanXXX functions not used in Series 60, except
|
|
363 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
364 |
// CanUnDeleteFromEntryL
|
|
365 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
366 |
return EFalse;
|
|
367 |
}
|
|
368 |
|
|
369 |
// ---------------------------------------------------------
|
|
370 |
// CSmsMtmUiData::CanViewEntryL
|
|
371 |
//
|
|
372 |
// ---------------------------------------------------------
|
|
373 |
TBool CSmsMtmUiData::CanViewEntryL(
|
|
374 |
const TMsvEntry& /*aContext*/,
|
|
375 |
TInt& aReasonResourceId ) const
|
|
376 |
{
|
|
377 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanViewEntryL");
|
|
378 |
// these CanXXX functions not used in Series 60, except
|
|
379 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
380 |
// CanUnDeleteFromEntryL
|
|
381 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
382 |
return EFalse;
|
|
383 |
}
|
|
384 |
|
|
385 |
// ---------------------------------------------------------
|
|
386 |
// CSmsMtmUiData::CanOpenEntryL
|
|
387 |
//
|
|
388 |
// ---------------------------------------------------------
|
|
389 |
TBool CSmsMtmUiData::CanOpenEntryL(
|
|
390 |
const TMsvEntry& /*aContext*/,
|
|
391 |
TInt& aReasonResourceId ) const
|
|
392 |
{
|
|
393 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanOpenEntryL");
|
|
394 |
// these CanXXX functions not used in Series 60, except
|
|
395 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
396 |
// CanUnDeleteFromEntryL
|
|
397 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
398 |
return EFalse;
|
|
399 |
}
|
|
400 |
|
|
401 |
// ---------------------------------------------------------
|
|
402 |
// CSmsMtmUiData::CanCloseEntryL
|
|
403 |
//
|
|
404 |
// ---------------------------------------------------------
|
|
405 |
TBool CSmsMtmUiData::CanCloseEntryL(
|
|
406 |
const TMsvEntry& /*aContext*/,
|
|
407 |
TInt& aReasonResourceId ) const
|
|
408 |
{
|
|
409 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCloseEntryL");
|
|
410 |
// these CanXXX functions not used in Series 60, except
|
|
411 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
412 |
// CanUnDeleteFromEntryL
|
|
413 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
414 |
return EFalse;
|
|
415 |
}
|
|
416 |
|
|
417 |
// ---------------------------------------------------------
|
|
418 |
// CSmsMtmUiData::CanDeleteFromEntryL
|
|
419 |
//
|
|
420 |
// ---------------------------------------------------------
|
|
421 |
TBool CSmsMtmUiData::CanDeleteFromEntryL(
|
|
422 |
const TMsvEntry& /*aContext*/,
|
|
423 |
TInt& aReasonResourceId ) const
|
|
424 |
{
|
|
425 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanDeleteFromEntryL");
|
|
426 |
// these CanXXX functions not used in Series 60, except
|
|
427 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
428 |
// CanUnDeleteFromEntryL
|
|
429 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
430 |
return EFalse;
|
|
431 |
}
|
|
432 |
|
|
433 |
// ---------------------------------------------------------
|
|
434 |
// CSmsMtmUiData::CanCopyMoveToEntryL
|
|
435 |
//
|
|
436 |
// ---------------------------------------------------------
|
|
437 |
TBool CSmsMtmUiData::CanCopyMoveToEntryL(
|
|
438 |
const TMsvEntry& /*aContext*/,
|
|
439 |
TInt& aReasonResourceId ) const
|
|
440 |
{
|
|
441 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCopyMoveToEntryL");
|
|
442 |
// these CanXXX functions not used in Series 60, except
|
|
443 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
444 |
// CanUnDeleteFromEntryL
|
|
445 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
446 |
return EFalse;
|
|
447 |
}
|
|
448 |
|
|
449 |
// ---------------------------------------------------------
|
|
450 |
// CSmsMtmUiData::CanCopyMoveFromEntryL
|
|
451 |
//
|
|
452 |
// ---------------------------------------------------------
|
|
453 |
TBool CSmsMtmUiData::CanCopyMoveFromEntryL(
|
|
454 |
const TMsvEntry& /*aContext*/,
|
|
455 |
TInt& aReasonResourceId ) const
|
|
456 |
{
|
|
457 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCopyMoveFromEntryL");
|
|
458 |
// these CanXXX functions not used in Series 60, except
|
|
459 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
460 |
// CanUnDeleteFromEntryL
|
|
461 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
462 |
return EFalse;
|
|
463 |
}
|
|
464 |
|
|
465 |
// ---------------------------------------------------------
|
|
466 |
// CSmsMtmUiData::CanCancelL
|
|
467 |
//
|
|
468 |
// ---------------------------------------------------------
|
|
469 |
TBool CSmsMtmUiData::CanCancelL(
|
|
470 |
const TMsvEntry& /*aContext*/,
|
|
471 |
TInt& aReasonResourceId ) const
|
|
472 |
{
|
|
473 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CanCancelL");
|
|
474 |
// these CanXXX functions not used in Series 60, except
|
|
475 |
// CanCreateEntryL, CanReplyToEntryL, CanForwardEntryL and
|
|
476 |
// CanUnDeleteFromEntryL
|
|
477 |
aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE;
|
|
478 |
return EFalse;
|
|
479 |
}
|
|
480 |
|
|
481 |
// ---------------------------------------------------------
|
|
482 |
// CSmsMtmUiData::StatusTextL
|
|
483 |
//
|
|
484 |
// ---------------------------------------------------------
|
|
485 |
HBufC* CSmsMtmUiData::StatusTextL( const TMsvEntry& aContext ) const
|
|
486 |
{
|
|
487 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::StatusTextL");
|
|
488 |
|
|
489 |
TInt res = 0;
|
|
490 |
TUint sendingState = aContext.SendingState();
|
|
491 |
switch( sendingState )
|
|
492 |
{
|
|
493 |
case KMsvSendStateFailed:
|
|
494 |
res = R_QTN_MCE_OUTBOX_STATUS_FAILED;
|
|
495 |
break;
|
|
496 |
|
|
497 |
case KMsvSendStateUponRequest: // Mapped to be the same
|
|
498 |
case KMsvSendStateSuspended:
|
|
499 |
res = R_QTN_MCE_OUTBOX_STATUS_SUSPENDED;
|
|
500 |
break;
|
|
501 |
|
|
502 |
case KMsvSendStateScheduled: // Mapped to be the same
|
|
503 |
case KMsvSendStateWaiting:
|
|
504 |
res = R_QTN_MCE_OUTBOX_STATUS_WAITING;
|
|
505 |
break;
|
|
506 |
|
|
507 |
case KMsvSendStateResend:
|
|
508 |
res = R_QTN_MCE_OUTBOX_STATUS_RETRY_AT;
|
|
509 |
break;
|
|
510 |
|
|
511 |
case KMsvSendStateSending:
|
|
512 |
res = R_QTN_MCE_OUTBOX_STATUS_SENDING;
|
|
513 |
break;
|
|
514 |
|
|
515 |
case KMsvSendStateSent:
|
|
516 |
case KMsvSendStateNotApplicable:
|
|
517 |
res = 0;
|
|
518 |
break;
|
|
519 |
|
|
520 |
// Unknown
|
|
521 |
case KMsvSendStateUnknown:
|
|
522 |
default:
|
|
523 |
#ifdef _DEBUG
|
|
524 |
Panic( ESmsiMtmUdUnknownMsgStatus );
|
|
525 |
#endif
|
|
526 |
User::Leave( KErrNotSupported );
|
|
527 |
break;
|
|
528 |
}
|
|
529 |
|
|
530 |
if (!res)
|
|
531 |
{
|
|
532 |
return HBufC::NewL(0);
|
|
533 |
}
|
|
534 |
|
|
535 |
if ( sendingState == KMsvSendStateResend )
|
|
536 |
{
|
|
537 |
TBuf<KTBuf80Length> bufTimeFormat;
|
|
538 |
TBuf<KTBuf80Length> bufTimeFormatted;
|
|
539 |
StringLoader::Load(
|
|
540 |
bufTimeFormat, R_QTN_TIME_USUAL_WITH_ZERO, iCoeEnv );
|
|
541 |
|
|
542 |
TTime localTime = aContext.iDate;
|
|
543 |
TLocale locale;
|
|
544 |
// Add time difference
|
|
545 |
localTime += locale.UniversalTimeOffset();
|
|
546 |
if (locale.QueryHomeHasDaylightSavingOn())
|
|
547 |
{ // and possible daylight saving time
|
|
548 |
TTimeIntervalHours daylightSaving(1);
|
|
549 |
localTime += daylightSaving;
|
|
550 |
}
|
|
551 |
localTime.FormatL( bufTimeFormatted, bufTimeFormat );
|
|
552 |
AknTextUtils::LanguageSpecificNumberConversion( bufTimeFormatted );
|
|
553 |
SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::StatusTextL - 1");
|
|
554 |
return StringLoader::LoadL(
|
|
555 |
R_QTN_MCE_OUTBOX_STATUS_RETRY_AT, bufTimeFormatted, iCoeEnv );
|
|
556 |
}
|
|
557 |
else
|
|
558 |
{
|
|
559 |
SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::StatusTextL - 2");
|
|
560 |
return StringLoader::LoadL( res, iCoeEnv );
|
|
561 |
}
|
|
562 |
}
|
|
563 |
|
|
564 |
// ---------------------------------------------------------
|
|
565 |
// CSmsMtmUiData::CreateSkinnedBitmapsL
|
|
566 |
//
|
|
567 |
// ---------------------------------------------------------
|
|
568 |
void CSmsMtmUiData::CreateSkinnedBitmapsL( TInt aNumZoomStates )
|
|
569 |
{
|
|
570 |
SMUMLOGGER_ENTERFN(" CSmsMtmUiData::CreateSkinnedBitmapsL");
|
|
571 |
|
|
572 |
MAknsSkinInstance* skins = AknsUtils::SkinInstance();
|
|
573 |
TAknsItemID id;
|
|
574 |
CFbsBitmap* bitmap;
|
|
575 |
CFbsBitmap* bitmapMask;
|
|
576 |
TBool found = ETrue;
|
|
577 |
|
|
578 |
for( TInt i=EMbmMuiuQgn_prop_mce_sms_read; i<EMbmMuiuQgn_prop_mce_smart_unread_mask+1; i++ )
|
|
579 |
{
|
|
580 |
found = ETrue;
|
|
581 |
switch( i )
|
|
582 |
{
|
|
583 |
// Add to iIconArrays in this order
|
|
584 |
case EMbmMuiuQgn_prop_mce_sms_read:
|
|
585 |
id.Set( KAknsIIDQgnPropMceSmsRead );
|
|
586 |
break;
|
|
587 |
case EMbmMuiuQgn_prop_mce_sms_unread:
|
|
588 |
id.Set( KAknsIIDQgnPropMceSmsUnread );
|
|
589 |
break;
|
|
590 |
case EMbmMuiuQgn_prop_mce_smart_read:
|
|
591 |
id.Set( KAknsIIDQgnPropMceSmartRead );
|
|
592 |
break;
|
|
593 |
case EMbmMuiuQgn_prop_mce_smart_unread:
|
|
594 |
id.Set( KAknsIIDQgnPropMceSmartUnread );
|
|
595 |
break;
|
|
596 |
default:
|
|
597 |
found = EFalse;
|
|
598 |
break;
|
|
599 |
}
|
|
600 |
if( found )
|
|
601 |
{
|
|
602 |
CArrayPtrFlat<CFbsBitmap>* array =
|
|
603 |
new (ELeave) CArrayPtrFlat<CFbsBitmap>( aNumZoomStates );
|
|
604 |
CleanupStack::PushL( array );
|
|
605 |
array->SetReserveL( aNumZoomStates ); // AppendLs will not LEAVE
|
|
606 |
TParse tp;
|
|
607 |
tp.Set( KBitmapFile, &KDC_APP_BITMAP_DIR, NULL );
|
|
608 |
|
|
609 |
AknsUtils::CreateIconL( skins, id, bitmap,
|
|
610 |
bitmapMask, tp.FullName(), i, i + 1 );
|
|
611 |
|
|
612 |
array->AppendL(bitmap);
|
|
613 |
array->AppendL(bitmapMask);
|
|
614 |
iIconArrays->AppendL(array);
|
|
615 |
|
|
616 |
CleanupStack::Pop();//array
|
|
617 |
}
|
|
618 |
|
|
619 |
}
|
|
620 |
SMUMLOGGER_LEAVEFN(" CSmsMtmUiData::CreateSkinnedBitmapsL");
|
|
621 |
}
|
|
622 |
// End of File
|