24
|
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 |
// Multimode TSY Phone book Header file.
|
|
15 |
// Describes the GSM Phone Book AT Commands - Read, Write, Delete and Get Info.
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalAll
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef __MPHBKINF_H__
|
|
25 |
#define __MPHBKINF_H__
|
|
26 |
|
|
27 |
#include "ATBASE.H"
|
|
28 |
#include "mPHBOOK.H"
|
|
29 |
#include "mpbutil.h"
|
|
30 |
|
|
31 |
/**
|
|
32 |
* \class CATPhoneBookInfo MPHBKINF.H "...Multimode/MPHBKINF.H"
|
|
33 |
* \brief Determines the phone's supported phonebooks and the associated information.
|
|
34 |
*
|
|
35 |
* CATPhoneBookInfo inherits from CATCommands class. It's intended for CPhoneMobile usage.
|
|
36 |
* This class transmits the following AT Commands: "AT+CPBS=?", "AT+CPBS?", "AT+CPBR=?"
|
|
37 |
* and "AT+CPBS=xx" (where xx is the relevant phonebook memory to be set) to determine
|
|
38 |
* information about the supported phone books.
|
|
39 |
*/
|
|
40 |
class CATPhoneBookInfo :public CATCommands
|
|
41 |
{
|
|
42 |
public:
|
|
43 |
static CATPhoneBookInfo* NewL(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
44 |
CATPhoneBookInfo(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
45 |
~CATPhoneBookInfo();
|
|
46 |
|
|
47 |
void SetStorageType(TStorageType aStorageType);
|
|
48 |
void SetIndexByStorageType();
|
|
49 |
void Stop(TTsyReqHandle aTsyReqHandle);
|
|
50 |
|
|
51 |
inline void MapClientIndexToPhoneIndex(TInt& aIndex) const;
|
|
52 |
inline void MapPhoneIndexToClientIndex(TInt& aIndex) const;
|
|
53 |
inline TBool IsValidPhoneIndex(TInt aIndex) const;
|
|
54 |
inline TInt UsedEntries() const;
|
|
55 |
inline TInt TotalEntries() const;
|
|
56 |
inline TBool Completed() const;
|
|
57 |
|
|
58 |
protected:
|
|
59 |
inline CMobilePhonebookStore& PhoneBook() const;
|
|
60 |
|
|
61 |
private:
|
|
62 |
//
|
|
63 |
// CATCommmands pure virtual
|
|
64 |
//
|
|
65 |
virtual void Start(TTsyReqHandle aTsyReqHandle,TAny* aParams);
|
|
66 |
//
|
|
67 |
// CATBase pure virtuals
|
|
68 |
//
|
|
69 |
virtual void EventSignal(TEventSource aEventSource);
|
|
70 |
virtual void CompleteWithIOError(TEventSource aSource,TInt aStatus);
|
|
71 |
//
|
|
72 |
|
|
73 |
void ConstructL();
|
|
74 |
//
|
|
75 |
void StartSelect();
|
|
76 |
void StartGetInfo();
|
|
77 |
void StartGetMaxLength();
|
|
78 |
//
|
|
79 |
void ParseListResponseL();
|
|
80 |
void ParseGetInfoResponseL();
|
|
81 |
void ParseGetMaxLengthResponseL();
|
|
82 |
|
|
83 |
private:
|
|
84 |
enum TPhoneBookInfoState {
|
|
85 |
EIdle,
|
|
86 |
EListWaitForWriteComplete,
|
|
87 |
EListWaitForReadComplete,
|
|
88 |
ESelectWaitForWriteComplete,
|
|
89 |
ESelectWaitForReadComplete,
|
|
90 |
EGetInfoWaitForWriteComplete,
|
|
91 |
EGetInfoWaitForReadComplete,
|
|
92 |
EGetMaxLengthWaitForWriteComplete,
|
|
93 |
EGetMaxLengthWaitForReadComplete
|
|
94 |
};
|
|
95 |
|
|
96 |
private:
|
|
97 |
void WriteComplete(TEventSource aSource,TPhoneBookInfoState aState);
|
|
98 |
virtual void Complete(TInt aError,TEventSource aSource);
|
|
99 |
|
|
100 |
private:
|
|
101 |
TPhoneBookInfoState iState;
|
|
102 |
TBool iCompleted;
|
|
103 |
TInt iIndex;
|
|
104 |
TInt iIndexOffset; // Offset of index values for phone book store, will be 0 with most phones
|
|
105 |
TStorageType iStorageType;
|
|
106 |
|
|
107 |
RMobilePhoneBookStore::TMobilePhoneBookInfoV1 iPhbkInfo;
|
|
108 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg* iInfoPckg;
|
|
109 |
|
|
110 |
CArrayFixFlat<TStorageType>* iStorageTypeArray;
|
|
111 |
};
|
|
112 |
|
|
113 |
#endif
|