|
1 /* |
|
2 * Copyright (c) 2009-2010 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 * CBootstrapAppUi application UI class declaration. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __BOOTSTRAPAPPUI_H__ |
|
22 #define __BOOTSTRAPAPPUI_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <eikapp.h> |
|
26 #include <aknappui.h> |
|
27 #include <aknglobalconfirmationquery.h> |
|
28 #include "debug.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CAknGlobalNote; |
|
32 class CGlobalWaitNoteObserver; |
|
33 class CStateMachine; |
|
34 |
|
35 enum AppErrorId |
|
36 { |
|
37 ENoAppError = 0, //0 |
|
38 EInstallationFailed, |
|
39 EDownloadFailed //2 |
|
40 }; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 /** |
|
44 * CBootstrapAppUi application UI class. |
|
45 * Interacts with the user through the UI and request message processing |
|
46 * from the handler class |
|
47 */ |
|
48 class CBootstrapAppUi : public CAknAppUi |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * ConstructL. |
|
54 * 2nd phase constructor. |
|
55 */ |
|
56 void ConstructL(); |
|
57 |
|
58 /** |
|
59 * CBootstrapAppUi. |
|
60 * C++ default constructor. This needs to be public due to |
|
61 * the way the framework constructs the AppUi |
|
62 */ |
|
63 CBootstrapAppUi(); |
|
64 |
|
65 /** |
|
66 * ~CBootstrapAppUi. |
|
67 * Virtual Destructor. |
|
68 */ |
|
69 virtual ~CBootstrapAppUi(); |
|
70 |
|
71 /** |
|
72 * ExitApp |
|
73 * Handle exit of App for success as well failures on all cases |
|
74 */ |
|
75 void ExitApp(TInt aAppState); |
|
76 |
|
77 /** |
|
78 * HandleGlobalWaitNoteCancel |
|
79 * Handle user press cancel |
|
80 */ |
|
81 void HandleGlobalWaitNoteCancel(const TInt& aStatus); |
|
82 |
|
83 /** |
|
84 * SetErrorId |
|
85 * Set the Error Id - to determine the type of error note displayed. |
|
86 */ |
|
87 inline void SetErrorId( AppErrorId aErrorId ) |
|
88 { |
|
89 iErrorId = aErrorId; |
|
90 }; |
|
91 |
|
92 inline CEikonEnv* EikonEnv() const {return iEikonEnv;} |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * InitializeSIL |
|
98 * Init the app and start the SM. |
|
99 */ |
|
100 void InitializeSIL(); |
|
101 |
|
102 /** |
|
103 * WaitForInstallCompleteL |
|
104 * Subscribe to the installer and get the wrapper UID (latest installation) once installer is free. |
|
105 */ |
|
106 void WaitForInstallCompleteL(); |
|
107 |
|
108 /** |
|
109 * HandleForegroundEventL |
|
110 * Push the application to background. |
|
111 * Called by the framework when the application switches |
|
112 * to foreground. |
|
113 */ |
|
114 void HandleForegroundEventL(TBool aForeground); |
|
115 |
|
116 /** |
|
117 * SendToBackgroundL |
|
118 * Sends application to background. |
|
119 */ |
|
120 void SendToBackgroundL(TBool aBackground = ETrue); |
|
121 |
|
122 /** |
|
123 * ShowGlobalWaitNoteL |
|
124 * Show the Global wait note. (starts in EBSStateInit) |
|
125 */ |
|
126 void ShowGlobalWaitNoteL(); |
|
127 |
|
128 /** |
|
129 * StopGlobalWaitNoteL |
|
130 * Stop the Global wait note incase of failure. |
|
131 */ |
|
132 void StopGlobalWaitNoteL(); |
|
133 |
|
134 /** |
|
135 * ShowNoteL |
|
136 * Show an error note incase of failure. |
|
137 */ |
|
138 void ShowNoteL( const TAknGlobalNoteType& aType , const TInt& aResourceId ); |
|
139 |
|
140 /** |
|
141 * GetLatestInstalledL |
|
142 * Get the UID of latest installation. |
|
143 */ |
|
144 TUint32 GetLatestInstalledL(); |
|
145 |
|
146 private: // Data |
|
147 friend class CStateMachine; |
|
148 |
|
149 CStateMachine* iStateMachine; //< owns |
|
150 |
|
151 CAknGlobalNote* iGlobalWaitNote; //< owns |
|
152 |
|
153 CGlobalWaitNoteObserver* iGlobalWaitNoteObserver; //< owns |
|
154 |
|
155 /** |
|
156 * ETrue, if Ovi Store client is running |
|
157 */ |
|
158 TBool iOviStoreRunning; |
|
159 |
|
160 /** |
|
161 * Wrapper package UID |
|
162 */ |
|
163 TUint32 iWrapperPackageUid; |
|
164 |
|
165 /** |
|
166 * Can Bootstrap UI be moved to foreground |
|
167 */ |
|
168 TBool iAllowForeground; |
|
169 |
|
170 /** |
|
171 * WaitNoteId |
|
172 */ |
|
173 TInt iGlobalWaitNoteId; |
|
174 |
|
175 /** |
|
176 * ErrorId - used to determine whether and type of error note to be displayed |
|
177 */ |
|
178 AppErrorId iErrorId; |
|
179 |
|
180 INIT_OBJECT_DEBUG_LOG |
|
181 }; |
|
182 |
|
183 #endif // __BootstrapAPPUI_H__ |
|
184 |
|
185 // End of File |
|
186 |