1 /* |
|
2 * ============================================================================ |
|
3 * Name : hgteleportappui.h |
|
4 * Part of : Hg Teleport |
|
5 * Description : appui |
|
6 * Version : %version: sa1spcx1#26 % |
|
7 * |
|
8 * Copyright © 2008 Nokia. All rights reserved. |
|
9 * This material, including documentation and any related computer |
|
10 * programs, is protected by copyright controlled by Nokia. All |
|
11 * rights are reserved. Copying, including reproducing, storing, |
|
12 * adapting or translating, any or all of this material requires the |
|
13 * prior written consent of Nokia. This material also contains |
|
14 * confidential information which may not be disclosed to others |
|
15 * without the prior written consent of Nokia. |
|
16 * ============================================================================ |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef HGTELEPORTAPPUI_H |
|
21 #define HGTELEPORTAPPUI_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <aknappui.h> |
|
25 |
|
26 #include <gfxtranseffect/gfxtranseffect.h> |
|
27 #include <akntransitionutils.h> |
|
28 |
|
29 #include "hgproplistener.h" |
|
30 #include "hgcenreplistener.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CHgTeleportAppView; |
|
34 class CHgActionUtility; |
|
35 class CHgTeleportDeviceState; |
|
36 |
|
37 /** |
|
38 * CHgTeleportAppUi |
|
39 * Appui for hg teleport app |
|
40 */ |
|
41 class CHgTeleportAppUi : public CAknAppUi, |
|
42 public MHgPropertyChangeObserver, |
|
43 public MHgCenrepChangeObserver, |
|
44 public MGfxTransEffectObserver |
|
45 { |
|
46 |
|
47 public: |
|
48 /** |
|
49 * Perform the second phase construction of a CHgTeleportAppUi object |
|
50 * this needs to be public due to the way the framework constructs the AppUi |
|
51 */ |
|
52 void ConstructL(); |
|
53 |
|
54 /** |
|
55 * Perform the first phase of two phase construction. |
|
56 * This needs to be public due to the way the framework constructs the AppUi |
|
57 */ |
|
58 CHgTeleportAppUi(); |
|
59 |
|
60 /** |
|
61 * Destroy the object and release all memory objects |
|
62 */ |
|
63 ~CHgTeleportAppUi(); |
|
64 |
|
65 public: //effects |
|
66 /** |
|
67 * @return value of theme effects enabled flag |
|
68 */ |
|
69 TBool EffectsEnabled() const; |
|
70 |
|
71 /** |
|
72 * Function start transition |
|
73 */ |
|
74 void StartTransion( TUint aTransitionType ); |
|
75 |
|
76 /** |
|
77 * from MGfxTransEffectObserver |
|
78 */ |
|
79 void TransitionFinished(const CCoeControl* aControl, TUint aAction); |
|
80 |
|
81 void MoveAppToForeground( TUint aTransitionType ); |
|
82 void MoveAppToBackground( TUint aTransitionType ); |
|
83 |
|
84 public: |
|
85 /** |
|
86 * From MHgCenrepChangeObserver |
|
87 */ |
|
88 void CenrepChanged( TUint32 aKey, TInt aNewValue ); |
|
89 |
|
90 |
|
91 private: |
|
92 |
|
93 // From MHgPropertyChangeObserver |
|
94 void PropertyChanged( TUid aCategory, TUint aKey ); |
|
95 |
|
96 // From CEikAppUi |
|
97 void HandleResourceChangeL( TInt aType ); |
|
98 void HandleForegroundEventL( TBool aForeground ); |
|
99 void HandleCommandL( TInt aCommand ); |
|
100 |
|
101 void StartTransition( TUint aTranstionId, |
|
102 TBool aVisibility, |
|
103 TBool aLayers, |
|
104 TUint aSubCom ); |
|
105 |
|
106 private: // New functions |
|
107 |
|
108 /** |
|
109 * Called from HandleForegroundEventL if the app came to foreground. |
|
110 */ |
|
111 void HandleSwitchToForegroundEvent(); |
|
112 |
|
113 /** |
|
114 * Called from HandleForegroundEventL if the app went to background. |
|
115 */ |
|
116 void HandleSwitchToBackgroundEvent(); |
|
117 |
|
118 /** |
|
119 * Sets P&S property which is used to monitor and set Teleport to |
|
120 * background/foreground and short/long app key press. |
|
121 * |
|
122 * @param aValue Property value. |
|
123 */ |
|
124 void SetTeleportStateProperty( TInt aValue ); |
|
125 |
|
126 /** |
|
127 * Sends request for close some |
|
128 * other apps to free memory for |
|
129 * teleport app |
|
130 */ |
|
131 void FreeMemoryRequest(); |
|
132 |
|
133 static TInt GoToBackgroundTimerCallback( TAny* aParam ); |
|
134 |
|
135 private: |
|
136 |
|
137 // Teleport application view, owned |
|
138 CHgTeleportAppView* iAppView; |
|
139 |
|
140 // Listener for app key long press P&S, owned |
|
141 CHgPropertyListener* iPropListener; |
|
142 |
|
143 // Tells if Teleport is in foreground or in background |
|
144 TBool iForeground; |
|
145 |
|
146 // Application arch task which refers to our own app |
|
147 TApaTask iApplicationTask; |
|
148 |
|
149 // Device state |
|
150 CHgTeleportDeviceState* iDeviceState; |
|
151 |
|
152 // Buffer to keeping some memory allocation while being in background. |
|
153 TUint8* iMemAllocBuf; |
|
154 |
|
155 CPeriodic* iGoToBackgroundTimer; |
|
156 |
|
157 TBool iEffectsEnabled; |
|
158 |
|
159 /** |
|
160 * Cenrep listener for the tfxserver enabled/disabled key. |
|
161 */ |
|
162 CHgCenrepListener* iThemeEffectsEnabledWatcher; |
|
163 }; |
|
164 |
|
165 #endif // HGTELEPORTAPPUI_H |
|