1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This contains CTestMessProcessExistingMsg |
|
15 // Base class for processing an existing message |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file TestMessProcessExistingMsg.cpp |
|
21 */ |
|
22 |
|
23 #include "TestMessProcessExistingMsg.h" |
|
24 |
|
25 // EPOC includes |
|
26 #include <mtclreg.h> |
|
27 #include <miuthdr.h> |
|
28 #include <txtfmlyr.h> |
|
29 #include <txtrich.h> |
|
30 #include <miutmsg.h> |
|
31 |
|
32 /** |
|
33 * Constructor. |
|
34 * @return - None |
|
35 * |
|
36 */ |
|
37 CTestMessProcessExistingMsg::CTestMessProcessExistingMsg() |
|
38 : CTestMessBase(ETrue) |
|
39 { |
|
40 } |
|
41 |
|
42 /** |
|
43 * Override of base class pure virtual function |
|
44 * @return - TVerdict code |
|
45 * @leave - KErrNoMemory - memory allocatior failure |
|
46 * @leave - KErrBadLibraryEntryPoint - Malformed MTM |
|
47 * @leave - KErrNotFound - Not found the mtmUid and StepStepResult set to Fail |
|
48 * |
|
49 */ |
|
50 TVerdict CTestMessProcessExistingMsg::doTestStepL() |
|
51 { |
|
52 if ( TestStepResult() == EPass ) |
|
53 { |
|
54 CClientMtmRegistry* clientMtmRegistry=CClientMtmRegistry::NewL(*iSession); |
|
55 CleanupStack::PushL(clientMtmRegistry); |
|
56 |
|
57 iMtmID=EntryL().Entry().iMtm; |
|
58 |
|
59 CBaseMtm* baseMtm=clientMtmRegistry->NewMtmL(iMtmID); |
|
60 CleanupStack::PushL(baseMtm); |
|
61 |
|
62 // switch the context |
|
63 TMsvId msgId=EntryL().EntryId(); |
|
64 PrintEntryL(EntryL()); |
|
65 baseMtm->SwitchCurrentEntryL(msgId); |
|
66 baseMtm->LoadMessageL(); |
|
67 |
|
68 ProcessMessageL(*baseMtm, msgId); |
|
69 |
|
70 if ( TestStepResult() == EPass ) |
|
71 { |
|
72 PostProcessMessageL(); |
|
73 } |
|
74 |
|
75 CleanupStack::PopAndDestroy(2, clientMtmRegistry); |
|
76 } |
|
77 |
|
78 return TestStepResult(); |
|
79 } |
|
80 |
|
81 /** |
|
82 * Nothing done for open |
|
83 * @return None |
|
84 * @leave KErrNone and TestStepResult set to EFail |
|
85 * |
|
86 */ |
|
87 void CTestMessProcessExistingMsg::PostProcessMessageL() |
|
88 { |
|
89 } |
|