telephonyserverplugins/simtsy/inc/CSimONStore.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-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 //
       
    15 
       
    16 #ifndef __SIMONSTORE_H_
       
    17 #define __SIMONSTORE_H_
       
    18 
       
    19 /**
       
    20  * @file
       
    21  *
       
    22  * Contains the class definitions required for the Phonebook Store.
       
    23  * @internalAll
       
    24  */
       
    25 
       
    26 #include <etelmm.h>
       
    27 #include <et_phone.h>
       
    28 #include <mpbutil.h>
       
    29 #include "csimtimer.h"
       
    30 #include "CSimPhone.h"
       
    31 #include "CSimPhoneSecurity.h"
       
    32 
       
    33 const TInt KONMaxTextSize=241;
       
    34 const TInt KONMaxTelNumSize=100;
       
    35 
       
    36 /**
       
    37  * The class which simulates a Own Number Store.
       
    38  */
       
    39 class CSimPhone;
       
    40 class CTestConfigSection;
       
    41 class CTestConfigItem;
       
    42 NONSHARABLE_CLASS(CSimONStore) : public CSimPhone, public MTimerCallBack
       
    43 	{
       
    44 public:
       
    45 	static CSimONStore* NewL(CSimPhone* aPhone, TInt aMaxNumSlots, TInt aMaxNumLen, TInt aMaxTextLen);
       
    46 	CSimONStore(CSimPhone* aPhone);
       
    47 	~CSimONStore();
       
    48 
       
    49 	static void ClosePhone(TAny* aObj);
       
    50 	virtual CTelObject::TReqMode ReqModeL(const TInt aIpc);
       
    51 // MTelObjectTSY pure virtual
       
    52 	virtual TInt RegisterNotification(const TInt aIpc);
       
    53 	virtual TInt DeregisterNotification(const TInt aIpc);
       
    54 	virtual void Init();
       
    55 	virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName);
       
    56 	virtual CTelObject* OpenNewObjectL(TDes& aNewName);
       
    57 	virtual TInt NumberOfSlotsL(const TInt aIpc);
       
    58 	virtual TInt CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle);
       
    59 
       
    60 // MSubSessionExtBaseTSY pure virtual
       
    61 	virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage);
       
    62 
       
    63 // Other public functions.
       
    64 	void PopulateStoreFromConfigFileL();
       
    65 	void PopulateONStoreInfo(RMobileONStore::TMobileONStoreInfoV1* aStoreInfo);
       
    66 
       
    67 	TInt UsedEntries();
       
    68 
       
    69 protected:
       
    70 	void ConstructL(TInt aMaxNumSlots, TInt aMaxNumLen, TInt aMaxTextLen);
       
    71 
       
    72 private:
       
    73 	TInt GetInfo(TTsyReqHandle aReqHandle, TDes8* aPckg);
       
    74 	TInt Read(TTsyReqHandle aReqHandle, TDes8* aPckg1);
       
    75 
       
    76 	void DelayCompletion(TInt aDelayDuration,TTsyReqHandle aReqHandle);
       
    77 	void TimerCallBack(TInt aId);
       
    78 
       
    79 	TBool FindIpcErrorMatch(TInt& aError);
       
    80 	const CTestConfigSection* CfgFile();
       
    81 	TInt GetONEntry(const CTestConfigItem* aItem, TInt aItemIndex, TInt& aIndex,
       
    82 			 TPtrC8& aTelNum, TPtrC8& aText, RMobilePhone::TMobileTON& aTypeOfNumber,
       
    83 			 RMobilePhone::TMobileService& aService, RMobilePhone::TMobilePhoneNetworkMode& aMode,
       
    84 			 RMobilePhone::TMobileNPI& aNumberPlan);
       
    85 
       
    86 private:
       
    87 	CPhoneBase*	iDummyPhoneBaseRef;
       
    88 
       
    89 	CSimPhone* iPhone;				// < A pointer to the "owner" phone class.
       
    90 	CSimTimer* iReqTimer;			// < The timer used to delay request completions.
       
    91 
       
    92 	TInt iONMaxNumSlots;			// < The maximum number of slots in this Own Number store.
       
    93 	TInt iONMaxTelNumLen;			// < The maximum size of a telephone number that can be stored in this Own Number store.
       
    94 	TInt iONMaxTextLen;			// < The maximum size of an alpha tag that can be stored in this Own Number store.
       
    95 
       
    96 	struct TONStoreEntry
       
    97 		{
       
    98 		RMobilePhone::TMobilePhoneNetworkMode iMode;
       
    99 		RMobilePhone::TMobileService iService;
       
   100 		RMobilePhone::TMobileTON iTypeOfNumber;	// < The Own Number entry's Type of Number and Number Plan Identifier.
       
   101 		RMobilePhone::TMobileNPI iNumberPlan;
       
   102 		TBuf<KONMaxTelNumSize> iTelNum;		// < The Own Number entry's telephone number.
       
   103 		TBuf<KONMaxTelNumSize> iText;		// < The Own Number entry's telephone number.
       
   104 		};
       
   105 
       
   106 	TONStoreEntry* iONStoreEntries;	// < A pointer to the Own Number Store array.
       
   107 
       
   108 	TUint iONStoreCaps;				// < The phone level caps of the Own Number Store
       
   109 	CPhoneBookBuffer* iONRwBuffer;	// < The Own Number read/write "streaming" class.
       
   110 
       
   111 	TBool iEvOutstandingReq;		// < A flag indicating an outstanding Phonebook Store notification request.
       
   112 	TInt iONIndividualPause;		// < The pause value used to delay the completion of an individual Phonebook Store manipulation request.
       
   113 	TTsyReqHandle iPendingReqCompletion;	// < The TSY request handle for the request that is awaiting a timer event before completion.
       
   114 
       
   115 	};
       
   116 
       
   117 #endif