cbsref/telephonyrefplugins/atltsy/atcommand/callcontrol/inc/atanswer.h
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     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 atanswer.h
       
    15 // This contains CATAnswer which answering incomging call.
       
    16 // 
       
    17 
       
    18 #ifndef ATANSWER_H_
       
    19 #define ATANSWER_H_
       
    20 
       
    21 //system include
       
    22 
       
    23 //user include
       
    24 #include "atcommandbase.h"
       
    25 
       
    26 class CATAnswer : public CAtCommandBase
       
    27 	{
       
    28 public:
       
    29 	
       
    30 	/**
       
    31 	*  static NewL  
       
    32 	*
       
    33 	* @param aGloblePhone
       
    34 	* @param aCtsyDispatcherCallback
       
    35 	*/	
       
    36 	static CATAnswer* NewL(CGlobalPhonemanager& aGloblePhone,
       
    37 			               CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    38 	
       
    39 	/**
       
    40 	*  static NewLC 
       
    41 	*
       
    42 	* @param aGloblePhone
       
    43 	* @param aCtsyDispatcherCallback
       
    44 	*/	
       
    45 	static CATAnswer* NewLC(CGlobalPhonemanager& aGloblePhone,
       
    46 			                CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    47 	
       
    48 	
       
    49 	/**
       
    50 	 * Destructor
       
    51 	 * 
       
    52 	 */
       
    53 	virtual ~CATAnswer();
       
    54 	
       
    55 	/**
       
    56 	 * Seting answer id
       
    57 	 * 
       
    58 	 * @param aCallId
       
    59 	 */
       
    60 	void SetAnswerCallId(TInt aCallId);
       
    61 	
       
    62 	/**
       
    63 	 * Seting the call is or not 3rd party
       
    64 	 * 
       
    65 	 * 
       
    66 	 * @param aIsIsvCall ETrue 3rd party  another EFalse
       
    67 	 */
       
    68 	void SetIsIsvCall(TBool aIsIsvCall);
       
    69 	
       
    70 	
       
    71 	/**
       
    72 	* Virtual function. Inherited from CAtCommandBase
       
    73 	* 
       
    74 	* Execute AT Command
       
    75 	*/
       
    76 	virtual void ExecuteCommand();
       
    77 		
       
    78 	/**
       
    79 	* Start AT request
       
    80 	* 
       
    81 	*/
       
    82 	virtual void StartRequest();
       
    83 	
       
    84 	/**
       
    85 	* Will be called by AT Manager whenever a event was triggered
       
    86 	* 
       
    87 	* @param aEventSource
       
    88 	* @param aStatus
       
    89 	*/
       
    90 	virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus);
       
    91 	
       
    92 	/**
       
    93 	* Virtual function. Inherited from CAtCommandBase
       
    94 	* 
       
    95 	* @param aResponseBuf Line buf reading from baseband 
       
    96 	*/
       
    97 	virtual void ParseResponseL(const TDesC8& aResponseBuf);
       
    98 	
       
    99 protected:
       
   100 	
       
   101 	/**
       
   102 	* Constructor
       
   103 	*
       
   104 	* @param aGloblePhone
       
   105 	* @param aCtsyDispatcherCallback
       
   106 	*/	
       
   107 	CATAnswer(CGlobalPhonemanager& aGloblePhone, 
       
   108 			  CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
   109 	
       
   110 	/**
       
   111 	* 2nd Constructor
       
   112 	*/	
       
   113 	void ConstructL();
       
   114 	
       
   115 	/**
       
   116 	* The last execute end of this command
       
   117 	*/	
       
   118 	void Complete();
       
   119 	
       
   120 private:
       
   121 	
       
   122 	/**
       
   123 	 * Handle IO errors
       
   124 	 * 
       
   125 	 */
       
   126 	void HandleIOError();
       
   127 	
       
   128 	/**
       
   129 	 * Handle response error
       
   130 	 * 
       
   131 	 */
       
   132 	void HandleResponseError();
       
   133 	
       
   134 	/**
       
   135 	 * Handle response OK
       
   136 	 * 
       
   137 	 */
       
   138 	void HandleConnectedComplete();		
       
   139 	
       
   140 private:
       
   141 	
       
   142 	/**
       
   143 	 * AT command execute step
       
   144 	 * 
       
   145 	 */
       
   146 	enum TATStep
       
   147 		{
       
   148 		EATNotInProgress,
       
   149 		EATWaitForWriteComplete,
       
   150 		EATReadComplete
       
   151 		};	
       
   152 	
       
   153 private:
       
   154 	/**
       
   155 	 * I/O error when Read or Write
       
   156 	 * include timeout
       
   157 	 */
       
   158 	TInt iIOStatus;
       
   159 	
       
   160 	/**
       
   161 	 * At command return errors
       
   162 	 * 
       
   163 	 */
       
   164 	TInt iATResult;
       
   165 	
       
   166 	/**
       
   167 	 * Identifier step
       
   168 	 * 
       
   169 	 */
       
   170 	TATStep iAnswerStep;	
       
   171 	
       
   172 	/**
       
   173 	 * answer call id
       
   174 	 * 
       
   175 	 */
       
   176 	TInt iCallId;
       
   177 	
       
   178 	/**
       
   179 	 * The flag of 3rd party call
       
   180 	 * 
       
   181 	 */
       
   182 	TBool iIsIsvCall;
       
   183 	
       
   184 	};
       
   185 
       
   186 #endif /*ATANSWER_H_*/