cbsref/telephonyrefplugins/atltsy/integrationtest/inc/testltsymodel.h
changeset 44 8b72faa1200f
equal deleted inserted replaced
39:2473f5e227f9 44:8b72faa1200f
       
     1 //  TestTelephonyModel.h
       
     2 //  Copyright (c) Symbian Software Ltd 2008. All rights reserved.
       
     3 //
       
     4 //  Implementation of the Class CTestTelephonyModel
       
     5 //
       
     6 #ifndef TESTTELEPHONYMODEL_H_
       
     7 #define TESTTELEPHONYMODEL_H_
       
     8 
       
     9 // system include
       
    10 #include <e32cmn.h>
       
    11 #include <e32des8.h>
       
    12 #include <etelmm.h>
       
    13 #include <etel.h>
       
    14 #include <etel3rdparty.h> 
       
    15 
       
    16 // forward class
       
    17 class CTestLtsySharedEnv;
       
    18 class CTestLtsyCallSharedData;
       
    19 class CTestLtsyPktSharedData;
       
    20 class CTestLtsySmsSharedData;
       
    21 class CTestLtsyPhoneStoreSharedData;
       
    22 
       
    23 // define the module name length
       
    24 const TUint8 KModuleNameLen = 200;
       
    25 
       
    26 
       
    27 /**
       
    28  * This class acts as a proxy to provide the functions to return the shared data
       
    29  * accross the steps.
       
    30  * 
       
    31  */
       
    32 class CTestLtsyModel : public CBase
       
    33 /**
       
    34  * @internalAll
       
    35  * @test
       
    36  */
       
    37 	{
       
    38 public:
       
    39 	static CTestLtsyModel* NewL();
       
    40 	~CTestLtsyModel();
       
    41 	inline CTestLtsySharedEnv& SharedEnv();
       
    42 	inline CTestLtsyCallSharedData& CallSharedData();
       
    43 	inline CTestLtsyPktSharedData&  PktSharedData();
       
    44 	inline CTestLtsySmsSharedData&  SmsSharedData();
       
    45 	inline CTestLtsyPhoneStoreSharedData& PhoneStoreSharedData();
       
    46 private:
       
    47 	void ConstructL();
       
    48 private:
       
    49 	CTestLtsySharedEnv* iSharedPhoneEnv;
       
    50 	CTestLtsyCallSharedData* iCallSharedData;
       
    51 	CTestLtsyPktSharedData*  iPktSharedData;
       
    52 	CTestLtsySmsSharedData* iSmsSharedData;
       
    53 	CTestLtsyPhoneStoreSharedData* iPhoneStoreSharedData;
       
    54 	};
       
    55 /**
       
    56  * This calss define a shared phone environment
       
    57  * 
       
    58  */
       
    59 class CTestLtsySharedEnv : public CBase
       
    60 /**
       
    61  * @internalAll
       
    62  * @test
       
    63  */
       
    64     { 
       
    65 public:
       
    66     ~CTestLtsySharedEnv();
       
    67 	static CTestLtsySharedEnv* NewL();
       
    68     inline RMobilePhone& Phone();
       
    69     inline RTelServer& ETelServer();
       
    70     inline TBool PhoneOpened();
       
    71     inline void IncreasePhoneReference();
       
    72     inline void DecreasePhoneReference();
       
    73     inline TInt PhoneRefCount();
       
    74 	void LoadModuleL(const TDesC& aModuleName);
       
    75 	void OpenPhoneL(const TDesC& aModuleName);
       
    76 	// must be called by client thread if it call OpenPhoneL()
       
    77 	void ClosePhone();
       
    78 	void CreateTelephonyL();
       
    79 	void DestroyTelephony();
       
    80 	CTelephony* Telephony();
       
    81 private:
       
    82     CTestLtsySharedEnv();
       
    83     void ConstructL();	
       
    84     TBool FindPhoneIndex();
       
    85 private:
       
    86 	TBuf<KModuleNameLen> iModuleName;
       
    87 	RMobilePhone* iSharedPhone;
       
    88 	TBool iPhoneInitialized;
       
    89 	RTelServer iSharedTelServer;
       
    90 	TInt iPhoneRef;
       
    91 	TInt iPhoneIndex;
       
    92 	CTelephony *iTelephony;
       
    93 //	RMmCustomAPI     *iRmmCustomAPI;
       
    94 	CActiveScheduler*  iActiveSchaduler;
       
    95 //    TBuf<KCommsDbSvrMaxFieldLength> iTsyNameFromCommdb;
       
    96 	};	
       
    97 
       
    98 #include "TestLtsyModel.inl"
       
    99 
       
   100 #endif /*TESTTELEPHONYMODEL_H_*/