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 "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 #include "PopupFSM.h" |
|
18 #include "MPopupFSMActions.h" |
|
19 #include "PopupTrace.h" |
|
20 |
|
21 #pragma warning( disable:4100 ) |
|
22 #pragma warning( disable:4068 ) |
|
23 #pragma warn_unusedarg off |
|
24 |
|
25 TPopupFSM::TPopupFSM( MPopupFSMActions& aPopupFSMActions ) : |
|
26 iCurrentState( &iNotSetOffFocus ), |
|
27 iPopupFSMActions( aPopupFSMActions ) |
|
28 { |
|
29 } |
|
30 |
|
31 void TPopupFSM::TPopupStateBase::HandleForeground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
32 { |
|
33 TRACE( _L("TPopupStateBase::HandleForeground()") ); |
|
34 } |
|
35 |
|
36 void TPopupFSM::TPopupStateBase::HandleUpdate( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
37 { |
|
38 TRACE( _L("TPopupStateBase::HandleUpdate()") ); |
|
39 } |
|
40 |
|
41 void TPopupFSM::TPopupStateBase::HandleRequestCompleted( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
42 { |
|
43 TRACE( _L("TPopupStateBase::HandleRequestCompleted()") ); |
|
44 } |
|
45 |
|
46 void TPopupFSM::TPopupStateBase::HandleReset( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
47 { |
|
48 TRACE( _L("TPopupStateBase::HandleReset()") ); |
|
49 } |
|
50 |
|
51 void TPopupFSM::TPopupStateBase::HandleBackground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
52 { |
|
53 TRACE( _L("TPopupStateBase::HandleBackground()") ); |
|
54 } |
|
55 |
|
56 void TPopupFSM::TPopupStateBase::HandleGotFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
57 { |
|
58 TRACE( _L("TPopupStateBase::HandleGotFocus()") ); |
|
59 } |
|
60 |
|
61 void TPopupFSM::TPopupStateBase::HandleLostFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
62 { |
|
63 TRACE( _L("TPopupStateBase::HandleLostFocus()") ); |
|
64 } |
|
65 |
|
66 void TPopupFSM::HandleForeground() |
|
67 { |
|
68 iCurrentState->HandleForeground( this, iPopupFSMActions ); |
|
69 } |
|
70 |
|
71 void TPopupFSM::HandleUpdate() |
|
72 { |
|
73 iCurrentState->HandleUpdate( this, iPopupFSMActions ); |
|
74 } |
|
75 |
|
76 void TPopupFSM::HandleRequestCompleted() |
|
77 { |
|
78 iCurrentState->HandleRequestCompleted( this, iPopupFSMActions ); |
|
79 } |
|
80 |
|
81 void TPopupFSM::HandleReset() |
|
82 { |
|
83 iCurrentState->HandleReset( this, iPopupFSMActions ); |
|
84 } |
|
85 |
|
86 void TPopupFSM::HandleBackground() |
|
87 { |
|
88 iCurrentState->HandleBackground( this, iPopupFSMActions ); |
|
89 } |
|
90 |
|
91 void TPopupFSM::HandleGotFocus() |
|
92 { |
|
93 iCurrentState->HandleGotFocus( this, iPopupFSMActions ); |
|
94 } |
|
95 |
|
96 void TPopupFSM::HandleLostFocus() |
|
97 { |
|
98 iCurrentState->HandleLostFocus( this, iPopupFSMActions ); |
|
99 } |
|
100 |
|
101 void TPopupFSM::SetState( TPopupStateBase* aNewState ) |
|
102 { |
|
103 iCurrentState = aNewState; |
|
104 } |
|
105 |
|
106 void TPopupFSM::TNotSetOffFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
107 { |
|
108 TRACE( _L("TNotSetOffFocus::HandleUpdate()") ); |
|
109 aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); |
|
110 aPopupFSMActions.IssueCleanCaption(); |
|
111 } |
|
112 |
|
113 void TPopupFSM::TNotSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
114 { |
|
115 TRACE( _L("TNotSetOffFocus::HandleGotFocus()") ); |
|
116 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
117 } |
|
118 |
|
119 void TPopupFSM::TNotSetOffFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
120 { |
|
121 TRACE( _L("TNotSetOffFocus::HandleForeground()") ); |
|
122 aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); |
|
123 aPopupFSMActions.IssuePublishCaption(); |
|
124 } |
|
125 |
|
126 void TPopupFSM::TSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
127 { |
|
128 TRACE( _L("TSetOffFocus::HandleGotFocus()") ); |
|
129 aPopupFSM->SetState( &aPopupFSM->iGettingFocus ); |
|
130 aPopupFSMActions.StartShortTimer(); |
|
131 } |
|
132 |
|
133 void TPopupFSM::TSetOffFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
134 { |
|
135 TRACE( _L("TSetOffFocus::HandleReset()") ); |
|
136 aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); |
|
137 aPopupFSMActions.IssuePublishCaption(); |
|
138 } |
|
139 |
|
140 void TPopupFSM::TGettingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
141 { |
|
142 TRACE( _L("TGettingFocus::HandleRequestCompleted()") ); |
|
143 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
144 aPopupFSMActions.IssuePublishPopup(); |
|
145 aPopupFSMActions.StartLongTimer(); |
|
146 } |
|
147 |
|
148 void TPopupFSM::TGettingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
149 { |
|
150 TRACE( _L("TGettingFocus::HandleReset()") ); |
|
151 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
152 aPopupFSMActions.IssuePublishCaption(); |
|
153 aPopupFSMActions.CancelRequest(); |
|
154 } |
|
155 |
|
156 void TPopupFSM::TGettingFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
157 { |
|
158 TRACE( _L("TGettingFocus::HandleLostFocus()") ); |
|
159 aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); |
|
160 aPopupFSMActions.CancelRequest(); |
|
161 } |
|
162 |
|
163 void TPopupFSM::TLosingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
164 { |
|
165 TRACE( _L("TLosingFocus::HandleRequestCompleted()") ); |
|
166 aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); |
|
167 aPopupFSMActions.IssueCleanPopup(); |
|
168 } |
|
169 |
|
170 void TPopupFSM::TLosingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
171 { |
|
172 TRACE( _L("TLosingFocus::HandleReset()") ); |
|
173 aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); |
|
174 aPopupFSMActions.IssuePublishCaption(); |
|
175 aPopupFSMActions.CancelRequest(); |
|
176 } |
|
177 |
|
178 void TPopupFSM::TLosingFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
179 { |
|
180 TRACE( _L("TLosingFocus::HandleGotFocus()") ); |
|
181 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
182 aPopupFSMActions.CancelRequest(); |
|
183 aPopupFSMActions.StartLongTimer(); |
|
184 } |
|
185 |
|
186 void TPopupFSM::TNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
187 { |
|
188 TRACE( _L("TNotSetOnFocus::HandleUpdate()") ); |
|
189 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
190 aPopupFSMActions.IssueCleanCaption(); |
|
191 aPopupFSMActions.IssuePublishPopup(); |
|
192 aPopupFSMActions.StartLongTimer(); |
|
193 } |
|
194 |
|
195 void TPopupFSM::TNotSetOnFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
196 { |
|
197 TRACE( _L("TNotSetOnFocus::HandleLostFocus()") ); |
|
198 aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); |
|
199 } |
|
200 |
|
201 void TPopupFSM::TNotSetOnFocus::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
202 { |
|
203 TRACE( _L("TNotSetOnFocus::HandleBackground()") ); |
|
204 aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); |
|
205 } |
|
206 |
|
207 void TPopupFSM::TNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
208 { |
|
209 TRACE( _L("TNotSetOnFocus::HandleForeground()") ); |
|
210 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
211 aPopupFSMActions.IssuePublishCaption(); |
|
212 } |
|
213 |
|
214 void TPopupFSM::TVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
215 { |
|
216 TRACE( _L("TVisible::HandleUpdate()") ); |
|
217 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
218 aPopupFSMActions.IssueCleanCaption(); |
|
219 aPopupFSMActions.IssuePublishPopup(); |
|
220 aPopupFSMActions.StartLongTimer(); |
|
221 } |
|
222 |
|
223 void TPopupFSM::TVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
224 { |
|
225 TRACE( _L("TVisible::HandleReset()") ); |
|
226 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
227 aPopupFSMActions.IssuePublishCaption(); |
|
228 aPopupFSMActions.IssueCleanPopup(); |
|
229 aPopupFSMActions.CancelRequest(); |
|
230 } |
|
231 |
|
232 void TPopupFSM::TVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
233 { |
|
234 TRACE( _L("TVisible::HandleLostFocus()") ); |
|
235 aPopupFSM->SetState( &aPopupFSM->iLosingFocus ); |
|
236 aPopupFSMActions.CancelRequest(); |
|
237 aPopupFSMActions.CompleteSelf(); |
|
238 } |
|
239 |
|
240 void TPopupFSM::TVisible::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
241 { |
|
242 TRACE( _L("TVisible::HandleRequestCompleted()") ); |
|
243 aPopupFSM->SetState( &aPopupFSM->iNotVisible ); |
|
244 aPopupFSMActions.IssueCleanPopup(); |
|
245 } |
|
246 |
|
247 void TPopupFSM::TVisible::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
248 { |
|
249 TRACE( _L("TVisible::HandleBackground()") ); |
|
250 aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); |
|
251 aPopupFSMActions.CancelRequest(); |
|
252 aPopupFSMActions.IssueCleanPopup(); |
|
253 } |
|
254 |
|
255 void TPopupFSM::TNotVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
256 { |
|
257 TRACE( _L("TNotVisible::HandleUpdate()") ); |
|
258 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
259 aPopupFSMActions.IssueCleanCaption(); |
|
260 aPopupFSMActions.IssuePublishPopup(); |
|
261 aPopupFSMActions.StartLongTimer(); |
|
262 } |
|
263 |
|
264 void TPopupFSM::TNotVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
265 { |
|
266 TRACE( _L("TNotVisible::HandleReset()") ); |
|
267 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
268 aPopupFSMActions.IssuePublishCaption(); |
|
269 } |
|
270 |
|
271 void TPopupFSM::TNotVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) |
|
272 { |
|
273 TRACE( _L("TNotVisible::HandleLostFocus()") ); |
|
274 aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); |
|
275 } |
|
276 |
|
277 void TPopupFSM::TBackgroundNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
278 { |
|
279 TRACE( _L("TBackgroundNotSetOnFocus::HandleForeground()") ); |
|
280 aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); |
|
281 aPopupFSMActions.IssuePublishCaption(); |
|
282 } |
|
283 |
|
284 void TPopupFSM::TBackgroundNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
285 { |
|
286 TRACE( _L("TBackgroundNotSetOnFocus::HandleUpdate()") ); |
|
287 aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); |
|
288 aPopupFSMActions.IssueCleanCaption(); |
|
289 } |
|
290 |
|
291 void TPopupFSM::TBackgroundSetOnFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
292 { |
|
293 TRACE( _L("TBackgroundSetOnFocus::HandleReset()") ); |
|
294 aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); |
|
295 aPopupFSMActions.IssuePublishCaption(); |
|
296 } |
|
297 |
|
298 void TPopupFSM::TBackgroundSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) |
|
299 { |
|
300 TRACE( _L("TBackgroundSetOnFocus::HandleForeground()") ); |
|
301 aPopupFSM->SetState( &aPopupFSM->iVisible ); |
|
302 aPopupFSMActions.IssuePublishPopup(); |
|
303 aPopupFSMActions.StartLongTimer(); |
|
304 } |
|
305 |
|
306 // End of file |
|