|
1 /* |
|
2 * Copyright (c) 2006 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: Application UI definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_ALFAPPUI_H |
|
21 #define C_ALFAPPUI_H |
|
22 |
|
23 #include <aknappui.h> |
|
24 #include <alf/alfconstants.h> |
|
25 |
|
26 class CHuiEnv; |
|
27 class CHuiRoster; |
|
28 class CHuiControlGroup; |
|
29 class CHuiVisual; |
|
30 class CAlfAppServer; |
|
31 class CAlfSharedDisplayCoeControl; |
|
32 class CHuiDisplay; |
|
33 class CAlfAppSrvSessionBase; |
|
34 class CAlfSrvResourceManager; |
|
35 class CAlfSrvSettingsHandler; |
|
36 |
|
37 enum TAlfSrvSetting |
|
38 { |
|
39 EAlfSrvSettingDefaultFramerate, |
|
40 EAlfSrvSettingMaxCpuUsage, |
|
41 EAlfSrvSettingMaxResourceCacheSize, |
|
42 EAlfSrvSettingEffectsComplexityFactor // includes the RnD flag changes. |
|
43 }; |
|
44 |
|
45 class MAlfSrvSettingsObserver |
|
46 { |
|
47 public: |
|
48 virtual void MAlfSrvUintSettingChangedL( TAlfSrvSetting aSetting, TUint aNewValue ) = 0; |
|
49 }; |
|
50 |
|
51 |
|
52 /** |
|
53 * Application UI class. |
|
54 * |
|
55 * @since S60 v3.2 |
|
56 */ |
|
57 NONSHARABLE_CLASS(CAlfAppUi) : public CAknAppUi, public MAlfSrvSettingsObserver |
|
58 { |
|
59 |
|
60 public: // new methods |
|
61 |
|
62 /** |
|
63 * Constructor |
|
64 */ |
|
65 IMPORT_C CAlfAppUi(); |
|
66 |
|
67 /** |
|
68 * Destructor |
|
69 */ |
|
70 IMPORT_C ~CAlfAppUi(); |
|
71 |
|
72 /** |
|
73 * Retuns a reference to CHuiEnv object. |
|
74 * @return HuiEnv. Ownership not transferred. |
|
75 */ |
|
76 CHuiEnv& HuiEnv(); |
|
77 |
|
78 /** |
|
79 * Called when all clients have existed. |
|
80 */ |
|
81 void AllClientsClosed(); |
|
82 |
|
83 /** |
|
84 * Called when client is about to exit. |
|
85 * @param aClientId Client to be removed. |
|
86 */ |
|
87 void FreeResourcesForClient( TInt aClientId ); |
|
88 |
|
89 /** |
|
90 * Returns a common window-owning control |
|
91 * @param Control. NULL if not used. Ownership not transferred. |
|
92 */ |
|
93 IMPORT_C CCoeControl* Container(); |
|
94 |
|
95 /** |
|
96 * Adds display into the common container. |
|
97 * @param aDisplay to be added. |
|
98 */ |
|
99 IMPORT_C void AppendDisplayOnSharedWindowL( CHuiDisplay& aDisplay ); |
|
100 |
|
101 void AppendTvDisplayOnSharedWindowL( CHuiDisplay& aDisplay ); |
|
102 |
|
103 void RemoveTvDisplayOnSharedWindow( CHuiDisplay& aDisplay ); |
|
104 |
|
105 CHuiDisplay* CAlfAppUi::FindTvDisplayOnSharedWindow(); |
|
106 |
|
107 CAlfSrvSettingsHandler& SettingsHandler(); |
|
108 |
|
109 /** |
|
110 * Sets window server fading to common window-owning control. |
|
111 * @param aFading ETrue if it needs to be faded, EFalse otherwise. |
|
112 */ |
|
113 void SetContainerNonFading( TBool aFading ); |
|
114 |
|
115 public: // from base classes |
|
116 |
|
117 // from base class CAknAppUi |
|
118 |
|
119 /** |
|
120 * From CAknAppUi. |
|
121 * 2nd phase constructor. Called by the framework after |
|
122 * the 1st phase construction. |
|
123 */ |
|
124 IMPORT_C void ConstructL(); |
|
125 |
|
126 /** |
|
127 * From CAknAppUi. |
|
128 * Called by the frawework when a system event is received. |
|
129 * |
|
130 * @param aEvent Occurred event. |
|
131 */ |
|
132 IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent); |
|
133 |
|
134 /** |
|
135 * From CAknAppUi. |
|
136 * Called by the frawework when a system event is received. |
|
137 * |
|
138 * @param aEvent Occurred event. |
|
139 */ |
|
140 IMPORT_C void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination); |
|
141 |
|
142 /** |
|
143 * From CAknAppUi. |
|
144 * Called when framework calls rendezvous. |
|
145 * |
|
146 * @return ETrue. Meaning the framework will synchronize the application to the starter |
|
147 */ |
|
148 IMPORT_C TBool FrameworkCallsRendezvous() const; |
|
149 |
|
150 /** |
|
151 * From CAknAppUi. |
|
152 * Called when system resources changes. |
|
153 * |
|
154 * @param aType Changed resource. |
|
155 */ |
|
156 IMPORT_C void HandleResourceChangeL( TInt aType ); |
|
157 |
|
158 /** |
|
159 * From CAknAppUi. |
|
160 * Called by the frawework when a command is received. |
|
161 * |
|
162 * @param aCommand The command |
|
163 */ |
|
164 IMPORT_C void HandleCommandL(TInt aCommand); |
|
165 |
|
166 void MAlfSrvUintSettingChangedL( TAlfSrvSetting aSetting, TUint aNewValue ); |
|
167 |
|
168 /** |
|
169 * Posts QTcommand buffer from clientwindow to CanvasVisual |
|
170 * |
|
171 * @param aParams Commandbuffer parameters containg window information |
|
172 * and QT commandbuffer |
|
173 */ |
|
174 void PostQTCommandBufferL( TAlfQtCommandBufferParams aParams ); |
|
175 public: // internal utilities |
|
176 void StartPointerEventHandling(); |
|
177 void EndPointerEventHandling(); |
|
178 void UpdateActiveSession(CAlfAppSrvSessionBase* aSession); |
|
179 |
|
180 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
181 |
|
182 TInt FirstAlfControlGroupIndex( TInt aScreenNumber = 0); |
|
183 TInt LastAlfControlGroupIndex( TInt aScreenNumber = 0); |
|
184 void ShowControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber ); |
|
185 void SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, CHuiVisual* aVisual); |
|
186 /** |
|
187 * Moves the server window group relative to the clinet (parent) wg. |
|
188 * |
|
189 * @param aWindowGroup Server window group |
|
190 * @param aParentIdentifier Client side window group |
|
191 * @param aPosition Server's wg position compared to the client's wg. |
|
192 */ |
|
193 void AdjustWindowGroupPositionL( |
|
194 TInt aParentIdentifier, |
|
195 TInt aPosition ); |
|
196 void SetAlfWindowGroupId(TInt aWgId); |
|
197 void NotifyLowMemory(TInt aAmountOfFreeMemRequested); |
|
198 TInt ForceSwRendering(TBool aEnabled); |
|
199 |
|
200 private: |
|
201 |
|
202 void CreateHuiEnvL(); |
|
203 |
|
204 private: |
|
205 |
|
206 class CAlfAppUiData; |
|
207 CAlfAppUiData* iData; |
|
208 }; |
|
209 |
|
210 #endif // C_ALFAPPUI_H |