|
1 /* |
|
2 * Copyright (c) 2005-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 "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 * Name : CSatNotifyRefresh.h |
|
16 * Part of : Common SIM ATK TSY / commonsimatktsy |
|
17 * Specific notifications class |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CSATNOTIFYREFRESH_H |
|
25 #define CSATNOTIFYREFRESH_H |
|
26 |
|
27 |
|
28 // INCLUDES |
|
29 #include <etelsat.h> |
|
30 #include "MSatNotificationsBase.h" |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CSatDataPackage; |
|
35 class CSatNotificationsTsy; |
|
36 |
|
37 /** |
|
38 * DESCRIPTION |
|
39 * SAT Refresh notification class. |
|
40 * Created when client requests to be notified when Refresh |
|
41 * command arrives from SIM. |
|
42 * |
|
43 * The purpose of this command is to enable the SAT |
|
44 * (which alerts other applications in the phone) to be notified |
|
45 * of the changes to the SIM configuration that have occurred as |
|
46 * the result of a SIM application activity. It is up to SAT to |
|
47 * ensure this is done correctly. |
|
48 * @lib Commonsimatktsy |
|
49 * @since 3.1 |
|
50 */ |
|
51 NONSHARABLE_CLASS ( CSatNotifyRefresh ) : public CBase, |
|
52 public MSatNotificationsBase |
|
53 { |
|
54 private: // Enumerations |
|
55 |
|
56 // Enumaration for refresh (SimInit) + change of EfImsi |
|
57 enum TImsiState |
|
58 { |
|
59 ENotSet, |
|
60 ERefreshSimInitReceived, |
|
61 EImsiNotEqual |
|
62 }; |
|
63 |
|
64 public: // Constructors and destructor |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
69 * return CSatNotifyRefresh*: created object |
|
70 */ |
|
71 static CSatNotifyRefresh* NewL( |
|
72 CSatNotificationsTsy* aNotificationsTsy ); |
|
73 |
|
74 /** |
|
75 * C++ Destructor. |
|
76 */ |
|
77 ~CSatNotifyRefresh(); |
|
78 |
|
79 private: |
|
80 |
|
81 /** |
|
82 * By default C++ constructor is private. |
|
83 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
84 * @return None |
|
85 */ |
|
86 CSatNotifyRefresh( CSatNotificationsTsy* aNotificationsTsy ); |
|
87 |
|
88 /** |
|
89 * Class attributes are created in ConstructL. |
|
90 * @param None |
|
91 * @return None |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 public: // Functions from base classes |
|
96 |
|
97 /** |
|
98 * Notification request received from client |
|
99 * @param aTsyReqHandle: request handle from ETel |
|
100 * @param aPackage: Packed data |
|
101 * @return KErrNone |
|
102 */ |
|
103 TInt Notify( const TTsyReqHandle aTsyReqHandle, |
|
104 const TDataPackage& aPackage ); |
|
105 |
|
106 /** |
|
107 * Cancels notification of RefreshRequiredParams request. |
|
108 * @param aReqHandle notify request handle |
|
109 * @return KErrNone |
|
110 */ |
|
111 TInt CancelNotification( const TTsyReqHandle aReqHandle ); |
|
112 |
|
113 /** |
|
114 * Completes the notification request received from client |
|
115 * @param aDataPackage: Packed return data |
|
116 * @param aErrorCode: Possible error code |
|
117 * @return KErrNone/ KErrCorrupt |
|
118 */ |
|
119 TInt CompleteNotifyL( CSatDataPackage* aDataPackage, TInt aErrorCode ); |
|
120 |
|
121 /** |
|
122 * Handles the refresh terminal response |
|
123 * @param aRsp: Response structure |
|
124 * @return Success/ Failure indication |
|
125 */ |
|
126 TInt TerminalResponseL( TDes8* aRsp ); |
|
127 |
|
128 /** |
|
129 * Completes the indication notifying the change of IMSI |
|
130 * @return none |
|
131 */ |
|
132 void CompleteImsiChange(); |
|
133 |
|
134 public: // New methods |
|
135 |
|
136 /** |
|
137 * Create notification specific terminal response data |
|
138 * @param aPCmdNumber: Proactive command number |
|
139 * @param aGeneralResult: Result of the proactive command |
|
140 * @param aAdditionalInfo: Additional info for terminal response |
|
141 * @return Success/Failure value |
|
142 */ |
|
143 TInt CreateTerminalRespL( TUint8 aPCmdNumber, TUint8 aGeneralResult, |
|
144 TDesC16& aAdditionalInfo ); |
|
145 |
|
146 /** |
|
147 * Notification request for RefreshRequired received from client |
|
148 * @param aReqHandle request handle from ETel |
|
149 * @param aDataPtr pointer to parameter class |
|
150 * @return KErrNone |
|
151 */ |
|
152 TInt NotifyRefreshRequired( const TTsyReqHandle aRegHandle, |
|
153 const TDataPackage& aPackage ); |
|
154 |
|
155 /** |
|
156 * Cancels notification of RefreshRequiredParams request. |
|
157 * @param aReqHandle notify request handle |
|
158 * @return KErrNone |
|
159 */ |
|
160 TInt CancelRefreshRequiredNotification( |
|
161 const TTsyReqHandle aReqHandle ); |
|
162 |
|
163 /** |
|
164 * Response for RefreshRequired notification |
|
165 * @param aPackage response structure |
|
166 * @return Success/ Failure indication |
|
167 */ |
|
168 TInt RefreshAllowedL( const TDataPackage& aPackage ); |
|
169 |
|
170 /** |
|
171 * Forwards terminal response data to CreateTerminalRespL - method |
|
172 * @param aDataPackage packed data |
|
173 * @param aErrorCode error code |
|
174 * @return Success/ Failure indication |
|
175 */ |
|
176 TInt CompleteTerminalRespDataL( CSatDataPackage* aDataPackage, |
|
177 TInt aErrorCode ); |
|
178 |
|
179 /** |
|
180 * Completes refresh request |
|
181 * @param aDataPackage packed data |
|
182 * @param aErrorCode |
|
183 * @return None |
|
184 */ |
|
185 void CompleteRequest( CSatDataPackage* aDataPackage, |
|
186 TInt aErrorCode ); |
|
187 |
|
188 private: // Data |
|
189 |
|
190 // Refresh package store. Package received from ETel |
|
191 RSat::TRefreshV2Pckg* iRefreshV2Pckg; |
|
192 // Notify refresh Required package store |
|
193 RSat::TRefreshV2Pckg* iRefreshRequiredV2Pckg; |
|
194 // File list with full path |
|
195 TBuf8<RSat::KRefreshedFileListMaxSize> iFileList; |
|
196 // To store Aplication id |
|
197 TBuf8<RSat::KAidMaxSize> iAid; |
|
198 // List of files that are cached in SIM ATK TSY |
|
199 TUint16 iInternalCache; |
|
200 // Pointer to the notifications tsy class |
|
201 CSatNotificationsTsy* iNotificationsTsy; |
|
202 // Current state of EfImsi and refresh (SimInit) |
|
203 TImsiState iImsiState; |
|
204 |
|
205 }; |
|
206 |
|
207 #endif // CSATNOTIFYREFRESH_H |