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