|
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 CXnBgControl; |
|
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 private: |
|
50 // friend classes |
|
51 friend class CXnViewManager; |
|
52 |
|
53 public: |
|
54 /** |
|
55 * Two-phase constructor |
|
56 */ |
|
57 static CXnViewAdapter* NewL( CXnAppUiAdapter& aAdapter ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CXnViewAdapter(); |
|
63 |
|
64 public: |
|
65 // new functions |
|
66 |
|
67 /** |
|
68 * Flushes view's internals, called when appplication UI is reloaded. |
|
69 * |
|
70 * @since S60 5.0 |
|
71 */ |
|
72 void ReloadUiL(); |
|
73 |
|
74 /** |
|
75 * Notifies view it will be destroyed |
|
76 * |
|
77 * @since S60 5.0 |
|
78 */ |
|
79 void PrepareDestroy(); |
|
80 |
|
81 /** |
|
82 * Gets event dispatcher |
|
83 * |
|
84 * @since S60 5.0 |
|
85 * @return Event dispatcher |
|
86 */ |
|
87 CXnKeyEventDispatcher* EventDispatcher() const; |
|
88 |
|
89 /** |
|
90 * Gets bg control |
|
91 * |
|
92 * @since S60 5.0 |
|
93 * return Bg control |
|
94 */ |
|
95 CCoeControl& BgControl() const; |
|
96 |
|
97 /** |
|
98 * Gets focus control |
|
99 * |
|
100 * @since S60 5.0 |
|
101 * return Focus control |
|
102 */ |
|
103 CXnFocusControl& FocusControl() const; |
|
104 |
|
105 /** |
|
106 * updates rsk by mode |
|
107 * |
|
108 * @since S60 5.0 |
|
109 */ |
|
110 void UpdateRskByModeL(); |
|
111 |
|
112 public: |
|
113 // from CAknView |
|
114 |
|
115 /** |
|
116 * @see CAknView |
|
117 */ |
|
118 TUid Id() const; |
|
119 |
|
120 private: |
|
121 // from CAknView |
|
122 |
|
123 /** |
|
124 * @see CAknView |
|
125 */ |
|
126 void DoActivateL( |
|
127 const TVwsViewId &aPrevViewId, |
|
128 TUid aCustomMessageId, |
|
129 const TDesC8 &aCustomMessage ); |
|
130 |
|
131 /** |
|
132 * @see CAknView |
|
133 */ |
|
134 void DoDeactivate(); |
|
135 |
|
136 private: |
|
137 // from MXnUiStateObserver |
|
138 |
|
139 /** |
|
140 * @see MXnUiStateObserver |
|
141 */ |
|
142 void NotifyForegroundChanged( |
|
143 MXnUiStateObserver::TForegroundStatus aStatus ); |
|
144 |
|
145 /** |
|
146 * @see MXnUiStateObserver |
|
147 */ |
|
148 void NotifyLightStatusChanged( TBool aLightsOn ); |
|
149 |
|
150 /** |
|
151 * @see MXnUiStateObserver |
|
152 */ |
|
153 void NotifyInCallStateChaged( TBool aInCall ); |
|
154 |
|
155 private: |
|
156 // new functions |
|
157 |
|
158 /** |
|
159 * Changes current container's controls state. |
|
160 * |
|
161 * @since S60 5.0 |
|
162 * @param aAwake ETrue if controls should exit from powersavemode, |
|
163 * EFalse if controls should enter to powersavemode. |
|
164 */ |
|
165 void ChangeControlsStateL( TBool aAwake ); |
|
166 |
|
167 /** |
|
168 * Activates new container ro view. |
|
169 * Deactivates internally previous container if it exists. |
|
170 * This is always called from DoActivateL or from CXnViewManager. |
|
171 * |
|
172 * @since S60 5.0 |
|
173 * @param aContainer Container to activate |
|
174 * @param aEnterEditState ETrue if activated container should be set to edit state. |
|
175 */ |
|
176 void ActivateContainerL( CXnViewData& aContainer, |
|
177 TBool aEnterEditState = EFalse ); |
|
178 |
|
179 /** |
|
180 * Deactivates the current container from view. |
|
181 * |
|
182 * @since S60 5.0 |
|
183 */ |
|
184 void DeactivateContainerL(); |
|
185 |
|
186 private: |
|
187 |
|
188 /** |
|
189 * C++ Constructor |
|
190 **/ |
|
191 CXnViewAdapter( CXnAppUiAdapter& aAdapter ); |
|
192 |
|
193 /** |
|
194 * Two-phased constructor. |
|
195 */ |
|
196 void ConstructL(); |
|
197 |
|
198 private: |
|
199 // Data |
|
200 |
|
201 /** AppUi, Not owned */ |
|
202 CXnAppUiAdapter& iAppUiAdapter; |
|
203 /** Bg control, Owned */ |
|
204 CXnBgControl* iBgControl; |
|
205 /** Focus control, Owned */ |
|
206 CXnFocusControl* iFocusControl; |
|
207 /* Event dispatcher, Owned */ |
|
208 CXnKeyEventDispatcher* iEventDispatcher; |
|
209 /* Activate trigger, Owned */ |
|
210 CXnNode* iActivate; |
|
211 /* Deactivate trigger, Owned */ |
|
212 CXnNode* iDeactivate; |
|
213 /** EditState trigger, Owned */ |
|
214 CXnNode* iEditState; |
|
215 /** Active container, Not owned */ |
|
216 const CXnViewData* iContainer; |
|
217 /** Flags */ |
|
218 TBitFlags32 iFlags; |
|
219 }; |
|
220 |
|
221 #endif // XNVIEWADAPTER_H |
|
222 |
|
223 // End of file |