63
|
1 |
/*
|
|
2 |
* Copyright (c) 1020 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 class.
|
|
15 |
*/
|
|
16 |
|
|
17 |
#ifndef __HS_LAUNCH_
|
|
18 |
#define __HS_LAUNCH_
|
|
19 |
|
|
20 |
#include <e32base.h>
|
|
21 |
#include <centralrepository.h>
|
|
22 |
#include <cenrepnotifyhandler.h>
|
|
23 |
#include "hsprocessmonitor.h"
|
|
24 |
#include "hsshutdownmonitor.h"
|
|
25 |
|
|
26 |
class t_hsapplicationlauncher;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* CHsLaunch
|
|
30 |
*
|
|
31 |
* application class.
|
|
32 |
*
|
|
33 |
* @since S60 5.2
|
|
34 |
*/
|
|
35 |
class CHsLaunch : public CActive,
|
|
36 |
MCenRepNotifyHandlerCallback,
|
|
37 |
MHsProcessMonitorObserver,
|
|
38 |
MHsShutdownMonitorObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
* Create new launcher
|
|
43 |
*
|
|
44 |
* @since S60 5.2
|
|
45 |
*/
|
|
46 |
static CHsLaunch* NewL();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*
|
|
51 |
* @since S60 5.2
|
|
52 |
*/
|
|
53 |
virtual ~CHsLaunch();
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Set active object to be ran
|
|
57 |
*
|
|
58 |
* @since S60 5.2
|
|
59 |
*/
|
|
60 |
void Activate();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Get application return value
|
|
64 |
*
|
|
65 |
* @return TInt Application return value
|
|
66 |
* @since S60 5.2
|
|
67 |
*/
|
|
68 |
TInt ApplicationReturnValue();
|
|
69 |
|
|
70 |
protected:
|
|
71 |
/**
|
|
72 |
* C++ constructor.
|
|
73 |
*
|
|
74 |
* @since S60 5.2
|
|
75 |
*/
|
|
76 |
CHsLaunch();
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Symbian 2nd phase constructor
|
|
80 |
*
|
|
81 |
* @since S60 5.2
|
|
82 |
*/
|
|
83 |
void ConstructL();
|
|
84 |
|
|
85 |
private: // From CActive.
|
|
86 |
/**
|
|
87 |
* From CActive
|
|
88 |
*/
|
|
89 |
void RunL();
|
|
90 |
|
|
91 |
/**
|
|
92 |
* From CActive
|
|
93 |
*
|
|
94 |
* @since S60 5.2
|
|
95 |
*/
|
|
96 |
void DoCancel();
|
|
97 |
|
|
98 |
/**
|
|
99 |
* From CActive
|
|
100 |
*
|
|
101 |
* @since S60 5.2
|
|
102 |
*/
|
|
103 |
TInt RunError( TInt aError );
|
|
104 |
|
|
105 |
private: // From MCenRepNotifyHandlerCallback
|
|
106 |
/**
|
|
107 |
* From MCenRepNotifyHandlerCallback
|
|
108 |
*/
|
|
109 |
void HandleNotifyInt(TUint32 aId, TInt aNewValue);
|
|
110 |
|
|
111 |
private: // From MHsProcessMonitorObserver
|
|
112 |
/**
|
|
113 |
* From MHsProcessMonitorObserver
|
|
114 |
*/
|
|
115 |
void ProcessEnded( const TExitType& aExitType,
|
|
116 |
const TInt aExitReason,
|
|
117 |
const TExitCategoryName& aExitCategory );
|
|
118 |
|
|
119 |
/**
|
|
120 |
* From MHsProcessMonitorObserver
|
|
121 |
*/
|
|
122 |
void ProcessMonitoringError( TInt aError );
|
|
123 |
|
|
124 |
private: // From MHsShutdownMonitorObserver
|
|
125 |
/**
|
|
126 |
* From MHsShutdownMonitorObserver
|
|
127 |
*/
|
|
128 |
void SystemShutdownEvent();
|
|
129 |
|
|
130 |
private:
|
|
131 |
/**
|
|
132 |
* Initialize process monitor
|
|
133 |
*
|
|
134 |
* @param aProcessId Id of process to monitor
|
|
135 |
*/
|
|
136 |
void InitProcessMonitorL( const TInt aProcessId );
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Shut down application
|
|
140 |
*
|
|
141 |
* @param aApplicationReturnValue Application return value.
|
|
142 |
*/
|
|
143 |
void ShutdownApp( const TInt aApplicationReturnValue );
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Starts the home screen application.
|
|
147 |
*/
|
|
148 |
void StartHomeScreen();
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Checks if the language is selected.
|
|
152 |
*/
|
|
153 |
TBool IsLanguageSelectedL();
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Starts listening the repository notifications for
|
|
157 |
* language selection.
|
|
158 |
*/
|
|
159 |
void StartListeningLanguageSelectionL();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Stops listening the repository notifications for
|
|
163 |
* language selection.
|
|
164 |
*/
|
|
165 |
void StopListeningLanguageSelection();
|
|
166 |
|
|
167 |
private: // data.
|
|
168 |
// Process monitor. Owned.
|
|
169 |
CHsProcessMonitor* iProcessMonitor;
|
|
170 |
|
|
171 |
// Shutdown monitor. Owned.
|
|
172 |
CHsShutdownMonitor* iShutdownMonitor;
|
|
173 |
|
|
174 |
// Repository.
|
|
175 |
CRepository *iRepository;
|
|
176 |
|
|
177 |
// Repository notify handler.
|
|
178 |
CCenRepNotifyHandler* iCenRepNotifyHandler;
|
|
179 |
|
|
180 |
// Application return value
|
|
181 |
TInt iApplicationReturnValue;
|
|
182 |
|
|
183 |
friend class t_hsapplicationlauncher;
|
|
184 |
};
|
|
185 |
|
|
186 |
#endif // __HS_LAUNCH_
|