0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef _CMMPHONEBOOK_OPERATION_CACHE_H
|
|
19 |
#define _CMMPHONEBOOK_OPERATION_CACHE_H
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
24 |
#include <e32base.h>
|
|
25 |
#include "cmmphonebookstoreoperationbase.h"
|
|
26 |
|
|
27 |
// CONSTANTS
|
|
28 |
// None
|
|
29 |
|
|
30 |
// MACROS
|
|
31 |
// None
|
|
32 |
|
|
33 |
// DATA TYPES
|
|
34 |
// None
|
|
35 |
|
|
36 |
// EXTERNAL DATA STRUCTURES
|
|
37 |
// None
|
|
38 |
|
|
39 |
// FUNCTION PROTOTYPES
|
|
40 |
// None
|
|
41 |
|
|
42 |
// FORWARD DECLARATION
|
|
43 |
// None
|
|
44 |
|
|
45 |
// CLASS DECLARATION
|
|
46 |
/**
|
|
47 |
* CMmPhoneBookOperationCache is used to create and send GSM-specific PBStore
|
|
48 |
* ISI messages to PhoNet via PhoNetSender relating to cache.
|
|
49 |
*/
|
|
50 |
class CMmPhoneBookOperationCache : public CMmPhoneBookStoreOperationBase
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Two-phased constructor.
|
|
56 |
* @param CMmPhoneBookStoreMessHandler* aMmPhoneBookStoreMessHandler:
|
|
57 |
* Pointer to CMmPhoneBookStoreMessHandler object.
|
|
58 |
* @param aIpc IPC number
|
|
59 |
* @param const CMmDataPackage* aDataPackage: Packaged data.
|
|
60 |
* @return CMmPhoneBookOperationInit*: created object
|
|
61 |
*/
|
|
62 |
static CMmPhoneBookOperationCache* NewL(
|
|
63 |
CMmPhoneBookStoreMessHandler* aMmPhoneBookStoreMessHandler,
|
|
64 |
TInt aIpc,
|
|
65 |
const CMmDataPackage* aDataPackage );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Destructor.
|
|
69 |
*/
|
|
70 |
~CMmPhoneBookOperationCache();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Calculates transaction id from data package
|
|
74 |
* @param aIpc IPC number
|
|
75 |
* @param aDataPackage data package
|
|
76 |
* @param aTransactionId resulting transaction id
|
|
77 |
* @return TInt KErrNotSupported or KErrNone
|
|
78 |
*/
|
|
79 |
static TInt CalculateTransactionId(
|
|
80 |
TInt aIpc,
|
|
81 |
const CMmDataPackage* aDataPackage,
|
|
82 |
TUint8& aTransactionId
|
|
83 |
);
|
|
84 |
|
|
85 |
private:
|
|
86 |
|
|
87 |
/**
|
|
88 |
* By default Symbian OS constructor is private.
|
|
89 |
*/
|
|
90 |
CMmPhoneBookOperationCache();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Class attributes are created in ConstructL.
|
|
94 |
*/
|
|
95 |
void ConstructL();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Separates different IPC requests for each other.
|
|
99 |
* @param TInt aIpc: Identify number of request.
|
|
100 |
* @param const CMmDataPackage* aDataPackage: Packaged data.
|
|
101 |
* @return TInt: KErrNone or error value.
|
|
102 |
*/
|
|
103 |
TInt CreateReq( TInt aIpc, const CMmDataPackage* aDataPackage );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Handles SimPbResp ISI -message
|
|
107 |
* @param TIsiReceiveC& aIsiMessage: Received ISI message
|
|
108 |
* @param TBool& aComplete: Indicates if request can remove from
|
|
109 |
* operationlist or not.
|
|
110 |
* @return TInt: KErrNone or error value
|
|
111 |
*/
|
|
112 |
TInt HandleSimPbRespL(
|
|
113 |
const TIsiReceiveC& aIsiMessage,
|
|
114 |
TBool& aComplete );
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Handles SimPbResp ISI -message, Cache.
|
|
118 |
* @param TIsiReceiveC& aIsiMessage: Received ISI message
|
|
119 |
* @param TBool& aComplete: Indicates if request can remove from
|
|
120 |
* operationlist or not.
|
|
121 |
* @return TInt: KErrNone or error value
|
|
122 |
*/
|
|
123 |
TInt HandleSimPbRespLCacheL(
|
|
124 |
const TIsiReceiveC& aIsiMessage,
|
|
125 |
TBool& aComplete );
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Handles SimPbResp ISI -message, Get info
|
|
129 |
* @param TIsiReceiveC& aIsiMessage: Received ISI message
|
|
130 |
* @param TBool& aComplete: Indicates if request can remove from
|
|
131 |
* operationlist or not.
|
|
132 |
* @return TInt: KErrNone or error value
|
|
133 |
*/
|
|
134 |
TInt HandleSimPbRespGetInfo(
|
|
135 |
const TIsiReceiveC& aIsiMessage,
|
|
136 |
TBool& aComplete );
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Prepares operation to start caching.
|
|
140 |
* @param const CMmDataPackage* aDataPackage: data
|
|
141 |
* @return TInt: KErrNone or error value
|
|
142 |
*/
|
|
143 |
TInt PrepareCacheReq( const CMmDataPackage* aDataPackage );
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Creates and sends ISI message in order to read entry from SIM
|
|
147 |
* @param TUint8 aTransactionId : Transaction id
|
|
148 |
* @param TInt aLocation : Location index
|
|
149 |
* @return TInt : KErrNone or error value
|
|
150 |
*/
|
|
151 |
TInt SimPbReqRead( TUint8 aTransactionId, const TInt aLocation );
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Checks if this cacheing operation is prepared to be launched
|
|
155 |
* @return TBool ETrue - operation is ready to be launched
|
|
156 |
*/
|
|
157 |
TBool IsPrepared() const;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Cancels cacheing request
|
|
161 |
*/
|
|
162 |
void CancelReq();
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Prepares the operation (makes it ready to be launched).
|
|
166 |
* @param aIpc IPC request
|
|
167 |
* @param aDataPackage parameters to prepare request with
|
|
168 |
* @return TInt KErrNotReady on attempt to prepare prepared operation
|
|
169 |
* @return TInt KErrArgument on attempt to create malformed request
|
|
170 |
*/
|
|
171 |
TInt PrepareReq(
|
|
172 |
TInt aIpc,
|
|
173 |
const CMmDataPackage* aDataPackage
|
|
174 |
);
|
|
175 |
|
|
176 |
/**
|
|
177 |
* Launches activated operation.
|
|
178 |
* @return TInt KErrNotReady on attempt to launch not prepared operation;
|
|
179 |
* or system-wide error code
|
|
180 |
*/
|
|
181 |
TInt LaunchReq();
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Completes the request.
|
|
185 |
* @param aErrorCode error code to be completed with
|
|
186 |
* @return TInt KErrNone or KErrNotSupported if operation is not prepared
|
|
187 |
*/
|
|
188 |
TInt CompleteReq( TInt aErrorCode );
|
|
189 |
|
|
190 |
public: // Data
|
|
191 |
// None
|
|
192 |
|
|
193 |
protected: // Data
|
|
194 |
// None
|
|
195 |
|
|
196 |
private: // Data
|
|
197 |
|
|
198 |
// Number of used SDN entries
|
|
199 |
TInt iNumOfUsedSDNEntries;
|
|
200 |
|
|
201 |
// Number of used VMBX entries
|
|
202 |
TInt iNumOfUsedVMBXEntries;
|
|
203 |
|
|
204 |
#ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
|
|
205 |
|
|
206 |
// Flag keeps track if GAS is cashed or not
|
|
207 |
TBool iGASCacheIsReady;
|
|
208 |
|
|
209 |
// Flag keeps track if AAS is cashed or not
|
|
210 |
TBool iAASCacheIsReady;
|
|
211 |
|
|
212 |
#endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
|
|
213 |
|
|
214 |
};
|
|
215 |
#endif // _CMMPHONEBOOK_OPERATION_CACHE_H
|
|
216 |
|
|
217 |
// End of File
|