1 // Copyright (c) 2002-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 CTestMessBase which is the base class for all |
|
15 // messaging test steps |
|
16 // |
|
17 // |
|
18 |
|
19 |
|
20 #if (!defined __TEST_MESS_BASE_H__) |
|
21 #define __TEST_MESS_BASE_H__ |
|
22 |
|
23 #include "Configuration.cfg" |
|
24 |
|
25 #include <msvapi.h> |
|
26 #include <smuthdr.h> |
|
27 #include <test/testexecutestepbase.h> |
|
28 #include <emsformatie.h> |
|
29 #include <emssoundie.h> |
|
30 #include <emsanimationie.h> |
|
31 #include <iapprefs.h> |
|
32 |
|
33 #include "TestMessProcessor.h" |
|
34 #include "TestMessTimer.h" |
|
35 |
|
36 #include <smut.h> |
|
37 #include <smutset.h> |
|
38 #include <etelmm.h> |
|
39 #if (defined CDMA_API_ENABLED) |
|
40 #include <SmsMessageWrappers.h> |
|
41 #include <SmsMessageSettings.h> |
|
42 #endif |
|
43 #include <smuthdr.h> |
|
44 |
|
45 #include <test/teststepsmoketest.h> |
|
46 //To check whether the reply quoted is set |
|
47 _LIT(KReplyQuoted, "SmsReplyQuoted"); |
|
48 |
|
49 const TUid KUidMsvSMSHeaderStream = {0x10001834}; |
|
50 const TUid KUidMsgFileInternetAccessPreferences = {0x1000924B}; |
|
51 const TUid KUidMsvDefaultServices = {0x100017FD}; |
|
52 |
|
53 const TInt KOneSecond = 1000000; |
|
54 |
|
55 class CParaFormatLayer; |
|
56 class CCharFormatLayer; |
|
57 class CRichText; |
|
58 |
|
59 class CTestMessBase : public CTestStepSmokeTest, private MMsvSessionObserver |
|
60 { |
|
61 public: |
|
62 CTestMessBase(TBool aSetDirectory); |
|
63 virtual ~CTestMessBase(); |
|
64 |
|
65 virtual TVerdict doTestStepPreambleL(); |
|
66 virtual TVerdict doTestStepPostambleL(); |
|
67 |
|
68 void SetEntryL(TMsvId aId); |
|
69 CMsvEntry& EntryL(); |
|
70 TBool HasEntry() const { return iEntry!=NULL; } |
|
71 const TMsvSelectionOrdering& SelectionOrdering() const { return iOrder; } |
|
72 CMsvSession& Session() const { return *iSession; } |
|
73 void PrintEntryL(CMsvEntry& aEntry); |
|
74 CEmsPreDefSoundIE* NewPreDefSoundL(const TDesC& aPreDefType); |
|
75 |
|
76 |
|
77 protected: |
|
78 // MMsvSessionObserver |
|
79 void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*); |
|
80 |
|
81 // Utilities |
|
82 static HBufC8* CopyToBuf8LC(const TDesC& aPtrC); |
|
83 static HBufC* CopyToBufLC(const TDesC8& aPtr8); |
|
84 void PrintTreeL(TMsvId aRoot); |
|
85 void IssueTimerRequest(); |
|
86 |
|
87 |
|
88 void PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader); |
|
89 |
|
90 //reads the schedule time from ini file |
|
91 TTimeIntervalMinutes ReadScheduleTime(); |
|
92 |
|
93 private: |
|
94 // PrintEntry helper functions |
|
95 void PrintStoreL(CMsvEntry& aEntry); |
|
96 void PrintStoreSmtpL(CMsvEntry& aEntry); |
|
97 void PrintStorePop3L(CMsvEntry& aEntry); |
|
98 void PrintStoreImap4L(CMsvEntry& aEntry); |
|
99 void PrintStoreSmsL(CMsvEntry& aEntry); |
|
100 |
|
101 // PrepareSmsHeaderFromIniFileL helper functions |
|
102 void SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment); |
|
103 void SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize); |
|
104 |
|
105 CEmsPreDefAnimationIE* NewPreDefAnimationL(const TDesC& aPreDefType); |
|
106 CFbsBitmap* NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize); |
|
107 |
|
108 protected: |
|
109 CMsvSession* iSession; |
|
110 CTestMessProcessor* iMessageProcessor; |
|
111 CParaFormatLayer* iParaFormatLayer; |
|
112 CCharFormatLayer* iCharFormatLayer; |
|
113 CRichText* iBodyText; |
|
114 TBool iBodyAvailable; |
|
115 |
|
116 |
|
117 private: |
|
118 TBool iCheckForSim; |
|
119 TBool iSetDirectory; |
|
120 CTestMessTimer* iMessageTimer; |
|
121 CActiveScheduler* iSchedular; |
|
122 CMsvEntry* iEntry; |
|
123 TMsvSelectionOrdering iOrder; |
|
124 }; |
|
125 |
|
126 #endif /* __TEST_MESS_BASE_H__ */ |
|