author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 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 the License "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 |
||
19 |
||
20 |
||
21 |
#include <e32base.h> |
|
22 |
////#include <senduiconsts.h> |
|
23 |
#include "messagingservice.h" |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
24 |
#include <badesca.h> |
19 | 25 |
#include "getheader.h" |
26 |
#include <f32file.h> |
|
27 |
#include "messageheader.h" |
|
28 |
||
29 |
#ifdef MAIN |
|
30 |
#define getheader_test2 main |
|
31 |
#endif |
|
32 |
||
33 |
||
34 |
||
35 |
||
36 |
int getheader_test2(int, char**) |
|
37 |
{ |
|
38 |
__UHEAP_MARK; |
|
39 |
CMessagingService* test = (CMessagingService* ) CMessagingService::NewL() ; |
|
40 |
CleanupStack::PushL(test); |
|
41 |
||
42 |
CFilterParamInfo* filterParams = CFilterParamInfo::NewL(); |
|
43 |
CleanupStack::PushL(filterParams); |
|
44 |
||
45 |
filterParams->SetSortType(EMsvSortByDate); |
|
46 |
filterParams->AddMtmL(_L("SMS")); |
|
47 |
||
48 |
CMsvEntrySelection* entryselection = NULL ; |
|
49 |
TRAPD(errcode, test->GetIdListL(filterParams,0,NULL,entryselection)); |
|
50 |
if(entryselection) |
|
51 |
CleanupStack::PushL(entryselection); |
|
52 |
if(errcode != KErrNone) |
|
53 |
return errcode; |
|
54 |
||
55 |
TInt index = 0; |
|
56 |
TInt val = 0; |
|
57 |
TInt iter=0; |
|
58 |
for(;;) |
|
59 |
{ |
|
60 |
CMessageHeader* header = NULL; |
|
61 |
test->GetNextHeaderL(filterParams, entryselection, index, NULL, header); |
|
62 |
if(header) |
|
63 |
{ |
|
64 |
iter++; |
|
65 |
if((header->Mtm().FindF(_L("SMS")) != KErrNotFound)) |
|
66 |
val++; |
|
67 |
||
68 |
delete header; |
|
69 |
} |
|
70 |
else |
|
71 |
break; |
|
72 |
||
73 |
} |
|
74 |
||
75 |
||
76 |
||
77 |
if(entryselection) |
|
78 |
CleanupStack::PopAndDestroy(entryselection); |
|
79 |
||
80 |
CleanupStack::PopAndDestroy(filterParams); |
|
81 |
CleanupStack::PopAndDestroy(test); |
|
82 |
__UHEAP_MARKEND; |
|
83 |
||
84 |
if(iter == val) |
|
85 |
return KErrNone; |
|
86 |
else |
|
87 |
return KErrGeneral; |
|
88 |
} |