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