datacommsserver/networkcontroller/ts_common/EtelBehaviour.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     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 //
       
    15 
       
    16 #ifndef __ETELBEHAVIOUR_H__
       
    17 #define __ETELBEHAVIOUR_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "etel.h"
       
    21 #include "etelmm.h"
       
    22 #include "etelpckt.h"
       
    23 
       
    24 class CEtelBehaviourBase : public CBase
       
    25 	{
       
    26 public:
       
    27 	virtual ~CEtelBehaviourBase();
       
    28 
       
    29 	virtual TInt RTelServerLoadPhoneModule(const TDesC& aFileName) = 0;
       
    30 	virtual TInt RTelServerEnumeratePhones(TInt& aNoOfPhones) = 0;
       
    31 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName) = 0;
       
    32 	virtual TInt RTelServerGetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo) = 0;
       
    33 	virtual TInt RTelServerUnloadPhoneModule(const TDesC& aFileName) = 0;
       
    34 	virtual TInt RPhoneOpen(RTelServer& aSession,const TDesC& aName) = 0;
       
    35 	virtual void RPhoneCancelAsyncRequest(TInt aReqToCancel) = 0;
       
    36 	virtual TInt RPhoneGetCaps(RPhone::TCaps& aCaps) = 0;
       
    37 	virtual TInt RMobilePhoneGetCurrentMode(RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode) = 0;
       
    38 	virtual TInt RMobilePhoneGetMultimodeCaps(TUint32& aCaps) = 0;
       
    39 	virtual void RMobilePhoneGetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) = 0;
       
    40 	virtual void RMobilePhoneNotifySignalStrengthChange(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) = 0;
       
    41 	virtual TInt RPacketServiceOpen(RPhone& aPhone) = 0;
       
    42 	virtual void RPacketServiceCancelAsyncRequest(TInt aReqToCancel) = 0;
       
    43 	virtual TInt RPacketServiceGetStatus(RPacketService::TStatus& aPacketStatus) = 0;
       
    44 	virtual void RPacketServiceGetMSClass(TRequestStatus& aStatus, RPacketService::TMSClass& aCurrentClass, RPacketService::TMSClass& aMaxClass) = 0;
       
    45 	virtual void RPacketServiceGetNtwkRegStatus(TRequestStatus& aStatus, RPacketService::TRegistrationStatus& aRegistrationStatus) = 0;
       
    46 	virtual TInt RPacketServiceGetAttachMode(RPacketService::TAttachMode& aMode) = 0;
       
    47 
       
    48 protected:
       
    49 	CEtelBehaviourBase();
       
    50 	void CompleteCurrentRPhoneAsyncRequest(TInt aError);
       
    51 	void CompleteCurrentRPacketServiceAsyncRequest(TInt aError);
       
    52 
       
    53 protected:
       
    54 	TInt iCurrentRPhoneAsyncRequest;
       
    55 	TRequestStatus* iCurrentRPhoneRequestStatus;
       
    56 	TInt iCurrentRPacketServiceAsyncRequest;
       
    57 	TRequestStatus* iCurrentRPacketServiceRequestStatus;
       
    58 	};
       
    59 
       
    60 //
       
    61 // Utility classes for timing - borrowed from MTimer
       
    62 //
       
    63 class MTimerObserver
       
    64 	{
       
    65 public:
       
    66 	virtual void TimerComplete(TInt aStatus) = 0;
       
    67 	};
       
    68 
       
    69 class COneShotTimer : public CTimer
       
    70 	{
       
    71 public:
       
    72 	static COneShotTimer* NewL(MTimerObserver* aObserver);
       
    73 
       
    74 private:
       
    75 	COneShotTimer(MTimerObserver* aObserver);
       
    76 	void ConstructL();
       
    77 	virtual void RunL();
       
    78 
       
    79 private:
       
    80 	MTimerObserver *iObserver;
       
    81 	};
       
    82 
       
    83 class CEtelBehaviour : public CEtelBehaviourBase, public MTimerObserver
       
    84 	{
       
    85 public:
       
    86 	virtual ~CEtelBehaviour();
       
    87 	static CEtelBehaviour* NewL();
       
    88 
       
    89 	virtual TInt RTelServerLoadPhoneModule(const TDesC& aFileName);
       
    90 	virtual TInt RTelServerEnumeratePhones(TInt& aNoOfPhones);
       
    91 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
    92 	virtual TInt RTelServerGetPhoneInfo(const TInt aIndex,RTelServer::TPhoneInfo& aInfo);
       
    93 	virtual TInt RTelServerUnloadPhoneModule(const TDesC& aFileName);
       
    94 	virtual TInt RPhoneOpen(RTelServer& aSession,const TDesC& aName);
       
    95 	virtual void RPhoneCancelAsyncRequest(TInt aReqToCancel);
       
    96 	virtual TInt RPhoneGetCaps(RPhone::TCaps& aCaps);
       
    97 	virtual TInt RMobilePhoneGetCurrentMode(RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode);
       
    98 	virtual void RMobilePhoneGetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar);
       
    99 	virtual void RMobilePhoneNotifySignalStrengthChange(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar);
       
   100 	virtual TInt RMobilePhoneGetMultimodeCaps(TUint32& aCaps);
       
   101 	virtual TInt RPacketServiceOpen(RPhone& aPhone);
       
   102 	virtual void RPacketServiceCancelAsyncRequest(TInt aReqToCancel);
       
   103 	virtual TInt RPacketServiceGetStatus(RPacketService::TStatus& aPacketStatus);
       
   104 	virtual void RPacketServiceGetMSClass(TRequestStatus& aStatus, RPacketService::TMSClass& aCurrentClass, RPacketService::TMSClass& aMaxClass);
       
   105 	virtual void RPacketServiceGetNtwkRegStatus(TRequestStatus& aStatus, RPacketService::TRegistrationStatus& aRegistrationStatus);
       
   106 	virtual TInt RPacketServiceGetAttachMode(RPacketService::TAttachMode& aMode);
       
   107 
       
   108 	virtual void TimerComplete(TInt aStatus); 
       
   109 
       
   110 protected:
       
   111 	CEtelBehaviour();
       
   112 	void ConstructL();
       
   113 
       
   114 private:
       
   115 	COneShotTimer* iTimer;
       
   116 	};
       
   117 
       
   118 //
       
   119 //  ETEL behaviour for test case NC-4-9
       
   120 //
       
   121 class CTest0409Behaviour : public CEtelBehaviour
       
   122 	{
       
   123 public:
       
   124 	virtual ~CTest0409Behaviour();
       
   125 	static CTest0409Behaviour* NewL();
       
   126 
       
   127 	// override function from CEtelBehaviourBase
       
   128 	virtual TInt RTelServerLoadPhoneModule(const TDesC& aFileName);
       
   129 
       
   130 private:
       
   131 	CTest0409Behaviour();
       
   132 	void ConstructL();
       
   133 	};
       
   134 
       
   135 
       
   136 //
       
   137 //  ETEL behaviour for test case NC-4-11
       
   138 //
       
   139 class CTest0411Behaviour : public CEtelBehaviour
       
   140 	{
       
   141 public:
       
   142 	virtual ~CTest0411Behaviour();
       
   143 	static CTest0411Behaviour* NewL();
       
   144 
       
   145 	// override function from CEtelBehaviourBase
       
   146 	virtual TInt RPhoneOpen(RTelServer& aSession,const TDesC& aName);
       
   147 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
   148 
       
   149 private:
       
   150 	CTest0411Behaviour();
       
   151 	void ConstructL();
       
   152 	};
       
   153 
       
   154 
       
   155 //
       
   156 //  ETEL behaviour for test case NC-4-13
       
   157 //
       
   158 class CTest0413Behaviour : public CEtelBehaviour
       
   159 	{
       
   160 public:
       
   161 	virtual ~CTest0413Behaviour();
       
   162 	static CTest0413Behaviour* NewL();
       
   163 
       
   164 	// override function from CEtelBehaviourBase
       
   165 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
   166 	virtual TInt RPhoneGetCaps(RPhone::TCaps& aCaps);
       
   167 
       
   168 private:
       
   169 	CTest0413Behaviour();
       
   170 	void ConstructL();
       
   171 	};
       
   172 
       
   173 
       
   174 //
       
   175 //  ETEL behaviour for test case NC-4-15
       
   176 //
       
   177 class CTest0415Behaviour : public CEtelBehaviour
       
   178 	{
       
   179 public:
       
   180 	virtual ~CTest0415Behaviour();
       
   181 	static CTest0415Behaviour* NewL();
       
   182 
       
   183 	// override function from CEtelBehaviourBase
       
   184 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
   185 	virtual TInt RPacketServiceOpen(RPhone& aPhone);
       
   186 
       
   187 private:
       
   188 	CTest0415Behaviour();
       
   189 	void ConstructL();
       
   190 	};
       
   191 
       
   192 
       
   193 //
       
   194 //  ETEL behaviour for test case NC-4-17
       
   195 //
       
   196 class CTest0417Behaviour : public CEtelBehaviour
       
   197 	{
       
   198 public:
       
   199 	virtual ~CTest0417Behaviour();
       
   200 	static CTest0417Behaviour* NewL();
       
   201 
       
   202 	// override function from CEtelBehaviourBase
       
   203 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
   204 	virtual TInt RPacketServiceGetStatus(RPacketService::TStatus& aPacketStatus);
       
   205 
       
   206 private:
       
   207 	CTest0417Behaviour();
       
   208 	void ConstructL();
       
   209 	};
       
   210 
       
   211 
       
   212 //
       
   213 //  ETEL behaviour for test case NC-4-20
       
   214 //
       
   215 class CTest0420Behaviour : public CEtelBehaviour
       
   216 	{
       
   217 public:
       
   218 	virtual ~CTest0420Behaviour();
       
   219 	static CTest0420Behaviour* NewL();
       
   220 
       
   221 	// override function from CEtelBehaviourBase
       
   222 	virtual TInt RTelServerGetTsyName(const TInt aIndexOfPhone, TDes& aTsyName);
       
   223 	virtual TInt RPacketServiceGetAttachMode(RPacketService::TAttachMode& aMode);
       
   224 
       
   225 private:
       
   226 	CTest0420Behaviour();
       
   227 	void ConstructL();
       
   228 	};
       
   229 
       
   230 #endif // __ETELBEHAVIOUR_H__
       
   231