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 getheadermms_test1 main |
|
29 |
#endif |
|
30 |
||
31 |
int getheadermms_test1(int, char**) |
|
32 |
{ |
|
33 |
||
34 |
__UHEAP_MARK; |
|
35 |
CMessagingService* test = (CMessagingService* ) CMessagingService::NewL() ; |
|
36 |
CleanupStack::PushL(test); |
|
37 |
||
38 |
CFilterParamInfo* filterParams = CFilterParamInfo::NewL(); |
|
39 |
CleanupStack::PushL(filterParams); |
|
40 |
||
41 |
_LIT(Kaddr1, "9008032761"); |
|
42 |
filterParams->AddFromL(Kaddr1); |
|
43 |
||
44 |
filterParams->SetSortType(EMsvSortByNone); |
|
45 |
||
46 |
filterParams->AddMtmL(_L("MMS")); |
|
47 |
_LIT(KSubject, "Hi this is MMS"); |
|
48 |
filterParams->SetSubjectL(KSubject); |
|
49 |
||
50 |
||
51 |
CMsvEntrySelection* entryselection = NULL ; |
|
52 |
||
53 |
||
54 |
||
55 |
TRAPD(errcode, test->GetIdListL(filterParams,0,NULL,entryselection)); |
|
56 |
||
57 |
if(errcode != KErrNone) |
|
58 |
return errcode; |
|
59 |
||
60 |
||
61 |
if(entryselection) |
|
62 |
CleanupStack::PushL(entryselection); |
|
63 |
||
64 |
||
65 |
||
66 |
TInt index = 0; |
|
67 |
TInt val = 0; |
|
68 |
TInt iter=0; |
|
69 |
for(;;) |
|
70 |
{ |
|
71 |
CMessageHeader* header = NULL; |
|
72 |
test->GetNextHeaderL(filterParams, entryselection, index, NULL, header); |
|
73 |
if(header) |
|
74 |
{ |
|
75 |
iter++; |
|
76 |
if((header->Mtm().FindF(_L("MMS")) != KErrNotFound) && (header->From().FindF(_L("9008032761")) != KErrNotFound) |
|
77 |
&& (header->Subject().FindF(KSubject)) != KErrNotFound ) |
|
78 |
val++; |
|
79 |
||
80 |
delete header; |
|
81 |
} |
|
82 |
else |
|
83 |
break; |
|
84 |
||
85 |
} |
|
86 |
||
87 |
||
88 |
||
89 |
if(entryselection) |
|
90 |
CleanupStack::PopAndDestroy(entryselection); |
|
91 |
||
92 |
CleanupStack::PopAndDestroy(filterParams); |
|
93 |
CleanupStack::PopAndDestroy(test); |
|
94 |
__UHEAP_MARKEND; |
|
95 |
||
96 |
if(iter == val) |
|
97 |
return KErrNone; |
|
98 |
else |
|
99 |
return KErrGeneral; |
|
100 |
||
101 |
||
102 |
||
103 |
} |