|
1 // Copyright (c) 2005-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 // |
|
15 |
|
16 #ifndef __SMCMSTEPBASE_H__ |
|
17 #define __SMCMSTEPBASE_H__ |
|
18 |
|
19 #include "smcmserver.h" |
|
20 |
|
21 #include <mtmdef.h> |
|
22 #include <stdlib.h> |
|
23 #include <smsclnt.h> |
|
24 #include <systemmonitor/systemmonitor.h> |
|
25 #include <test/testexecutestepbase.h> |
|
26 #include <txtfmlyr.h> |
|
27 #include <txtrich.h> |
|
28 |
|
29 // User Data |
|
30 _LIT( KUserDataOriginal, "Welcome to the Forward and Reply test harness" ); |
|
31 _LIT( KUserDataReply, "This is the reply to the original message" ); |
|
32 _LIT( KUserDataForward, "This is the text added to the forward message" ); |
|
33 _LIT( KUserDataFind, "This is a send test.\näöå\n Cheers, Mico\n" ); |
|
34 |
|
35 // Phone numbers |
|
36 |
|
37 _LIT( KScriptItemSC1, "SC" ); |
|
38 _LIT( KScriptItemSC1Def, "+447785016005" ); |
|
39 |
|
40 _LIT( KScriptItemSC2, "radiolinja0" ); |
|
41 _LIT( KScriptItemSC2Def, "+358508771010" ); |
|
42 |
|
43 _LIT( KScriptItemSC3, "radiolinja1" ); |
|
44 _LIT( KScriptItemSC3Def, "+358508771010" ); |
|
45 |
|
46 const TInt KMaxBodyLength = KMsvMaxFindTextLength ; |
|
47 |
|
48 const TInt KUTC0 = 0; |
|
49 const TInt KUTCMin8 = -8; |
|
50 |
|
51 enum TMessageOperation |
|
52 { |
|
53 EOperationNone, |
|
54 EOperationReply, |
|
55 EOperationForward |
|
56 }; |
|
57 |
|
58 |
|
59 class TMessageSettings |
|
60 { |
|
61 public: |
|
62 TMessageOperation iOperation; |
|
63 TMsvId iOriginalBoxId; |
|
64 CSmsPDU::TSmsPDUType iOriginalSmsPDUType; |
|
65 TInt iOriginalBioType; |
|
66 }; |
|
67 |
|
68 class CSMCMStepBase : public CTestStep |
|
69 { |
|
70 public: |
|
71 virtual ~CSMCMStepBase( ); |
|
72 CSMCMStepBase( ); |
|
73 virtual TVerdict doTestStepPreambleL( ); |
|
74 |
|
75 protected: |
|
76 void ChangeLocale( TInt aHours ); |
|
77 |
|
78 TMsvId CreateEmailSmsMessageL( const TDesC& aEmailMessageData ); |
|
79 TMsvId CreateMessageAndEntryL( const TDesC& aUserData, TMessageSettings aSettings ); |
|
80 HBufC* CreateRandomLC( TInt aLen ) const; |
|
81 TVerdict PerformTestL( TMsvId aOriginalMessageId, |
|
82 const TDesC& aNewText, |
|
83 const TMessageSettings& aSettings ); |
|
84 TVerdict CompareMessagesL( TMsvId aOriginalMessageId, |
|
85 TMsvId aTargetMessageId, |
|
86 const TMessageSettings& aSettings ); |
|
87 void SetSettingsL( ); |
|
88 private: |
|
89 TMsvId PerformForwardOrReplyOperationL( TMessageOperation aOperation, |
|
90 TMsvId aInFolder ); |
|
91 protected: |
|
92 CClientMtmRegistry* iClientMtmRegistry; |
|
93 TMsvDummyObserver* iDummyObserver; |
|
94 CMsvSession* iServerSession; |
|
95 CSmsClientMtm* iSmsClientMtm; |
|
96 CMsvEntry* iMsvEntry; |
|
97 TMsvId iSmsServiceId; |
|
98 |
|
99 CSmsTestUtils* iSmsTestUtils; |
|
100 CActiveScheduler* iScheduler; |
|
101 }; |
|
102 |
|
103 #endif // __SMCMSTEPBASE_H__ |