|
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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-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 |
|
21 /** |
|
22 @file TestMessProcessExistingMsg.cpp |
|
23 */ |
|
24 |
|
25 #include "TestMessProcessExistingMsg.h" |
|
26 |
|
27 // EPOC includes |
|
28 #include <mtclreg.h> |
|
29 #include <miuthdr.h> |
|
30 #include <txtfmlyr.h> |
|
31 #include <txtrich.h> |
|
32 #include <miutmsg.h> |
|
33 |
|
34 /** |
|
35 * Constructor. |
|
36 * @return - None |
|
37 * |
|
38 */ |
|
39 CTestMessProcessExistingMsg::CTestMessProcessExistingMsg() |
|
40 : CTestMessBase(ETrue) |
|
41 { |
|
42 } |
|
43 |
|
44 /** |
|
45 * Override of base class pure virtual function |
|
46 * @return - TVerdict code |
|
47 * @leave - KErrNoMemory - memory allocatior failure |
|
48 * @leave - KErrBadLibraryEntryPoint - Malformed MTM |
|
49 * @leave - KErrNotFound - Not found the mtmUid and StepStepResult set to Fail |
|
50 * |
|
51 */ |
|
52 TVerdict CTestMessProcessExistingMsg::doTestStepL() |
|
53 { |
|
54 if ( TestStepResult() == EPass ) |
|
55 { |
|
56 CClientMtmRegistry* clientMtmRegistry=CClientMtmRegistry::NewL(*iSession); |
|
57 CleanupStack::PushL(clientMtmRegistry); |
|
58 |
|
59 iMtmID=EntryL().Entry().iMtm; |
|
60 |
|
61 CBaseMtm* baseMtm=clientMtmRegistry->NewMtmL(iMtmID); |
|
62 CleanupStack::PushL(baseMtm); |
|
63 |
|
64 // switch the context |
|
65 TMsvId msgId=EntryL().EntryId(); |
|
66 PrintEntryL(EntryL()); |
|
67 baseMtm->SwitchCurrentEntryL(msgId); |
|
68 baseMtm->LoadMessageL(); |
|
69 |
|
70 ProcessMessageL(*baseMtm, msgId); |
|
71 |
|
72 if ( TestStepResult() == EPass ) |
|
73 { |
|
74 PostProcessMessageL(); |
|
75 } |
|
76 |
|
77 CleanupStack::PopAndDestroy(2, clientMtmRegistry); |
|
78 } |
|
79 |
|
80 return TestStepResult(); |
|
81 } |
|
82 |
|
83 /** |
|
84 * Nothing done for open |
|
85 * @return None |
|
86 * @leave KErrNone and TestStepResult set to EFail |
|
87 * |
|
88 */ |
|
89 void CTestMessProcessExistingMsg::PostProcessMessageL() |
|
90 { |
|
91 } |