author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:48:24 +0300 | |
branch | RCL_3 |
changeset 70 | 968773a0b6ef |
parent 64 | 3533d4323edc |
child 73 | c8382f7b54ef |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2007 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: CLS lists class implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "emailtrace.h" |
|
19 |
#include <eikenv.h> // CEikonEnv |
|
20 |
#include <centralrepository.h> // CRepository |
|
21 |
#include <AknFepInternalCRKeys.h> // KCRUidAknFep |
|
22 |
//<cmail> |
|
23 |
#include "cfsmailbox.h" // cfsmailbox |
|
24 |
//</cmail> |
|
25 |
#include <CPsRequestHandler.h> |
|
26 |
#include <CPsSettings.h> |
|
27 |
#include <VPbkEng.rsg> |
|
28 |
||
29 |
#include "FreestyleEmailUiCLSListsHandler.h" // CFSEmailUiClsListsHandler |
|
30 |
#include "FreestyleEMailUiCLSMatchObserverInterface.h"// CFSEmailUiClsContactMatchObserver |
|
31 |
#include "FreestyleEmailUiInputModeObserver.h" // CFSEmailUiInputModeObserver |
|
32 |
#include "FreestyleEmailUiUtilities.h" |
|
33 |
#include "FreestyleEmailUiCLSItem.h" |
|
34 |
||
35 |
// ================= MEMBER FUNCTIONS ========================================== |
|
36 |
// ----------------------------------------------------------------------------- |
|
37 |
// CFSEmailUiClsListsHandler::NewL |
|
38 |
// ----------------------------------------------------------------------------- |
|
39 |
CFSEmailUiClsListsHandler* CFSEmailUiClsListsHandler::NewL( RFs& aFs, |
|
40 |
CVPbkContactManager* aContactManager ) |
|
41 |
{ |
|
42 |
FUNC_LOG; |
|
43 |
CFSEmailUiClsListsHandler* object = |
|
44 |
CFSEmailUiClsListsHandler::NewLC( aFs, aContactManager ); |
|
45 |
CleanupStack::Pop( object ); |
|
46 |
return object; |
|
47 |
} |
|
48 |
||
49 |
// ----------------------------------------------------------------------------- |
|
50 |
// CFSEmailUiClsListsHandler::NewLC |
|
51 |
// ----------------------------------------------------------------------------- |
|
52 |
CFSEmailUiClsListsHandler* CFSEmailUiClsListsHandler::NewLC( RFs& aFs, CVPbkContactManager* aContactManager ) |
|
53 |
{ |
|
54 |
FUNC_LOG; |
|
55 |
CFSEmailUiClsListsHandler* object = new (ELeave) CFSEmailUiClsListsHandler( aFs, aContactManager ); |
|
56 |
CleanupStack::PushL( object ); |
|
57 |
object->ConstructL(); |
|
58 |
return object; |
|
59 |
} |
|
60 |
||
61 |
// ----------------------------------------------------------------------------- |
|
62 |
// CFSEmailUiClsListsHandler::~CFSEmailUiClsListsHandler |
|
63 |
// ----------------------------------------------------------------------------- |
|
64 |
CFSEmailUiClsListsHandler::~CFSEmailUiClsListsHandler() |
|
65 |
{ |
|
66 |
FUNC_LOG; |
|
67 |
delete iSearchedText; |
|
68 |
delete iPcsMatchObserver; |
|
69 |
||
70 |
iMatchingCompleteContacts.Reset(); |
|
71 |
iMatchingMRUContacts.Reset(); |
|
72 |
iMatchingMissingEmailContacts.Reset(); |
|
73 |
||
74 |
delete iAllMRUContacts; |
|
75 |
delete iInputObserver; |
|
76 |
delete iAknFepCenRep; |
|
77 |
delete iRequestHandler; |
|
78 |
} |
|
79 |
||
80 |
||
81 |
// ----------------------------------------------------------------------------- |
|
82 |
// CFSEmailUiClsListsHandler::UpdateContactMatchListsL |
|
83 |
// ----------------------------------------------------------------------------- |
|
84 |
void CFSEmailUiClsListsHandler::UpdateContactMatchListsL( |
|
85 |
const RPointerArray<CFSEmailUiClsItem>& aMatches ) |
|
86 |
{ |
|
87 |
FUNC_LOG; |
|
88 |
for( TInt i = 0 ; i < aMatches.Count() ; ++i ) |
|
89 |
{ |
|
90 |
if( aMatches[i]->IsMruItem() ) |
|
91 |
{ |
|
92 |
// If this is MRU item, we need to check that it doesn't |
|
93 |
// already exist in iMatchingCompleteContacts |
|
94 |
TInt itemIndex = FindDuplicate( *aMatches[i], iMatchingCompleteContacts ); |
|
95 |
if( itemIndex == KErrNotFound ) |
|
96 |
{ |
|
97 |
iMatchingMRUContacts.AppendL( aMatches[i] ); |
|
98 |
} |
|
99 |
||
100 |
} |
|
101 |
else if( aMatches[i]->EmailAddress().Length() > 0 ) |
|
102 |
{ |
|
103 |
// If this is Phonebook item, we need to check that it doesn't |
|
104 |
// already exist in iMatchingMRUContacts |
|
105 |
TInt itemIndex = FindDuplicate( *aMatches[i], iMatchingMRUContacts ); |
|
106 |
if( itemIndex != KErrNotFound ) |
|
107 |
{ |
|
108 |
// Found, this needs to be removed from the MRU list |
|
109 |
iMatchingMRUContacts.Remove( itemIndex ); |
|
110 |
} |
|
111 |
||
112 |
// Phonebook items are always added to the top of the list |
|
113 |
iMatchingCompleteContacts.AppendL( aMatches[i] ); |
|
114 |
} |
|
115 |
else |
|
116 |
{ |
|
117 |
// No email, nothing to compare, so add this always to the end of the list |
|
118 |
iMatchingMissingEmailContacts.AppendL( aMatches[i] ); |
|
119 |
} |
|
120 |
} |
|
121 |
||
122 |
RPointerArray<CFSEmailUiClsItem> allMatches = ConstructOneListL( iMatchingCompleteContacts, |
|
123 |
iMatchingMRUContacts, |
|
124 |
iMatchingMissingEmailContacts ); |
|
125 |
CleanupResetAndDestroyClosePushL( allMatches ); // Ownership is taken |
|
126 |
iClsListObserver->ArrayUpdatedL( allMatches ); |
|
127 |
CleanupStack::PopAndDestroy(&allMatches ); // Array is released, destructors are called |
|
128 |
} |
|
129 |
||
130 |
// ----------------------------------------------------------------------------- |
|
131 |
// CFSEmailUiClsListsHandler::InputModeChangedL |
|
132 |
// ----------------------------------------------------------------------------- |
|
133 |
void CFSEmailUiClsListsHandler::InputModeChangedL( TKeyboardModes aNewInputMode ) |
|
134 |
{ |
|
135 |
FUNC_LOG; |
|
136 |
iPcsMatchObserver->SetInputMode( aNewInputMode ); |
|
137 |
} |
|
138 |
||
139 |
||
140 |
// ----------------------------------------------------------------------------- |
|
141 |
// CFSEmailUiClsListsHandler::CurrentSearchText |
|
142 |
// ----------------------------------------------------------------------------- |
|
143 |
const TDesC& CFSEmailUiClsListsHandler::CurrentSearchText() |
|
144 |
{ |
|
145 |
FUNC_LOG; |
|
146 |
return *iSearchedText; |
|
147 |
} |
|
148 |
||
149 |
// ----------------------------------------------------------------------------- |
|
150 |
// CFSEmailUiClsListsHandler::SearchMatchesL |
|
151 |
// ----------------------------------------------------------------------------- |
|
152 |
void CFSEmailUiClsListsHandler::SearchMatchesL( const TDesC& aText ) |
|
153 |
{ |
|
154 |
FUNC_LOG; |
|
155 |
// The ownership of the object is in caller of UpdateContactMatchListsL |
|
156 |
iMatchingCompleteContacts.Reset(); |
|
157 |
iMatchingMRUContacts.Reset(); |
|
158 |
iMatchingMissingEmailContacts.Reset(); |
|
159 |
||
160 |
delete iSearchedText; |
|
161 |
iSearchedText = NULL; |
|
162 |
iSearchedText = aText.AllocL(); |
|
163 |
||
164 |
iPcsMatchObserver->SearchMatchesL( aText ); |
|
165 |
} |
|
166 |
||
167 |
||
168 |
// ----------------------------------------------------------------------------- |
|
169 |
// CFSEmailUiClsListsHandler::CFSEmailUiClsListsHandler |
|
170 |
// ----------------------------------------------------------------------------- |
|
171 |
CFSEmailUiClsListsHandler::CFSEmailUiClsListsHandler( RFs& aFs, CVPbkContactManager* aContactManager ) : |
|
172 |
iContactManager( aContactManager ), |
|
173 |
iClsListObserver( NULL ), |
|
174 |
iFs( aFs ), |
|
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
175 |
iMailBox ( NULL ), |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
176 |
iUseLastNameFirstOrder( EFalse ) |
64 | 177 |
{ |
178 |
FUNC_LOG; |
|
179 |
// Nothing |
|
180 |
} |
|
181 |
||
182 |
// ----------------------------------------------------------------------------- |
|
183 |
// CFSEmailUiClsListsHandler::ConstructL |
|
184 |
// ----------------------------------------------------------------------------- |
|
185 |
void CFSEmailUiClsListsHandler::ConstructL() |
|
186 |
{ |
|
187 |
FUNC_LOG; |
|
188 |
iRequestHandler = CPSRequestHandler::NewL(); |
|
189 |
||
190 |
iAknFepCenRep = CRepository::NewL( KCRUidAknFep ); |
|
191 |
||
192 |
iPcsMatchObserver = CFSEmailUiClsMatchObserver::NewL( *iAknFepCenRep, *this, *iRequestHandler, iContactManager ); |
|
193 |
SetSearchSettingsForPcsMatchObserverL(); |
|
194 |
||
195 |
// Monitors inputMode changes (predictive vs. non-predictive |
|
196 |
iInputObserver = CFSEmailUiInputModeObserver::NewL( *iAknFepCenRep, *this ); |
|
197 |
||
198 |
if( !iSearchedText ) |
|
199 |
iSearchedText = KNullDesC().AllocL(); |
|
200 |
||
201 |
//iRemoteLookupSupported = TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ); |
|
202 |
} |
|
203 |
||
204 |
// ----------------------------------------------------------------------------- |
|
205 |
// CFSEmailUiClsListsHandler::CopyClsItemL |
|
206 |
// ----------------------------------------------------------------------------- |
|
207 |
CFSEmailUiClsItem* CFSEmailUiClsListsHandler::CopyClsItemLC( |
|
208 |
const CFSEmailUiClsItem& aClsItem ) |
|
209 |
{ |
|
210 |
FUNC_LOG; |
|
211 |
CFSEmailUiClsItem* newClsItem = aClsItem.CloneLC(); |
|
212 |
return newClsItem; |
|
213 |
} |
|
214 |
||
215 |
// ----------------------------------------------------------------------------- |
|
216 |
// CFSEmailUiClsListsHandler::ReadCLSInfoFromMRUListIndexL |
|
217 |
// ----------------------------------------------------------------------------- |
|
218 |
TBool CFSEmailUiClsListsHandler::ReadCLSInfoFromMRUListIndexL( MDesCArray& aTextArray, |
|
219 |
CFSEmailUiClsItem& aClsItem, |
|
220 |
const TInt aCurrentMatchIndex, const TInt aPreviousMatchIndex ) |
|
221 |
{ |
|
222 |
FUNC_LOG; |
|
223 |
TBool retVal = EFalse; |
|
224 |
// This should be even number |
|
225 |
TInt currentRealItemIndex = aCurrentMatchIndex - ( aCurrentMatchIndex % 2 ); |
|
226 |
// Here we need to check if match is found both from the display name and email address |
|
227 |
if( currentRealItemIndex != aPreviousMatchIndex ) |
|
228 |
{ |
|
229 |
aClsItem.SetDisplayNameL( aTextArray.MdcaPoint( currentRealItemIndex ) ); |
|
230 |
aClsItem.SetEmailAddressL( aTextArray.MdcaPoint( currentRealItemIndex + 1 ) ); |
|
231 |
retVal = ETrue; |
|
232 |
} |
|
233 |
return retVal; |
|
234 |
} |
|
235 |
||
236 |
||
237 |
// ----------------------------------------------------------------------------- |
|
238 |
// CFSEmailUiClsListsHandler::FindAndDestroyDuplicate |
|
239 |
// ----------------------------------------------------------------------------- |
|
240 |
TInt CFSEmailUiClsListsHandler::FindDuplicate( const CFSEmailUiClsItem& aClsItem, |
|
241 |
RPointerArray<CFSEmailUiClsItem>& aContacts ) |
|
242 |
{ |
|
243 |
FUNC_LOG; |
|
244 |
// find duplicate email addresses from aContacts |
|
245 |
const TDesC& emailAddress = aClsItem.EmailAddress(); |
|
246 |
||
247 |
for( TInt i = 0; i < aContacts.Count(); ++i ) |
|
248 |
{ |
|
249 |
const TDesC& currentItemEmailAddress = aContacts[i]->EmailAddress(); |
|
250 |
||
251 |
if( emailAddress.CompareF( currentItemEmailAddress ) == 0 ) |
|
252 |
{ |
|
253 |
return i; |
|
254 |
} |
|
255 |
} |
|
256 |
||
257 |
return KErrNotFound; |
|
258 |
} |
|
259 |
||
260 |
// ----------------------------------------------------------------------------- |
|
261 |
// CFSEmailUiClsListsHandler::ConstructOneListL |
|
262 |
// ----------------------------------------------------------------------------- |
|
263 |
RPointerArray<CFSEmailUiClsItem> CFSEmailUiClsListsHandler::ConstructOneListL( |
|
264 |
const RPointerArray<CFSEmailUiClsItem>& aContactMatchesWithEmail, |
|
265 |
const RPointerArray<CFSEmailUiClsItem>& aMRUMatches, |
|
266 |
const RPointerArray<CFSEmailUiClsItem>& aContactMatchesWithoutEmail ) |
|
267 |
{ |
|
268 |
FUNC_LOG; |
|
269 |
RPointerArray<CFSEmailUiClsItem> allMatches; |
|
270 |
CleanupResetAndDestroyClosePushL( allMatches ); |
|
271 |
||
272 |
// Copy all the objects from three other lists to the all matches list |
|
273 |
TInt matchingComleteItemsCount = aContactMatchesWithEmail.Count(); |
|
274 |
for( TInt i = 0 ; i < matchingComleteItemsCount; i++ ) |
|
275 |
{ |
|
276 |
CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aContactMatchesWithEmail[i] ); |
|
277 |
allMatches.AppendL( newClsItem ); |
|
278 |
CleanupStack::Pop( newClsItem ); |
|
279 |
} |
|
280 |
||
281 |
TInt matchingMRUItemsCount = aMRUMatches.Count(); |
|
282 |
for ( TInt i = 0 ; i < matchingMRUItemsCount ; i++ ) |
|
283 |
{ |
|
284 |
CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aMRUMatches[i] ); |
|
285 |
allMatches.AppendL( newClsItem ); |
|
286 |
CleanupStack::Pop( newClsItem ); |
|
287 |
} |
|
288 |
||
289 |
TInt mathingContactItemsWithoutEmailCount = aContactMatchesWithoutEmail.Count(); |
|
290 |
for( TInt i = 0 ; i < mathingContactItemsWithoutEmailCount ; i++ ) |
|
291 |
{ |
|
292 |
CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aContactMatchesWithoutEmail[i] ); |
|
293 |
allMatches.AppendL( newClsItem ); |
|
294 |
CleanupStack::Pop( newClsItem ); |
|
295 |
} |
|
296 |
||
297 |
CleanupStack::Pop( &allMatches ); |
|
298 |
return allMatches; |
|
299 |
} |
|
300 |
||
301 |
// ----------------------------------------------------------------------------- |
|
302 |
// CFSEmailUiClsListsHandler::SetSearchSettingsForPcsMatchObserverL() |
|
303 |
// ----------------------------------------------------------------------------- |
|
304 |
void CFSEmailUiClsListsHandler::SetSearchSettingsForPcsMatchObserverL() |
|
305 |
{ |
|
306 |
FUNC_LOG; |
|
307 |
// Create predictive search settings |
|
308 |
CPsSettings* searchSettings = CPsSettings::NewL(); |
|
309 |
CleanupStack::PushL(searchSettings); |
|
310 |
||
311 |
RPointerArray<TDesC> databases; |
|
312 |
CleanupClosePushL(databases); |
|
313 |
||
314 |
HBufC* store1 = HBufC::NewLC(50); |
|
315 |
store1->Des().Copy( KVPbkDefaultCntDbURI ); // To specify phone contacts store |
|
316 |
||
317 |
databases.AppendL(store1); |
|
318 |
HBufC* store2 = NULL; |
|
319 |
if ( iMailBox ) |
|
320 |
{ |
|
321 |
store2 = HBufC::NewLC(50); |
|
322 |
GetMruDatastoreUriFromMailbox( *iMailBox, *store2 ); |
|
323 |
databases.AppendL( store2 ); |
|
324 |
} |
|
325 |
searchSettings->SetSearchUrisL(databases); |
|
326 |
||
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
327 |
// Set displayfields according to sort order |
64 | 328 |
RArray<TInt> sortOrder; |
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
329 |
CleanupClosePushL( sortOrder ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
330 |
iRequestHandler->GetSortOrderL( *store1, sortOrder ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
331 |
if ( sortOrder.Count() ) |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
332 |
{ |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
333 |
iUseLastNameFirstOrder = ( sortOrder[0] == R_VPBK_FIELD_TYPE_LASTNAME ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
334 |
} |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
335 |
else |
64 | 336 |
{ |
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
337 |
iUseLastNameFirstOrder = EFalse; // default is not to change order |
64 | 338 |
} |
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
339 |
RArray<TInt> displayFields( 6 ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
340 |
CleanupClosePushL( displayFields ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
341 |
displayFields.AppendL( sortOrder[0] ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
342 |
if ( sortOrder.Count() >= 1 ) displayFields.AppendL( sortOrder[1] ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
343 |
displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILGEN ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
344 |
displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILHOME ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
345 |
displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILWORK ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
346 |
searchSettings->SetDisplayFieldsL( displayFields ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
347 |
CleanupStack::Pop( &displayFields ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
348 |
CleanupStack::Pop( &sortOrder ); |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
349 |
displayFields.Close(); |
64 | 350 |
sortOrder.Close(); |
351 |
||
352 |
// Set maximum for search results |
|
353 |
//How many results is shown on the screen?? |
|
354 |
//searchSettings->SetMaxResults(const TInt aMaxResults); |
|
355 |
||
356 |
// Set the new search settings |
|
357 |
iRequestHandler->SetSearchSettingsL(*searchSettings); |
|
358 |
||
359 |
if ( store2 ) |
|
360 |
{ |
|
361 |
CleanupStack::PopAndDestroy(store2); |
|
362 |
} |
|
363 |
CleanupStack::PopAndDestroy(store1); |
|
364 |
CleanupStack::Pop(&databases); |
|
365 |
databases.Close(); |
|
366 |
CleanupStack::PopAndDestroy(searchSettings); |
|
367 |
||
368 |
} |
|
369 |
||
370 |
// ----------------------------------------------------------------------------- |
|
371 |
// CFSEmailUiClsListsHandler::isLanguageSupported() |
|
372 |
// ----------------------------------------------------------------------------- |
|
373 |
TBool CFSEmailUiClsListsHandler::IsLanguageSupportedL() |
|
374 |
{ |
|
375 |
FUNC_LOG; |
|
376 |
// Get the current language |
|
377 |
TLanguage lang = User::Language(); |
|
378 |
||
379 |
// Check for language support |
|
380 |
return iRequestHandler->IsLanguageSupportedL(lang); |
|
381 |
} |
|
382 |
||
383 |
void CFSEmailUiClsListsHandler::GetMruDatastoreUriFromMailbox( CFSMailBox& aMailbox, HBufC& aUri ) |
|
384 |
{ |
|
385 |
FUNC_LOG; |
|
386 |
aUri.Des().Copy( KDefaultMailBoxURI ); |
|
387 |
aUri.Des().AppendNum( aMailbox.GetId().PluginId().iUid ); |
|
388 |
aUri.Des().Append( KDefaultMailBoxURISeparator ); |
|
389 |
aUri.Des().AppendNum( aMailbox.GetId().Id() ); |
|
390 |
} |
|
391 |
||
392 |
void CFSEmailUiClsListsHandler::SetObserver( MFSEmailUiClsListsObserver* aClsListObserver ) |
|
393 |
{ |
|
394 |
FUNC_LOG; |
|
395 |
iClsListObserver = aClsListObserver; |
|
396 |
} |
|
397 |
||
398 |
void CFSEmailUiClsListsHandler::SetCurrentMailboxL( CFSMailBox* aMailBox ) |
|
399 |
{ |
|
400 |
FUNC_LOG; |
|
401 |
TFSMailMsgId currentMailboxId; |
|
402 |
TFSMailMsgId newMailboxId; |
|
403 |
||
404 |
if( iMailBox ) |
|
405 |
{ |
|
406 |
currentMailboxId = iMailBox->GetId(); |
|
407 |
} |
|
408 |
if( aMailBox ) |
|
409 |
{ |
|
410 |
newMailboxId = aMailBox->GetId(); |
|
411 |
} |
|
412 |
||
413 |
if( currentMailboxId != newMailboxId ) |
|
414 |
{ |
|
415 |
iMailBox = aMailBox; |
|
416 |
SetSearchSettingsForPcsMatchObserverL(); |
|
417 |
} |
|
418 |
} |
|
419 |
||
420 |
void CFSEmailUiClsListsHandler::OperationErrorL( TInt aErrorCode ) |
|
421 |
{ |
|
422 |
FUNC_LOG; |
|
423 |
iClsListObserver->OperationErrorL( aErrorCode ); |
|
424 |
} |
|
425 |
||
70
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
426 |
TBool CFSEmailUiClsListsHandler::UseLastNameFirstOrder() |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
427 |
{ |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
428 |
FUNC_LOG; |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
429 |
return iUseLastNameFirstOrder; |
968773a0b6ef
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
430 |
} |