cbsref/telephonyrefplugins/atltsy/atcommand/phone/inc/getcurrentnetworkinfo.h
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     1 // Copyright (c) 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 // @file getcurrentnetworkinfo.h
       
    15 // 
       
    16 
       
    17 #ifndef __GETCURRENTNETWORKINFO_H__
       
    18 #define __GETCURRENTNETWORKINFO_H__
       
    19 
       
    20 //user include
       
    21 #include "atcommandcontrolbase.h"
       
    22 #include "athelpercommand.h"
       
    23 
       
    24 // forward class
       
    25 class CATNetworkInfo;
       
    26 class CATHelperCommand;
       
    27 
       
    28 /**
       
    29  * CGetCurrentNetworkInfo inherits from the CATCommandControlBase class. 
       
    30  *
       
    31  */
       
    32 class CGetCurrentNetworkInfo : public CATCommandControlBase
       
    33 {
       
    34 public:
       
    35     /**
       
    36      * Two-phased constructor.
       
    37      * @param aGloblePhone
       
    38 	 * @param aCtsyDispatcherCallback
       
    39      */ 
       
    40 	static CGetCurrentNetworkInfo* NewL(CGlobalPhonemanager& aGloblePhone, 
       
    41 		                          CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    42 	/**
       
    43 	 * Destructor
       
    44 	 *
       
    45 	 */
       
    46 	~CGetCurrentNetworkInfo();
       
    47 	virtual void AtCommandExecuteComplete(TAtEventSource aEventSource, TInt aStatus);
       
    48 	void StartRequest();
       
    49 	/**
       
    50 	 * Get the return value executed AT Command
       
    51 	 */
       
    52 	RMobilePhone::TMobilePhoneNetworkInfoV5 GetNetWorkInfo();
       
    53 	/**
       
    54 	 * Get error value executed AT Command
       
    55 	 */
       
    56 	TInt GetErrorValue();
       
    57 	
       
    58 protected:
       
    59 	/**
       
    60 	 * Constructor
       
    61 	 *
       
    62 	 * @param aGloblePhone
       
    63 	 * @param aCtsyDispatcherCallback
       
    64 	 */
       
    65 	CGetCurrentNetworkInfo(CGlobalPhonemanager& aGloblePhone, 
       
    66 		             CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    67 	/**
       
    68 	 * 2nd Constructor
       
    69 	 */
       
    70 	void ConstructL();
       
    71 	
       
    72 private:
       
    73     /**
       
    74      * Start the AT command
       
    75      */
       
    76 	void StartATCommand(CAtCommandBase* aAtCommand);
       
    77 	
       
    78 	/**
       
    79 	 * Complete AT command
       
    80 	 */
       
    81 	void CompeteATCommand(CAtCommandBase* aAtCommand);
       
    82 	
       
    83 	/**
       
    84 	 * Set long name format for modem
       
    85 	 */
       
    86 	void SetLongNameFormat();
       
    87 	
       
    88 	/**
       
    89 	 * Get the long name from modem
       
    90 	 */
       
    91 	void GetNetworkLongName();
       
    92 	
       
    93 	/**
       
    94 	 * Set short name format for modem
       
    95 	 */
       
    96 	void SetShortNameFormat();
       
    97 	
       
    98 	/**
       
    99 	 * Get the short name from modem
       
   100 	 */
       
   101 	void GetNetworkShortName();
       
   102 	
       
   103 	/**
       
   104 	 * Set numberic format
       
   105 	 */
       
   106 	void SetNumbericFormat();
       
   107 	
       
   108 	/**
       
   109 	 * Get the country code and network Id
       
   110 	 */
       
   111 	void GetCountryCodeAndNetworkId();
       
   112 	
       
   113 	/**
       
   114 	 * Handle the error
       
   115 	 */
       
   116 	void HandleGetCurNetworkError(TInt aError);
       
   117 	
       
   118 	/**
       
   119 	 * Handle the completion of geting current network information
       
   120 	 */
       
   121 	void HandleGetCurNetworkComplete();
       
   122 private:
       
   123     /**
       
   124      * The AT command to get the network info
       
   125      */
       
   126 	CATNetworkInfo* iATNetworkInfo;
       
   127 	
       
   128 	/**
       
   129 	 * The Helper AT command @see CATHelperCommand
       
   130 	 */
       
   131 	CATHelperCommand* iATHelperCommand;
       
   132 	
       
   133 	/**
       
   134 	 * The network info
       
   135 	 */
       
   136 	RMobilePhone::TMobilePhoneNetworkInfoV5 iNetworkInfo;
       
   137     
       
   138 	/**
       
   139 	 * Define the states for retrieving the network information
       
   140 	 */
       
   141 	enum TGetCurNetworkState
       
   142 		{
       
   143 		/**
       
   144 		 * The state is unknown
       
   145 		 */
       
   146 		EATUnknown,
       
   147 		
       
   148 		/**
       
   149 		 * The state of seting long format
       
   150 		 */
       
   151 		EATSetLongFormat,
       
   152 		
       
   153 		/**
       
   154 		 * The state of getting long name 
       
   155 		 */
       
   156 		EATGetLongName,
       
   157 		
       
   158 		/**
       
   159 		 * The state of seting short name format 
       
   160 		 */
       
   161 		EATSetShortFormat,
       
   162 		
       
   163 		/**
       
   164 		 * The state of getting short name
       
   165 		 */
       
   166 		EATGetShortName,
       
   167 		
       
   168 		/**
       
   169 		 * The state of Seting the numberic format
       
   170 		 */
       
   171 		EATSetNumbericFormat,
       
   172 		
       
   173 		/**
       
   174 		 * The state of geting country code and network Id
       
   175 		 */
       
   176 		EATGetCountryCodeAndNetwrokId
       
   177 		} iState;
       
   178 
       
   179 };
       
   180 #endif //__GETCURRENTNETWORKINFO_H__