telephonyserverplugins/multimodetsy/Multimode/mnetwork.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2000-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 // MM TSY Network Header file.
       
    15 // Describes the GSM Network & Operator information.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalAll
       
    22 */
       
    23  
       
    24 #ifndef __MNETWORK_H__
       
    25 #define __MNETWORK_H__
       
    26 
       
    27 #include "mmlist.h"
       
    28 #include "ATBASE.H"
       
    29 #include "NOTIFY.H"
       
    30 
       
    31 /**
       
    32  * Determines GSM Network and Operator Information.
       
    33  *
       
    34  * CATNetworkInfo inherits from the CATCommands class. 
       
    35  * This class transmits the Set Network Operator Command (AT+COPS=x,x) in numeric, short 
       
    36  * alphanumeric and long alphanumeric formats. It also determines the current operator 
       
    37  * using the operator query command (AT+COPS?).
       
    38  */
       
    39 class CATNetworkInfo : public CATCommands
       
    40 	{
       
    41 public:
       
    42 
       
    43 	struct TTsyNetworkInfo
       
    44 		{
       
    45 		RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* iNetworkInfoPckg;
       
    46 		RMobilePhone::TMobilePhoneLocationAreaV1* iArea;
       
    47 		};
       
    48 	
       
    49 	static CATNetworkInfo* NewL(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
       
    50 	~CATNetworkInfo();
       
    51 
       
    52 	void CheckOperator();
       
    53 	void GetCurrentNetworkInfo(CATNetworkInfo::TTsyNetworkInfo* aNetworkInfo);
       
    54 
       
    55 
       
    56 private:
       
    57 	CATNetworkInfo(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
       
    58 	virtual void Complete(TInt aError, TEventSource aSource);
       
    59 
       
    60 	virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
       
    61 	virtual void Stop(TTsyReqHandle aTsyReqHandle);
       
    62 	virtual void EventSignal(TEventSource aSource);
       
    63 	virtual void CompleteWithIOError(TEventSource aSource, TInt aStatus);
       
    64 	
       
    65 	void StartGetOperator();
       
    66 	void InitializeNetworkInfo();		// Initialize TNetworkInfo struct
       
    67 	void ParseOperatorResponseL();		// Parse Operator Response
       
    68 	
       
    69 	
       
    70 	enum {
       
    71 		EATNotInProgress,
       
    72 		EATGetCurrentOperatorWriteComplete,
       
    73 		EATGetCurrentOperatorReadComplete,
       
    74 		EATNumericOperatorWaitForWriteComplete,		// Numeric Operator Format
       
    75 		EATSetNumericOperatorReadComplete,
       
    76 		EATShortOperatorWaitForWriteComplete,		// Short Alphanumeric Op. Format
       
    77 		EATSetShortOperatorReadComplete,		
       
    78 		EATLongOperatorWaitForWriteComplete,		// Long Alphanumeric Op. Format
       
    79 		EATSetLongOperatorReadComplete,
       
    80 		EATWaitForSettlingTimeout,
       
    81 		EATWaitForStopState
       
    82 		} iState;
       
    83 		
       
    84 	CPhoneGlobals* iPhoneGlobals;
       
    85 	TTsyNetworkInfo iNetworkInfo;
       
    86 	TBool iCancelled;
       
    87 	};
       
    88 
       
    89 // Notifications
       
    90 
       
    91 /**
       
    92  * \class CNotifyNetworkRegistrationStatusChange mnetwork.h "mmtsy/multimode/mnetwork.h"
       
    93  * \brief This is a Notification class. Handles a Registration status notification.
       
    94  *
       
    95  * CNotifyNetworkRegistrationStatusChange inherits from the CNotifyBase class defined in
       
    96  * notify.h.
       
    97  */
       
    98 class CNotifyNetworkRegistrationStatusChange : public CNotifyBase
       
    99 	{
       
   100 public:
       
   101 	static CNotifyNetworkRegistrationStatusChange* NewL(TTsyReqHandle aReqHandle,CTelObject* aTelObject,RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus);
       
   102 	~CNotifyNetworkRegistrationStatusChange();
       
   103 	virtual TBool CheckAndCompleteNotification(CTelObject* aTelObject,TEvent aEvent,TEvent aLastEvent);
       
   104 private:
       
   105 	CNotifyNetworkRegistrationStatusChange(TTsyReqHandle aReqHandle,CTelObject* aTelObject,RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus);
       
   106 	RMobilePhone::TMobilePhoneRegistrationStatus* iRegStatus;
       
   107 	};		
       
   108 
       
   109 /**
       
   110  * \class CCurrentNetworkChangedNotify mnetwork.h "mmtsy/multimode/mnetwork.h"
       
   111  * \brief This is a Notification class. Handles a Current network change notification.
       
   112  *
       
   113  * CCurrentNetworkChangedNotify inherits from the CNotifyBase class defined in
       
   114  * notify.h. CNotifyCurrentNetworkChange
       
   115  */
       
   116 class CNotifyCurrentNetworkChange : public CNotifyBase
       
   117 	{
       
   118 public:
       
   119 	static CNotifyCurrentNetworkChange* NewL(TTsyReqHandle aReqHandle,CTelObject* aTelObject,TInt* aInfo);
       
   120 	~CNotifyCurrentNetworkChange();
       
   121 	virtual TBool CheckAndCompleteNotification(CTelObject* aTelObject,TEvent aEvent,TEvent aLastEvent);
       
   122 private:
       
   123 	CNotifyCurrentNetworkChange(TTsyReqHandle aReqHandle,CTelObject* aTelObject,TInt* aInfo);
       
   124 	CATNetworkInfo::TTsyNetworkInfo iNetworkInfo;
       
   125 	};		
       
   126 
       
   127 /**
       
   128  * \class CATDetectNetwork mnetwork.h "mmtsy/multimode/mnetwork.h"
       
   129  * \brief Determines the Operators present in the GSM Network.
       
   130  *
       
   131  * CATDetectNetwork inherits from the CATCommands class. 
       
   132  * This class transmits the AT+COPS=? Command in order to determine all the Operators 
       
   133  * present in the GSM Network.
       
   134  */
       
   135 class CATDetectNetwork : public CATCommands
       
   136 	{
       
   137 public:
       
   138 	static CATDetectNetwork* NewL(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
       
   139 	~CATDetectNetwork();
       
   140 
       
   141 	void DetectNetworks(TTsyReqHandle aTsyReqHandle,TAny* aParams);
       
   142 	TInt ListNetworks(TDes8& aBuffer) const;
       
   143 
       
   144 	struct TTsyDetectedNetworks
       
   145 		{
       
   146 		TInt* iBufSize;		// Size of the streamed network list, in bytes.
       
   147 		CBufBase** iBufPtr;  // Streamed network list
       
   148 		};
       
   149 
       
   150 private:
       
   151 	CATDetectNetwork(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
       
   152 	virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
       
   153 	virtual void Stop(TTsyReqHandle aTsyReqHandle);
       
   154 	virtual void EventSignal(TEventSource aSource);
       
   155 	virtual void CompleteWithIOError(TEventSource aSource, TInt aStatus);
       
   156 	virtual void Complete(TInt aError, TEventSource aSource);
       
   157 
       
   158 	void ParseResponseL();
       
   159 private:
       
   160 	enum {
       
   161 		EATNotInProgress,
       
   162 		EATDetectWaitForWriteComplete,
       
   163 		EATDetectReadComplete,
       
   164 		EATDetectExtendedReadComplete,
       
   165 		EATWaitForStopState
       
   166 		} iState;
       
   167 
       
   168 	TTsyDetectedNetworks iDetectedNetworks;
       
   169 	};
       
   170 
       
   171 #endif