telephonyserverplugins/multimodetsy/Multimode/mPHBOOK.H
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 // GSM Phone book access Header file.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll 
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef __MPHBOOK_H__
       
    25 #define __MPHBOOK_H__
       
    26 
       
    27 #include <et_phone.h>
       
    28 #include "ATSTD.H"
       
    29 
       
    30 enum TPhoneBookStorageType {
       
    31 	KPhoneBookNoStorage =0x0,
       
    32 	KPhoneBookFDStorage =0x1,
       
    33 	KPhoneBookLDStorage =0x2,
       
    34 	KPhoneBookMEStorage =0x4,
       
    35 	KPhoneBookMTStorage =0x8,
       
    36 	KPhoneBookSMStorage =0x10,  
       
    37 	KPhoneBookTAStorage =0x20,
       
    38 	//
       
    39 	KPhoneBookLastDialledStorage =0x40,
       
    40 	KPhoneBookEmergencyStorage =0x80,  
       
    41 	KPhoneBookBarredStorage =0x100,
       
    42 	KPhoneBookMissedCallsStorage =0x200,
       
    43 	KPhoneBookOwnNumbersStorage =0x400,   
       
    44 	KPhoneBookReceivedCallsStorage =0x800,
       
    45 	KPhoneBookServiceNumberStorage =0x1000,
       
    46 	};
       
    47 
       
    48 class CATIO;
       
    49 class CATInit;
       
    50 class CPhoneGlobals;
       
    51 class CATPhoneBookInfo;
       
    52 class CATPhoneBookRead;
       
    53 class CATPhoneBookWrite;
       
    54 class CATPhoneBookDelete;
       
    55 
       
    56 /**
       
    57  * \class CMobilePhoneBookStore MPHBOOK.H "MMTSY/MULTIMODE/MPHBOOK.H"
       
    58  * \brief The CMobilePhoneBookStore class is one of the Multi mode TSY's sub-session extensions responsible
       
    59  * for handling Client-side calls from the Multi mode API.
       
    60  *
       
    61  * CMobilePhoneBookStore inherits from the CSubSessionExtBase class defined in et_phone.h (which in turn
       
    62  * inherits from various mixin classes (MSubSessionExtBaseTSY, MTelObjectTSY). This sub-session
       
    63  * extension class implements all the pure virtuals (functions) from the inherited classes
       
    64  * including ExtFunc(), CancelService(), ReqModeL() etc.
       
    65  */
       
    66 class CMobilePhonebookStore : public CSubSessionExtBase
       
    67 	{
       
    68 public:
       
    69 	static CMobilePhonebookStore* NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aGsmStatus,const TDesC8& aStorageType);
       
    70 	~CMobilePhonebookStore();
       
    71 //
       
    72 // CTelObject, MTelObject pure virtuals
       
    73 //
       
    74 	virtual CTelObject::TReqMode ReqModeL(const TInt aIpc);
       
    75 	virtual TInt NumberOfSlotsL(const TInt aIpc);
       
    76 	virtual TInt RegisterNotification(const TInt aIpc);
       
    77 	virtual TInt DeregisterNotification(const TInt aIpc);
       
    78 	virtual void Init();
       
    79 	virtual TInt CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle);
       
    80 	virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName);
       
    81 	virtual CTelObject* OpenNewObjectL(TDes& aName);
       
    82 //
       
    83 // CSubSessionExtBase pure virtuals
       
    84 //
       
    85 	virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle, const TInt aIpc, const TDataPackage& aPackage);
       
    86 
       
    87 	const TStorageType& StorageType() const;
       
    88 	TInt GetWrittenIndex() const;
       
    89 	TInt GetDeletedIndex() const;
       
    90 	TInt GetNumberOfUsedEntries();
       
    91 	TInt GetTotalNumberOfEntries();
       
    92 	void ProcessPostponedCommand(TInt aError);
       
    93 
       
    94 	TInt HandleExtFunc(TTsyReqHandle aTsyReqHandle, TInt aIpc, const TDataPackage& aPackage);
       
    95 	void InitFailed();
       
    96 
       
    97 private:
       
    98 	void ConstructL();
       
    99 
       
   100 	CMobilePhonebookStore(CATIO* aATIO, CATInit* aInit, CPhoneGlobals* aGsmStatus, const TDesC8& aStorageType);
       
   101 
       
   102 	TInt GetInfo(TTsyReqHandle aTsyReqHandle, TDes8* aInfoPckg);
       
   103 	TInt Read(TTsyReqHandle aTsyReqHandle, RMobilePhoneBookStore::TPBIndexAndNumEntries* aIndexAndEntries, TDes8* aPBData);
       
   104 	TInt Write(TTsyReqHandle aTsyReqHandle, TDes8* aPBData, TInt* aIndex);
       
   105 	TInt Delete(TTsyReqHandle aTsyReqHandle, TInt* aIndex);
       
   106 
       
   107 	TInt PhoneBookCapabilities(TDes& aName);
       
   108 
       
   109 private:
       
   110 	enum TState {EInit,EOK,EFail};	// phonebook initialisation status
       
   111 
       
   112 	CATIO* iIo;
       
   113 	CATInit* iInit;
       
   114 	CPhoneGlobals* iPhoneGlobals;
       
   115 	CATPhoneBookInfo* iInfo;		// gets phonebook store information
       
   116 	CATPhoneBookRead* iRead;        // enables an entry to be read from phonebook memory
       
   117 	CATPhoneBookWrite* iWrite;		// enables an entry to be written to phonebook memory
       
   118 	CATPhoneBookDelete* iDelete;	// enables an entry to be deleted from phonebook memory
       
   119 
       
   120 	TInt iIndex;
       
   121 	RMobilePhoneBookStore::TPBIndexAndNumEntries iIndexAndEntries;
       
   122 
       
   123 	TStorageType iStorageType;
       
   124 	TUint iReadWriteAccess;
       
   125 	TState iState;
       
   126 	};
       
   127 
       
   128 #include "mphbook.inl"
       
   129 
       
   130 #endif
       
   131