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 __MPHBKCOM_H__
|
|
25 |
#define __MPHBKCOM_H__
|
|
26 |
|
|
27 |
#include "ATBASE.H"
|
|
28 |
#include <mpbutil.h>
|
|
29 |
#include "mPHBOOK.H"
|
|
30 |
#include "mpbutil.h"
|
|
31 |
#include "mphbkinf.h"
|
|
32 |
#include "Matstd.h" // for AT command strings
|
|
33 |
|
|
34 |
|
|
35 |
GLREF_C void ConvertStorageTypeToName(const TStorageType& aStorageType,TDes& aName);
|
|
36 |
|
|
37 |
/**
|
|
38 |
* \class CATPhoneBookCommands MPHBKCOM.H "...MULTIMODE/MPHBKCOM.H"
|
|
39 |
* \brief This is an abstract class from which the CATPhoneBookInit, CATPhoneBookWrite,
|
|
40 |
* CATPhoneBookRead and CATPhoneBookDelete classes inherit from.
|
|
41 |
*
|
|
42 |
* CATPhoneBookCommands inherits from the CATCommands class. It contains common
|
|
43 |
* functionality for the Write, Read, Delete and Initialization operations. This class is
|
|
44 |
* intended for CPhoneBook usage.
|
|
45 |
*/
|
|
46 |
class CATPhoneBookCommands : public CATCommands
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
CATPhoneBookCommands(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
50 |
~CATPhoneBookCommands();
|
|
51 |
//
|
|
52 |
// CATCommmands pure virtuals
|
|
53 |
//
|
|
54 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams) =0;
|
|
55 |
//
|
|
56 |
// CATBase pure virtuals
|
|
57 |
//
|
|
58 |
virtual void EventSignal(TEventSource aEventSource);
|
|
59 |
virtual void CompleteWithIOError(TEventSource aSource,TInt aStatus);
|
|
60 |
//
|
|
61 |
// new pure virtual
|
|
62 |
//
|
|
63 |
virtual void StartThisCommand() =0;
|
|
64 |
//
|
|
65 |
virtual void Stop(TTsyReqHandle aTsyReqHandle);
|
|
66 |
|
|
67 |
protected:
|
|
68 |
//
|
|
69 |
// new pure virtual
|
|
70 |
//
|
|
71 |
virtual void ParseResponseL() =0;
|
|
72 |
void StartStorageSelect();
|
|
73 |
virtual void Complete(TInt aError,TEventSource aSource);
|
|
74 |
|
|
75 |
protected:
|
|
76 |
enum {
|
|
77 |
EATPhoneBookCommandIdle,
|
|
78 |
EATPhoneBookStorageSelectWaitForWriteComplete,
|
|
79 |
EATPhoneBookStorageSelectWaitForReadComplete,
|
|
80 |
EATPhoneBookCommandWaitForWriteComplete,
|
|
81 |
EATPhoneBookCommandWaitForReadComplete,
|
|
82 |
EATPhoneBookCommandWaitForAlternativeWriteComplete,
|
|
83 |
EATPhoneBookCommandWaitForAlternativeReadComplete,
|
|
84 |
EATPhoneBookCommandExtendedRead
|
|
85 |
} iState;
|
|
86 |
|
|
87 |
TBool iCancelFlag;
|
|
88 |
};
|
|
89 |
|
|
90 |
/**
|
|
91 |
* \class CATPhoneBookRead MPHBKCOM.H "...MULTIMODE/MPHBKCOM.H"
|
|
92 |
* \brief Reads one or more entry(s) from the specified phonebook memory.
|
|
93 |
*
|
|
94 |
* CATPhoneBookRead inherits from the CATPhoneBookCommands class. It reads one or more
|
|
95 |
* entry(s) from the selected phone book memory.
|
|
96 |
*/
|
|
97 |
|
|
98 |
class CATPhoneBookRead : public CATPhoneBookCommands
|
|
99 |
{
|
|
100 |
public:
|
|
101 |
static CATPhoneBookRead* NewL(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,CATPhoneBookInfo *aInfo);
|
|
102 |
~CATPhoneBookRead();
|
|
103 |
|
|
104 |
inline void SetPBData(TDes8* aPBData);
|
|
105 |
|
|
106 |
private:
|
|
107 |
CATPhoneBookRead(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,CATPhoneBookInfo *aInfo);
|
|
108 |
void ConstructL();
|
|
109 |
//
|
|
110 |
// CATBas pure virtual
|
|
111 |
//
|
|
112 |
virtual void EventSignal(TEventSource aEventSource);
|
|
113 |
virtual void CompleteWithIOError(TEventSource aSource,TInt aStatus);
|
|
114 |
//
|
|
115 |
// CATCommmands pure virtual
|
|
116 |
//
|
|
117 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
|
|
118 |
//
|
|
119 |
// CATPhoneBookCommands pure virtual
|
|
120 |
//
|
|
121 |
virtual void ParseResponseL();
|
|
122 |
void StartThisCommand();
|
|
123 |
|
|
124 |
|
|
125 |
private:
|
|
126 |
CATPhoneBookInfo* iInfo; // pointer to clients CATPhoneBookInfo object
|
|
127 |
CCommChatString* iCPBRResponse;
|
|
128 |
CPhoneBookBuffer* iPbBuffer; // Pointer to converter utility and memory provided by ETel to store the phonebook data
|
|
129 |
RMobilePhoneBookStore::TPBIndexAndNumEntries* iRead; // Basic phonebook data
|
|
130 |
TInt iNumReadEntries; // < The number of phonebook entries successfully read during a read request
|
|
131 |
};
|
|
132 |
|
|
133 |
/**
|
|
134 |
* \class CATPhoneBookWrite MPHBKCOM.H "...MULTIMODE/MPHBKCOM.H"
|
|
135 |
* \brief Enables an entry to be written to the specified phonebook memory.
|
|
136 |
*
|
|
137 |
* CATPhoneBookWrite inherits from the CATPhoneBookCommands class. It writes an
|
|
138 |
* entry to the selected phone book memory.
|
|
139 |
*/
|
|
140 |
class CATPhoneBookWrite : public CATPhoneBookCommands
|
|
141 |
{
|
|
142 |
public:
|
|
143 |
static CATPhoneBookWrite* NewL(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
144 |
~CATPhoneBookWrite();
|
|
145 |
inline TInt Index() const;
|
|
146 |
inline void SetPBData(TDes8* aPBData);
|
|
147 |
|
|
148 |
private:
|
|
149 |
CATPhoneBookWrite(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
150 |
void ConstructL();
|
|
151 |
//
|
|
152 |
// CATCommmands pure virtual
|
|
153 |
//
|
|
154 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
|
|
155 |
//
|
|
156 |
// CATPhoneBookCommands pure virtual
|
|
157 |
//
|
|
158 |
virtual void StartThisCommand();
|
|
159 |
virtual void ParseResponseL();
|
|
160 |
|
|
161 |
//
|
|
162 |
// Class local utility functions
|
|
163 |
//
|
|
164 |
TUint NumberTypefromMMToGSM(TUint aTypeOfNumberMM);
|
|
165 |
|
|
166 |
private:
|
|
167 |
TInt iIndex; // Copy of index value which client wants this class to write to phone book store
|
|
168 |
CPhoneBookBuffer* iPbBuffer; // Pointer to converter utility and memory provided by ETel to store the phonebook data
|
|
169 |
};
|
|
170 |
|
|
171 |
/**
|
|
172 |
* \class CATPhoneBookDelete MPHBKCOM.H "...MULTIMODE/MPHBKCOM.H"
|
|
173 |
* \brief Enables an entry to be deleted from the specified phonebook memory.
|
|
174 |
*
|
|
175 |
* CATPhoneBookDelete inherits from the CATPhoneBookCommands class. It deletes an entry
|
|
176 |
* from the selected phone book memory.
|
|
177 |
*/
|
|
178 |
class CATPhoneBookDelete : public CATPhoneBookCommands
|
|
179 |
{
|
|
180 |
public:
|
|
181 |
static CATPhoneBookDelete* NewL(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
182 |
~CATPhoneBookDelete();
|
|
183 |
//
|
|
184 |
inline TInt Index() const;
|
|
185 |
private:
|
|
186 |
CATPhoneBookDelete(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals);
|
|
187 |
//
|
|
188 |
// CATBase pure virtual
|
|
189 |
//
|
|
190 |
virtual void EventSignal(TEventSource aEventSource);
|
|
191 |
//
|
|
192 |
// CATCommmands pure virtual
|
|
193 |
//
|
|
194 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
|
|
195 |
//
|
|
196 |
// CATPhoneBookCommands pure virtual
|
|
197 |
//
|
|
198 |
virtual void StartThisCommand();
|
|
199 |
virtual void ParseResponseL();
|
|
200 |
//
|
|
201 |
void StartAlternativeDelete();
|
|
202 |
private:
|
|
203 |
TInt iIndex;
|
|
204 |
};
|
|
205 |
|
|
206 |
#include "mphbkcom.inl"
|
|
207 |
|
|
208 |
#endif
|