|
33
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2002-2010 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: RefreshRequired command handler
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
#ifndef CREFRESHREQUIREDHANDLER_H
|
|
|
21 |
#define CREFRESHREQUIREDHANDLER_H
|
|
|
22 |
|
|
|
23 |
// INCLUDES
|
|
|
24 |
#include <etelsat.h>
|
|
|
25 |
#include "SatSTypes.h"
|
|
|
26 |
#include "CSatCommandHandler.h"
|
|
|
27 |
|
|
|
28 |
// FORWARD DECLARATION
|
|
|
29 |
class MSatUtils;
|
|
|
30 |
|
|
|
31 |
// CLASS DECLARATION
|
|
|
32 |
|
|
|
33 |
/**
|
|
|
34 |
* Command handler for RefreshRequired command.
|
|
|
35 |
*
|
|
|
36 |
* @lib RefreshRequiredCmd.lib
|
|
|
37 |
* @since Series 60 3.0
|
|
|
38 |
*/
|
|
|
39 |
class CRefreshRequiredHandler : public CSatCommandHandler
|
|
|
40 |
{
|
|
|
41 |
public: // Constructors and destructor
|
|
|
42 |
|
|
|
43 |
/**
|
|
|
44 |
* Two-phased constructor.
|
|
|
45 |
* @param aUtils SAT Utils interface
|
|
|
46 |
*/
|
|
|
47 |
static CRefreshRequiredHandler* NewL( MSatUtils* aUtils );
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* Destructor.
|
|
|
51 |
*/
|
|
|
52 |
virtual ~CRefreshRequiredHandler();
|
|
|
53 |
|
|
|
54 |
public: // Functions from base classes
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
* From MSatEventObserver. Overrides the default implementation.
|
|
|
58 |
* @param aEvent An event that is occured.
|
|
|
59 |
*/
|
|
|
60 |
void Event( TInt aEvent );
|
|
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
* From MSatCommand.
|
|
|
64 |
*/
|
|
|
65 |
void ClientResponse();
|
|
|
66 |
|
|
|
67 |
protected: // Functions from base classes
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* From CActive Cancels the usat request.
|
|
|
71 |
*/
|
|
|
72 |
void DoCancel();
|
|
|
73 |
|
|
|
74 |
/**
|
|
|
75 |
* From CCommandHandler Requests the command notification.
|
|
|
76 |
* @param aStatus Request status
|
|
|
77 |
*/
|
|
|
78 |
void IssueUSATRequest( TRequestStatus& aStatus );
|
|
|
79 |
|
|
|
80 |
/**
|
|
|
81 |
* From CSatCommandHandler Precheck before executing the command.
|
|
|
82 |
* @return TBool indicating command is currently allowed.
|
|
|
83 |
*/
|
|
|
84 |
TBool CommandAllowed();
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* From CSatCommandHandler Need for ui session.
|
|
|
88 |
* @return TBool indicating need of ui session.
|
|
|
89 |
*/
|
|
|
90 |
TBool NeedUiSession();
|
|
|
91 |
|
|
|
92 |
/**
|
|
|
93 |
* From CSatCommandHandler Called when USAT API notifies that command.
|
|
|
94 |
*/
|
|
|
95 |
void HandleCommand();
|
|
|
96 |
|
|
|
97 |
/**
|
|
|
98 |
* From CSatCommandHandler. Indicates the failure of launching ui client.
|
|
|
99 |
*/
|
|
|
100 |
void UiLaunchFailed();
|
|
|
101 |
|
|
|
102 |
private:
|
|
|
103 |
|
|
|
104 |
/**
|
|
|
105 |
* C++ default constructor.
|
|
|
106 |
*/
|
|
|
107 |
CRefreshRequiredHandler();
|
|
|
108 |
|
|
|
109 |
/**
|
|
|
110 |
* By default Symbian 2nd phase constructor is private.
|
|
|
111 |
*/
|
|
|
112 |
void ConstructL();
|
|
|
113 |
|
|
|
114 |
private: // New functions
|
|
|
115 |
|
|
|
116 |
/**
|
|
|
117 |
* Checks whether EFimsi file change conditions prevent refresh.
|
|
|
118 |
* @return TBool indicating EFimsi file refresh allowed.
|
|
|
119 |
*/
|
|
|
120 |
TBool EFIMSIRefreshAllowed() const;
|
|
|
121 |
|
|
|
122 |
/**
|
|
|
123 |
* Checks whether phone state prevents refresh.
|
|
|
124 |
* @return TBool indicating refresh allowed.
|
|
|
125 |
*/
|
|
|
126 |
TBool BusyNotAllowed();
|
|
|
127 |
|
|
|
128 |
/**
|
|
|
129 |
* Asks permission to make refresh from clients.
|
|
|
130 |
* @return TBool indicating refresh can be started immediately.
|
|
|
131 |
*/
|
|
|
132 |
TBool QueryRefreshClients();
|
|
|
133 |
|
|
|
134 |
/**
|
|
|
135 |
* Refresh observers call this to indicate refresh allow.
|
|
|
136 |
* Starts the refresh when all clients has agreed.
|
|
|
137 |
* @param aAllow Indicates allowness of this client.
|
|
|
138 |
*/
|
|
|
139 |
void AllowRefresh( TBool aAllow );
|
|
|
140 |
|
|
|
141 |
/**
|
|
|
142 |
* Start refresh.
|
|
|
143 |
*/
|
|
|
144 |
void DoRefresh();
|
|
|
145 |
|
|
|
146 |
/**
|
|
|
147 |
* Notifies the refresh clients about refresh cancel.
|
|
|
148 |
*/
|
|
|
149 |
void NotifyRefreshClientsCancel();
|
|
|
150 |
|
|
|
151 |
/**
|
|
|
152 |
* Sends the RefreshRequired specific response to the SIM and renews
|
|
|
153 |
* the sat request. Note, this replaces TerminalRsp() here.
|
|
|
154 |
* @param aRsp RefreshRequired response data package.
|
|
|
155 |
*/
|
|
|
156 |
void RefreshAllowed( const TDesC8& aRsp );
|
|
|
157 |
|
|
|
158 |
private: // Data
|
|
|
159 |
|
|
|
160 |
// Refresh command data.
|
|
|
161 |
RSat::TRefreshV2 iRefreshRequiredData;
|
|
|
162 |
|
|
|
163 |
// Refresh command package.
|
|
|
164 |
RSat::TRefreshV2Pckg iRefreshRequiredPckg;
|
|
|
165 |
|
|
|
166 |
// Response from client.
|
|
|
167 |
RSat::TRefreshRspV1 iRefreshRequiredRsp;
|
|
|
168 |
|
|
|
169 |
// Response package.
|
|
|
170 |
RSat::TRefreshRspV1Pckg iRefreshRequiredRspPckg;
|
|
|
171 |
|
|
|
172 |
// Query command data.
|
|
|
173 |
TSatQueryV1 iQueryData;
|
|
|
174 |
|
|
|
175 |
// Query package.
|
|
|
176 |
TSatQueryV1Pckg iQueryPckg;
|
|
|
177 |
|
|
|
178 |
// Query response.
|
|
|
179 |
TSatQueryRspV1 iQueryRsp;
|
|
|
180 |
|
|
|
181 |
// Query response package.
|
|
|
182 |
TSatQueryRspV1Pckg iQueryRspPckg;
|
|
|
183 |
|
|
|
184 |
// Count of refresh clients queried refresh allow but not yet answered.
|
|
|
185 |
TInt iRefreshQueryClientCount;
|
|
|
186 |
|
|
|
187 |
// Response of refresh query.
|
|
|
188 |
TBool iAllowRefresh;
|
|
|
189 |
|
|
|
190 |
};
|
|
|
191 |
|
|
|
192 |
#endif // CREFRESHREQUIREDHANDLER_H
|
|
|
193 |
|
|
|
194 |
// End of File
|