83
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2004 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: Xuikon view adapter header file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef XNVIEWADAPTER_H
|
|
19 |
#define XNVIEWADAPTER_H
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <aknview.h>
|
|
23 |
#include <babitflags.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "xnuistatelistener.h"
|
|
27 |
|
|
28 |
// Forward declarations
|
|
29 |
class CXnNode;
|
|
30 |
class CXnViewData;
|
|
31 |
class CXnViewManager;
|
|
32 |
class CXnAppUiAdapter;
|
|
33 |
class CXnControlAdapter;
|
|
34 |
class CXnKeyEventDispatcher;
|
|
35 |
class CXnBackgroundManager;
|
|
36 |
class CXnFocusControl;
|
|
37 |
|
|
38 |
// Class declaration
|
|
39 |
/**
|
|
40 |
* Adapts Xuikon view to Avkon view facilities.
|
|
41 |
*
|
|
42 |
* @ingroup group_xnlayoutengine
|
|
43 |
* @lib xn3layoutengine.lib
|
|
44 |
* @since S60 5.0
|
|
45 |
*/
|
|
46 |
NONSHARABLE_CLASS( CXnViewAdapter ) : public CAknView,
|
|
47 |
public MXnUiStateObserver
|
|
48 |
{
|
|
49 |
public:
|
|
50 |
/**
|
|
51 |
* Two-phase constructor
|
|
52 |
*/
|
|
53 |
static CXnViewAdapter* NewL( CXnAppUiAdapter& aAdapter );
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Destructor.
|
|
57 |
*/
|
|
58 |
~CXnViewAdapter();
|
|
59 |
|
|
60 |
public:
|
|
61 |
// new functions
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Flushes view's internals, called when appplication UI is reloaded.
|
|
65 |
*
|
|
66 |
* @since S60 5.0
|
|
67 |
*/
|
|
68 |
void ReloadUiL();
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Notifies view it will be destroyed
|
|
72 |
*
|
|
73 |
* @since S60 5.0
|
|
74 |
*/
|
|
75 |
void PrepareToExit();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Gets event dispatcher
|
|
79 |
*
|
|
80 |
* @since S60 5.0
|
|
81 |
* @return Event dispatcher
|
|
82 |
*/
|
|
83 |
CXnKeyEventDispatcher* EventDispatcher() const;
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Gets background manager
|
|
87 |
*
|
|
88 |
* @since S60 5.0
|
|
89 |
* return Background manager
|
|
90 |
*/
|
|
91 |
CXnBackgroundManager& BgManager() const;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Gets focus control
|
|
95 |
*
|
|
96 |
* @since S60 5.0
|
|
97 |
* return Focus control
|
|
98 |
*/
|
|
99 |
CXnFocusControl& FocusControl() const;
|
|
100 |
|
|
101 |
/**
|
|
102 |
* updates rsk by UI state
|
|
103 |
*
|
|
104 |
* @since S60 5.0
|
|
105 |
*/
|
|
106 |
void UpdateRskByUiStateL( const CXnViewData& aViewData );
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Closes all popups for this container.
|
|
110 |
*
|
|
111 |
* @since S60 5.0
|
|
112 |
*/
|
|
113 |
void CloseAllPopupsL();
|
|
114 |
|
|
115 |
public:
|
|
116 |
// from CAknView
|
|
117 |
|
|
118 |
/**
|
|
119 |
* @see CAknView
|
|
120 |
*/
|
|
121 |
TUid Id() const;
|
|
122 |
|
|
123 |
private:
|
|
124 |
// from CAknView
|
|
125 |
|
|
126 |
/**
|
|
127 |
* @see CAknView
|
|
128 |
*/
|
|
129 |
void DoActivateL(
|
|
130 |
const TVwsViewId &aPrevViewId,
|
|
131 |
TUid aCustomMessageId,
|
|
132 |
const TDesC8 &aCustomMessage );
|
|
133 |
|
|
134 |
/**
|
|
135 |
* @see CAknView
|
|
136 |
*/
|
|
137 |
void DoDeactivate();
|
|
138 |
|
|
139 |
private:
|
|
140 |
// from MXnUiStateObserver
|
|
141 |
|
|
142 |
/**
|
|
143 |
* @see MXnUiStateObserver
|
|
144 |
*/
|
|
145 |
void NotifyForegroundChanged(
|
|
146 |
MXnUiStateObserver::TForegroundStatus aStatus );
|
|
147 |
|
|
148 |
/**
|
|
149 |
* @see MXnUiStateObserver
|
|
150 |
*/
|
|
151 |
void NotifyLightStatusChanged( TBool aLightsOn );
|
|
152 |
|
|
153 |
/**
|
|
154 |
* @see MXnUiStateObserver
|
|
155 |
*/
|
|
156 |
void NotifyInCallStateChaged( TBool aInCall );
|
|
157 |
|
|
158 |
public:
|
|
159 |
// new functions
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Changes current container's controls state.
|
|
163 |
*
|
|
164 |
* @since S60 5.0
|
|
165 |
* @param aAwake ETrue if controls should exit from powersavemode,
|
|
166 |
* EFalse if controls should enter to powersavemode.
|
|
167 |
*/
|
|
168 |
void ChangeControlsStateL( TBool aAwake );
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Activates new container ro view.
|
|
172 |
* Deactivates internally previous container if it exists.
|
|
173 |
* This is always called from DoActivateL or from CXnViewManager when
|
|
174 |
* active view data is changed.
|
|
175 |
*
|
|
176 |
* @since S60 5.0
|
|
177 |
* @param aContainer Container to activate
|
|
178 |
* @param aEnterEditState ETrue if activated container should be set to edit state.
|
|
179 |
* @param aEffect Effect uid, default no effect
|
|
180 |
*/
|
|
181 |
void ActivateContainerL( CXnViewData& aContainer,
|
|
182 |
TBool aEnterEditState = EFalse, TUid aEffect = TUid::Null() );
|
|
183 |
|
|
184 |
private:
|
|
185 |
// new functions
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Deactivates the current container from view.
|
|
189 |
*
|
|
190 |
* @since S60 5.0
|
|
191 |
* @param aHide ETrue if old container is hidden, EFalse otherwise
|
|
192 |
*/
|
|
193 |
void DeactivateContainerL( TBool aHide = ETrue );
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Activates default container to view.
|
|
197 |
* Deactivates internally previous container if it exists.
|
|
198 |
*
|
|
199 |
* @since S60 5.0
|
|
200 |
* @param aEnterEditState ETrue if default container should be set to edit state.
|
|
201 |
*/
|
|
202 |
void ActivateDefaultContainerL( TBool aEnterEditState = EFalse );
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Sets edit state property of container
|
|
206 |
*
|
|
207 |
* @since S60 5.0
|
|
208 |
* @param aView container
|
|
209 |
* @param aEnter ETrue if container should be set to edit state.
|
|
210 |
*/
|
|
211 |
void EnterEditStateL( CXnViewData& aView, TBool aEnter );
|
|
212 |
|
|
213 |
/**
|
|
214 |
* Callback function to be used with CPeriodic.
|
|
215 |
*/
|
|
216 |
static TInt TimerCallback( TAny *aPtr );
|
|
217 |
|
|
218 |
private:
|
|
219 |
|
|
220 |
/**
|
|
221 |
* C++ Constructor
|
|
222 |
**/
|
|
223 |
CXnViewAdapter( CXnAppUiAdapter& aAdapter );
|
|
224 |
|
|
225 |
/**
|
|
226 |
* Two-phased constructor.
|
|
227 |
*/
|
|
228 |
void ConstructL();
|
|
229 |
|
|
230 |
private:
|
|
231 |
// Data
|
|
232 |
|
|
233 |
/** AppUi, Not owned */
|
|
234 |
CXnAppUiAdapter& iAppUiAdapter;
|
|
235 |
/** Background manager, Owned */
|
|
236 |
CXnBackgroundManager* iBgManager;
|
|
237 |
/** Focus control, Owned */
|
|
238 |
CXnFocusControl* iFocusControl;
|
|
239 |
/* Event dispatcher, Owned */
|
|
240 |
CXnKeyEventDispatcher* iEventDispatcher;
|
|
241 |
/* Activate trigger, Owned */
|
|
242 |
CXnNode* iActivate;
|
|
243 |
/* Deactivate trigger, Owned */
|
|
244 |
CXnNode* iDeactivate;
|
|
245 |
/** EditState trigger, Owned */
|
|
246 |
CXnNode* iEditState;
|
|
247 |
/** Active container, Not owned */
|
|
248 |
const CXnViewData* iContainer;
|
|
249 |
/** Flags */
|
|
250 |
TBitFlags32 iFlags;
|
|
251 |
/** Timer to set window group order after default view is activated, owned */
|
|
252 |
CPeriodic* iTimer;
|
|
253 |
/** Action to handle in timer callback */
|
|
254 |
TInt iAction;
|
|
255 |
};
|
|
256 |
|
|
257 |
#endif // XNVIEWADAPTER_H
|
|
258 |
|
|
259 |
// End of file
|