cbsref/telephonyrefplugins/atltsy/atcommand/phonebooken/inc/atphbkenread.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 atphbkenread.h
       
    15 // This contains CAtPhbkEnRead which is use to read a PhonebookEn Entry
       
    16 // 
       
    17 
       
    18 #ifndef ATPHBKENREAD_H
       
    19 #define ATPHBKENREAD_H
       
    20 
       
    21 //system include 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 //user include 
       
    26 #include "atcommandbase.h"
       
    27 
       
    28 //constant defination
       
    29 const TInt KEnNumberLen = 6;
       
    30 
       
    31 /**
       
    32  * CAtPhbkEnRead
       
    33  *
       
    34  */
       
    35 class CAtPhbkEnRead : public CAtCommandBase
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	* Destructor
       
    40 	*
       
    41 	*/
       
    42 	~CAtPhbkEnRead();
       
    43 	
       
    44 	/**
       
    45 	*  static NewL  
       
    46 	*
       
    47 	* @param aGloblePhone
       
    48 	* @param aCtsyDispatcherCallback
       
    49 	*/
       
    50 	static CAtPhbkEnRead* NewL(CGlobalPhonemanager& aGloblePhone, 
       
    51                                   CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    52 	
       
    53 	/**
       
    54 	*  static NewLC  
       
    55 	*
       
    56 	* @param aGloblePhone
       
    57 	* @param aCtsyDispatcherCallback
       
    58 	*/
       
    59 	static CAtPhbkEnRead* NewLC(CGlobalPhonemanager& aGloblePhone, 
       
    60                                    CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    61 
       
    62 	/**
       
    63 	* Virtual function. Inherited from CAtCommandBase
       
    64 	*  Start Execute AT Command
       
    65 	*/
       
    66 	virtual void ExecuteCommand();
       
    67 	
       
    68 	/**
       
    69 	* Will be called by AT Manager whenever a event was triggered
       
    70 	* 
       
    71 	* @param aEventSource
       
    72 	* @param aStatus
       
    73 	*/
       
    74 	virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus);
       
    75 	
       
    76 	/**
       
    77 	* Virtual function. Inherited from CAtCommandBase
       
    78 	* 
       
    79 	* @param aResponseBuf Line buf reading from baseband 
       
    80 	*/
       
    81 	virtual void ParseResponseL(const TDesC8& aResponseBuf);
       
    82 	
       
    83 	/**
       
    84 	* Start this request
       
    85 	* 
       
    86 	*/
       
    87 	void StartRequest();
       
    88 	
       
    89 	/**
       
    90 	* Set read PhonebookEn index
       
    91 	* 
       
    92 	* @param  aIndex
       
    93 	* @param  aSlotNum
       
    94 	*/
       
    95 	void SetIndex(TInt aIndex);
       
    96 protected:
       
    97 	/**
       
    98 	* Constructor
       
    99 	*
       
   100 	* @param aGloblePhone
       
   101 	* @param aCtsyDispatcherCallback
       
   102 	*/
       
   103 	CAtPhbkEnRead(CGlobalPhonemanager& aGloblePhone, 
       
   104                      CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
   105 	
       
   106 	/**
       
   107 	* 2nd Constructor
       
   108 	*/
       
   109 	void ConstructL();
       
   110 private:
       
   111 	/**
       
   112 	*  Executer AT command for reading a phonebook entry
       
   113 	*/	
       
   114 	void ReadEntry();
       
   115 	
       
   116 private:
       
   117 	/**
       
   118 	*  state machine for EventSignal 
       
   119 	*/
       
   120 	enum 
       
   121 		{
       
   122 		ESetEnName,
       
   123 		ESetEnNameComplete,
       
   124 		EReadEntry,
       
   125 		EReadEntryComplete,
       
   126 		EATNotInProgress
       
   127 		}iState;
       
   128 		
       
   129 	/**
       
   130 	* The return error value of AT command executed 
       
   131 	*/		
       
   132 	TInt iError;
       
   133 	
       
   134 	/*
       
   135 	* the first index should be read
       
   136 	*/
       
   137 	TInt iIndex;
       
   138 	
       
   139 	/*
       
   140 	* the phonebooken number want to read
       
   141 	*/
       
   142 	TBuf<KEnNumberLen> iNumber;
       
   143 	
       
   144 	
       
   145 	/*
       
   146 	*  indicate whether it is OK or ERROR string 
       
   147 	*/
       
   148     TBool   iEndFlag;
       
   149 	
       
   150 	}; // class CAtPhbkEnRead
       
   151 #endif // ATPHBKENREAD_H