cbsref/telephonyrefplugins/atltsy/atcommand/phonebook/inc/atphbkstoreinitialise.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 atphbkstoreinitialise.h
       
    15 // This contains CAtPhbkStoreInitialise which initialises all kinds of phonebook 
       
    16 // 
       
    17 
       
    18 #ifndef ATPHBKSTOREINITIALISE_H
       
    19 #define ATPHBKSTOREINITIALISE_H
       
    20 
       
    21 //system include  
       
    22 #include <etelmm.h>
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 //user include 
       
    27 #include "atcommandbase.h"
       
    28 
       
    29 /**
       
    30  * CAtPhbkStoreInitialise
       
    31  *
       
    32  */
       
    33 class CAtPhbkStoreInitialise : public CAtCommandBase
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	* Destructor
       
    38 	*
       
    39 	*/
       
    40 	~CAtPhbkStoreInitialise();
       
    41 	
       
    42 	/**
       
    43 	*  static NewL  
       
    44 	*
       
    45 	* @param aGloblePhone
       
    46 	* @param aCtsyDispatcherCallback
       
    47 	*/
       
    48 	static CAtPhbkStoreInitialise* NewL(CGlobalPhonemanager& aGloblePhone, 
       
    49                                         CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    50 	
       
    51 	/**
       
    52 	*  static NewLC  
       
    53 	*
       
    54 	* @param aGloblePhone
       
    55 	* @param aCtsyDispatcherCallback
       
    56 	*/
       
    57 	static CAtPhbkStoreInitialise* NewLC(CGlobalPhonemanager& aGloblePhone, 
       
    58                                          CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    59 	
       
    60 	/**
       
    61 	* Virtual function. Inherited from CAtCommandBase
       
    62 	*  Start Execute AT Command
       
    63 	*/
       
    64 	virtual void ExecuteCommand();
       
    65 	
       
    66 	/**
       
    67 	* Will be called by AT Manager whenever a event was triggered
       
    68 	* 
       
    69 	* @param aEventSource
       
    70 	* @param aStatus
       
    71 	*/
       
    72 	virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus);
       
    73 	
       
    74 	/**
       
    75 	* Virtual function. Inherited from CAtCommandBase
       
    76 	* 
       
    77 	* @param aResponseBuf Line buf reading from baseband 
       
    78 	*/
       
    79 	virtual void ParseResponseL(const TDesC8& aResponseBuf);
       
    80 	
       
    81 	/**
       
    82 	* Start this request
       
    83 	* 
       
    84 	*/
       
    85 	void StartRequest();
       
    86 private:
       
    87 	/**
       
    88 	* Constructor
       
    89 	*
       
    90 	* @param aGloblePhone
       
    91 	* @param aCtsyDispatcherCallback
       
    92 	*/
       
    93 	CAtPhbkStoreInitialise(CGlobalPhonemanager& aGloblePhone, 
       
    94                            CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    95 	
       
    96 	/**
       
    97 	* 2nd Constructor
       
    98 	*/
       
    99 	void ConstructL();
       
   100 	
       
   101 	/**
       
   102 	*  Executer AT command for getting Store Info
       
   103 	*/
       
   104 	void GetStoreInfo();
       
   105 	
       
   106 	/**
       
   107 	*  assign totalEntries,maxTextLen and maxNumberLen for each 
       
   108 	*  phonebook store type 
       
   109 	*/
       
   110 	void AssignPhbkType();
       
   111 private:
       
   112 	/**
       
   113 	*  the structure for callback
       
   114 	*/
       
   115 	DispatcherPhonebook::TPhonebookStoreInfoV1  iStoreInfo;
       
   116 
       
   117 	/**
       
   118 	*  state machine for EventSignal 
       
   119 	*/	
       
   120 	enum 
       
   121 		{
       
   122 		ESetStoreName,
       
   123 		ESetStoreNameComplete,
       
   124 		EGetStoreInfo,
       
   125 		EGetStoreInfoComplete,
       
   126 		EATNotInProgress
       
   127 		}iState;
       
   128 		
       
   129 	/**
       
   130 	* The return error value of AT command executed 
       
   131 	*/		
       
   132 	TInt iError;
       
   133 	
       
   134 	/**
       
   135 	*  the array stores phonebook type's string 
       
   136 	*/
       
   137 	RArray<TPtrC8>  iStoreArr;
       
   138 	
       
   139     /**
       
   140 	*  phonebook store type's index 
       
   141 	*/
       
   142 	TInt  iStoreIndex;
       
   143 	
       
   144 	/**
       
   145 	*  total Entries for each store type
       
   146 	*/
       
   147 	TInt iTotalEntries;
       
   148 	
       
   149 	/**
       
   150 	*  maximum number Length
       
   151 	*/
       
   152 	TUint16 iValNumberLen;
       
   153 	
       
   154 	/**
       
   155 	*  maximum text Length
       
   156 	*/	
       
   157 	TUint16 iValTextLen;
       
   158 	
       
   159 	}; // class CAtPhbkStoreInitialise
       
   160 
       
   161 #endif // ATPHBKSTOREINITIALISE_H