williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __COEMAIN_H__
|
williamr@2
|
17 |
#define __COEMAIN_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
#include <w32std.h>
|
williamr@2
|
21 |
#include <barsc.h>
|
williamr@2
|
22 |
#include <badesca.h>
|
williamr@2
|
23 |
#include <basched.h>
|
williamr@2
|
24 |
#include <coemop.h>
|
williamr@2
|
25 |
#include <coetextdrawer.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#if defined(USE_IH_RAISE_EVENT)
|
williamr@2
|
28 |
#include <systemmonitor/raiseevent.h>
|
williamr@2
|
29 |
#include <test/testinstrumentation.h>
|
williamr@2
|
30 |
#endif
|
williamr@2
|
31 |
|
williamr@2
|
32 |
class CVwsSessionWrapper;
|
williamr@2
|
33 |
class MVwsSessionWrapperObserver;
|
williamr@2
|
34 |
class TCoeInputCapabilities; // forward declaration of class defined in COEINPUT.H
|
williamr@2
|
35 |
class CCoeAppUi;
|
williamr@2
|
36 |
class CCoeEnv;
|
williamr@2
|
37 |
class TResourceReader;
|
williamr@2
|
38 |
class RGenericPointerArray;
|
williamr@2
|
39 |
class CCoeFep; // must derive from CBase
|
williamr@2
|
40 |
class CCoeFontProvider;
|
williamr@2
|
41 |
class CCoeEnvExtra;
|
williamr@2
|
42 |
class CCoeStatic;
|
williamr@2
|
43 |
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/** UI Control framework active object priorities.
|
williamr@2
|
46 |
These are in addition to the values contained in the TPriority enum in class CActive.
|
williamr@2
|
47 |
|
williamr@2
|
48 |
@publishedAll
|
williamr@2
|
49 |
@released */
|
williamr@2
|
50 |
enum TActivePriority
|
williamr@2
|
51 |
{
|
williamr@2
|
52 |
/** 300 */
|
williamr@2
|
53 |
EActivePriorityClockTimer=300,
|
williamr@2
|
54 |
/** 200 */
|
williamr@2
|
55 |
EActivePriorityIpcEventsHigh=200,
|
williamr@2
|
56 |
/** 150 */
|
williamr@2
|
57 |
EActivePriorityFepLoader=150,
|
williamr@2
|
58 |
/** 100 */
|
williamr@2
|
59 |
EActivePriorityWsEvents=100,
|
williamr@2
|
60 |
/** 50 */
|
williamr@2
|
61 |
EActivePriorityRedrawEvents=50,
|
williamr@2
|
62 |
/** 0 */
|
williamr@2
|
63 |
EActivePriorityDefault=0,
|
williamr@2
|
64 |
/** 10 */
|
williamr@2
|
65 |
EActivePriorityLogonA=-10
|
williamr@2
|
66 |
};
|
williamr@2
|
67 |
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/** Interface providing notification when there is a change in the currently
|
williamr@2
|
70 |
loaded FEP.
|
williamr@2
|
71 |
|
williamr@2
|
72 |
This happens either on application start-up, or as a result of a different
|
williamr@2
|
73 |
front end processor having been installed.
|
williamr@2
|
74 |
|
williamr@2
|
75 |
Anyone requiring this notification should derive from this class and implement
|
williamr@2
|
76 |
its pure virtual function. Derived classes also need to call CCoeEnv::AddObserverOfLoadedFepL()
|
williamr@2
|
77 |
during construction, and CCoeEnv::RemoveObserverOfLoadedFep() in their destructor.
|
williamr@2
|
78 |
|
williamr@2
|
79 |
@publishedAll
|
williamr@2
|
80 |
@released */
|
williamr@2
|
81 |
class MCoeObserverOfLoadedFep
|
williamr@2
|
82 |
{
|
williamr@2
|
83 |
public:
|
williamr@2
|
84 |
/** Handles a change in the loaded FEP.
|
williamr@2
|
85 |
|
williamr@2
|
86 |
The function is called if a new FEP is loaded, or if the current one is unloaded. */
|
williamr@2
|
87 |
virtual void HandleChangeInLoadedFep()=0;
|
williamr@2
|
88 |
protected:
|
williamr@2
|
89 |
IMPORT_C MCoeObserverOfLoadedFep();
|
williamr@2
|
90 |
|
williamr@2
|
91 |
private:
|
williamr@2
|
92 |
IMPORT_C virtual void MCoeObserverOfLoadedFep_Reserved_1();
|
williamr@2
|
93 |
IMPORT_C virtual void MCoeObserverOfLoadedFep_Reserved_2();
|
williamr@2
|
94 |
private:
|
williamr@2
|
95 |
TInt iMCoeObserverOfLoadedFep_Reserved1;
|
williamr@2
|
96 |
};
|
williamr@2
|
97 |
|
williamr@2
|
98 |
|
williamr@2
|
99 |
/** Interface providing notification if any control gains or loses focus or is
|
williamr@2
|
100 |
destroyed.
|
williamr@2
|
101 |
|
williamr@2
|
102 |
The FEP framework uses this class to observe when a target control changes
|
williamr@2
|
103 |
for reasons unrelated to the FEP.
|
williamr@2
|
104 |
|
williamr@2
|
105 |
Anything that needs such notification should derive from this class and implement
|
williamr@2
|
106 |
its two pure virtual functions.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
In addition, derived classes need to call CCoeEnv::AddFocusObserverL() during
|
williamr@2
|
109 |
construction, and CCoeEnv::RemoveFocusObserver() in their destructors.
|
williamr@2
|
110 |
|
williamr@2
|
111 |
@publishedAll
|
williamr@2
|
112 |
@released
|
williamr@2
|
113 |
@see CCoeFep */
|
williamr@2
|
114 |
class MCoeFocusObserver
|
williamr@2
|
115 |
{
|
williamr@2
|
116 |
public:
|
williamr@2
|
117 |
/** Handles changes in focus. The function is called if any control gains or loses
|
williamr@2
|
118 |
focus. */
|
williamr@2
|
119 |
virtual void HandleChangeInFocus()=0;
|
williamr@2
|
120 |
/** Handles the destruction of any control. It is called by the framework if any
|
williamr@2
|
121 |
control is destroyed. */
|
williamr@2
|
122 |
virtual void HandleDestructionOfFocusedItem()=0;
|
williamr@2
|
123 |
protected:
|
williamr@2
|
124 |
IMPORT_C MCoeFocusObserver();
|
williamr@2
|
125 |
private:
|
williamr@2
|
126 |
IMPORT_C virtual void MCoeFocusObserver_Reserved_1();
|
williamr@2
|
127 |
IMPORT_C virtual void MCoeFocusObserver_Reserved_2();
|
williamr@2
|
128 |
private:
|
williamr@2
|
129 |
TInt iMCoeFocusObserver_Reserved1;
|
williamr@2
|
130 |
};
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/** An interface which enables message windows to observe resource changes.
|
williamr@2
|
133 |
|
williamr@2
|
134 |
Resource change observers should be added to the control environment using
|
williamr@2
|
135 |
CCoeEnv::AddResourceChangeObserverL().
|
williamr@2
|
136 |
|
williamr@2
|
137 |
@publishedAll
|
williamr@2
|
138 |
@released */
|
williamr@2
|
139 |
class MCoeResourceChangeObserver
|
williamr@2
|
140 |
{
|
williamr@2
|
141 |
public:
|
williamr@2
|
142 |
/** Handles a change to the application's resources. */
|
williamr@2
|
143 |
virtual void HandleResourceChange()=0;
|
williamr@2
|
144 |
protected:
|
williamr@2
|
145 |
IMPORT_C MCoeResourceChangeObserver();
|
williamr@2
|
146 |
private:
|
williamr@2
|
147 |
IMPORT_C virtual void MCoeResourceChangeObserver_Reserved_1();
|
williamr@2
|
148 |
IMPORT_C virtual void MCoeResourceChangeObserver_Reserved_2();
|
williamr@2
|
149 |
private:
|
williamr@2
|
150 |
TInt iMCoeResourceChangeObserver_Reserved1;
|
williamr@2
|
151 |
};
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/** Interface providing notification of foreground/background changes.
|
williamr@2
|
154 |
|
williamr@2
|
155 |
The FEP framework class, CCoeFep, derives from MCoeForegroundObserver, which
|
williamr@2
|
156 |
enables FEPs to receive notification when the target application (which receives
|
williamr@2
|
157 |
the FEP's output) goes into the foreground or background.
|
williamr@2
|
158 |
|
williamr@2
|
159 |
Anything that needs this notification should derive from this class and override
|
williamr@2
|
160 |
its two pure virtual functions.
|
williamr@2
|
161 |
|
williamr@2
|
162 |
In addition, derived classes also need to call CCoeEnv::AddForegroundObserverL()
|
williamr@2
|
163 |
during construction, and CCoeEnv::RemoveForegroundObserver() in their destructors.
|
williamr@2
|
164 |
|
williamr@2
|
165 |
@publishedAll
|
williamr@2
|
166 |
@released
|
williamr@2
|
167 |
@see CCoeFep */
|
williamr@2
|
168 |
class MCoeForegroundObserver
|
williamr@2
|
169 |
{
|
williamr@2
|
170 |
public:
|
williamr@2
|
171 |
/** Handles the application coming to the foreground. */
|
williamr@2
|
172 |
virtual void HandleGainingForeground()=0;
|
williamr@2
|
173 |
/** Handles the application going into the background. */
|
williamr@2
|
174 |
virtual void HandleLosingForeground()=0;
|
williamr@2
|
175 |
protected:
|
williamr@2
|
176 |
IMPORT_C MCoeForegroundObserver();
|
williamr@2
|
177 |
private:
|
williamr@2
|
178 |
IMPORT_C virtual void MCoeForegroundObserver_Reserved_1();
|
williamr@2
|
179 |
IMPORT_C virtual void MCoeForegroundObserver_Reserved_2();
|
williamr@2
|
180 |
private:
|
williamr@2
|
181 |
TInt iMCoeForegroundObserver_Reserved1;
|
williamr@2
|
182 |
};
|
williamr@2
|
183 |
|
williamr@2
|
184 |
|
williamr@2
|
185 |
/** Interface for handling incoming window server messages.
|
williamr@2
|
186 |
|
williamr@2
|
187 |
This interface is used to enable FEPs to keep their settings synchronised
|
williamr@2
|
188 |
across all running instances.
|
williamr@2
|
189 |
|
williamr@2
|
190 |
Anything that needs to be notified of messages that get sent by the window server's
|
williamr@2
|
191 |
message-sending service should derive from this class and override its pure
|
williamr@2
|
192 |
virtual function.
|
williamr@2
|
193 |
|
williamr@2
|
194 |
In addition, derived classes also need to call CCoeEnv::AddMessageObserverL()
|
williamr@2
|
195 |
during construction and CCoeEnv::RemoveMessageObserver() in their destructors.
|
williamr@2
|
196 |
|
williamr@2
|
197 |
@publishedAll
|
williamr@2
|
198 |
@released */
|
williamr@2
|
199 |
class MCoeMessageObserver
|
williamr@2
|
200 |
{
|
williamr@2
|
201 |
public:
|
williamr@2
|
202 |
/** Message response flags. */
|
williamr@2
|
203 |
enum TMessageResponse
|
williamr@2
|
204 |
{
|
williamr@2
|
205 |
/** Message not handled. */
|
williamr@2
|
206 |
EMessageNotHandled,
|
williamr@2
|
207 |
/** Message handled. */
|
williamr@2
|
208 |
EMessageHandled
|
williamr@2
|
209 |
};
|
williamr@2
|
210 |
public:
|
williamr@2
|
211 |
/** Handles window server messages.
|
williamr@2
|
212 |
|
williamr@2
|
213 |
Implementations should return EMessageHandled if they are able to handle the
|
williamr@2
|
214 |
message, or EMessageNotHandled if the message is not appropriate to this observer.
|
williamr@2
|
215 |
|
williamr@2
|
216 |
@param aClientHandleOfTargetWindowGroup The window group that the message
|
williamr@2
|
217 |
was sent to. Many implementations will not need this information.
|
williamr@2
|
218 |
@param aMessageUid The message UID.
|
williamr@2
|
219 |
@param aMessageParameters The message parameters.
|
williamr@2
|
220 |
@return Indicates whether the message was handled or not handled
|
williamr@2
|
221 |
by the function. */
|
williamr@2
|
222 |
virtual TMessageResponse HandleMessageL(TUint32 aClientHandleOfTargetWindowGroup, TUid aMessageUid, const TDesC8& aMessageParameters)=0;
|
williamr@2
|
223 |
protected:
|
williamr@2
|
224 |
IMPORT_C MCoeMessageObserver();
|
williamr@2
|
225 |
private:
|
williamr@2
|
226 |
IMPORT_C virtual void MCoeMessageObserver_Reserved_1();
|
williamr@2
|
227 |
IMPORT_C virtual void MCoeMessageObserver_Reserved_2();
|
williamr@2
|
228 |
};
|
williamr@2
|
229 |
|
williamr@2
|
230 |
/** Mix-in interface for handling window visibility messages.
|
williamr@2
|
231 |
|
williamr@2
|
232 |
@publishedAll
|
williamr@2
|
233 |
@released */
|
williamr@2
|
234 |
class MCoeMessageMonitorObserver
|
williamr@2
|
235 |
{
|
williamr@2
|
236 |
public:
|
williamr@2
|
237 |
/** Received windows messages for monitoring.
|
williamr@2
|
238 |
@param aEvent The windows server event data.*/
|
williamr@2
|
239 |
virtual void MonitorWsMessage(const TWsEvent& aEvent)=0;
|
williamr@2
|
240 |
private:
|
williamr@2
|
241 |
IMPORT_C virtual void MCoeMessageMonitorObserver_Reserved_1();
|
williamr@2
|
242 |
IMPORT_C virtual void MCoeMessageMonitorObserver_Reserved_2();
|
williamr@2
|
243 |
};
|
williamr@2
|
244 |
|
williamr@2
|
245 |
// classes defined in FEPBASE, declared here
|
williamr@2
|
246 |
class MCoeFepObserver;
|
williamr@2
|
247 |
|
williamr@2
|
248 |
/**
|
williamr@2
|
249 |
@publishedAll
|
williamr@2
|
250 |
@released
|
williamr@2
|
251 |
*/
|
williamr@2
|
252 |
typedef void (*TCoeFepObserverFunction)(MCoeFepObserver& aFepObserver);
|
williamr@2
|
253 |
|
williamr@2
|
254 |
/**
|
williamr@2
|
255 |
@publishedAll
|
williamr@2
|
256 |
@released
|
williamr@2
|
257 |
*/
|
williamr@2
|
258 |
class CCoeFepParameters : public CBase
|
williamr@2
|
259 |
{
|
williamr@2
|
260 |
public:
|
williamr@2
|
261 |
static CCoeFepParameters* NewLC();
|
williamr@2
|
262 |
private:
|
williamr@2
|
263 |
inline CCoeFepParameters() {}
|
williamr@2
|
264 |
};
|
williamr@2
|
265 |
|
williamr@2
|
266 |
|
williamr@2
|
267 |
/** Implements the active scheduler presupposed by the control environment.
|
williamr@2
|
268 |
|
williamr@2
|
269 |
@publishedPartner
|
williamr@2
|
270 |
@deprecated
|
williamr@2
|
271 |
*/
|
williamr@2
|
272 |
class CCoeScheduler : public CBaActiveScheduler
|
williamr@2
|
273 |
{
|
williamr@2
|
274 |
public:
|
williamr@2
|
275 |
IMPORT_C CCoeScheduler(CCoeEnv* aCoeEnv);
|
williamr@2
|
276 |
IMPORT_C virtual void WaitForAnyRequest();
|
williamr@2
|
277 |
IMPORT_C virtual void DisplayError(TInt aError) const;
|
williamr@2
|
278 |
/** Gets the control environment.
|
williamr@2
|
279 |
|
williamr@2
|
280 |
@return A pointer to the control environment. */
|
williamr@2
|
281 |
inline CCoeEnv* CoeEnv() {return iCoeEnv;}
|
williamr@2
|
282 |
TBool Flush() const; // not to be called from outside CONE
|
williamr@2
|
283 |
void SetFlush(TBool aFlush); // not to be called from outside CONE
|
williamr@2
|
284 |
private:
|
williamr@2
|
285 |
// from CBaActiveScheduler
|
williamr@2
|
286 |
IMPORT_C virtual void Reserved_1();
|
williamr@2
|
287 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
288 |
private:
|
williamr@2
|
289 |
CCoeEnv* iCoeEnv;
|
williamr@2
|
290 |
TBool iFlush;
|
williamr@2
|
291 |
};
|
williamr@2
|
292 |
|
williamr@2
|
293 |
|
williamr@2
|
294 |
|
williamr@2
|
295 |
/** Control environment.
|
williamr@2
|
296 |
|
williamr@2
|
297 |
CCoeEnv provides an active environment for creating controls. It implements
|
williamr@2
|
298 |
active objects and an active scheduler, which provide access to the window
|
williamr@2
|
299 |
server, simplifying the API for application programs. It also provides utility
|
williamr@2
|
300 |
functions that are useful to many applications.
|
williamr@2
|
301 |
|
williamr@2
|
302 |
When a standard event occurs, the active scheduler calls CCoeEnv::RunL().
|
williamr@2
|
303 |
When a redraw event occurs, it calls CCoeRedrawer::RunL(). Priority key events
|
williamr@2
|
304 |
must be accessed using the Window Server API directly.
|
williamr@2
|
305 |
|
williamr@2
|
306 |
Note: standard events are all events except redraw events and priority key events.
|
williamr@2
|
307 |
|
williamr@2
|
308 |
@publishedAll
|
williamr@2
|
309 |
@released */
|
williamr@2
|
310 |
class CCoeEnv : public CActive, public MObjectProvider
|
williamr@2
|
311 |
{
|
williamr@2
|
312 |
public:
|
williamr@2
|
313 |
// Properties
|
williamr@2
|
314 |
IMPORT_C static TVersion Version();
|
williamr@2
|
315 |
IMPORT_C static CCoeEnv* Static();
|
williamr@2
|
316 |
// Construction and destruction
|
williamr@2
|
317 |
IMPORT_C CCoeEnv();
|
williamr@2
|
318 |
IMPORT_C ~CCoeEnv();
|
williamr@2
|
319 |
IMPORT_C void ConstructL();
|
williamr@2
|
320 |
IMPORT_C void ConstructL(TBool aInitialFocusState);
|
williamr@2
|
321 |
IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber);
|
williamr@2
|
322 |
IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber, TInt aWindowGroupID);
|
williamr@2
|
323 |
IMPORT_C CCoeAppUi* SetAppUi(CCoeAppUi* aAppUi);
|
williamr@2
|
324 |
IMPORT_C void ExecuteD();
|
williamr@2
|
325 |
IMPORT_C void Execute();
|
williamr@2
|
326 |
IMPORT_C void RunL();
|
williamr@2
|
327 |
IMPORT_C void DoCancel();
|
williamr@2
|
328 |
IMPORT_C void PrepareToExit();
|
williamr@2
|
329 |
IMPORT_C virtual void DestroyEnvironment();
|
williamr@2
|
330 |
IMPORT_C void DisableExitChecks(TBool aDisable);
|
williamr@2
|
331 |
IMPORT_C virtual void HandleError(TInt aError);
|
williamr@2
|
332 |
// System resources
|
williamr@2
|
333 |
inline CCoeAppUi* AppUi() const;
|
williamr@2
|
334 |
inline RFs& FsSession() const;
|
williamr@2
|
335 |
inline RWsSession& WsSession() const;
|
williamr@2
|
336 |
inline RWindowGroup& RootWin() const;
|
williamr@2
|
337 |
inline CWsScreenDevice* ScreenDevice() const;
|
williamr@2
|
338 |
inline CWindowGc& SystemGc() const;
|
williamr@2
|
339 |
inline const CFont* NormalFont() const;
|
williamr@2
|
340 |
inline const TWsEvent& LastEvent() const;
|
williamr@2
|
341 |
inline TBool IsSchedulerRunning() const;
|
williamr@2
|
342 |
// Graphics
|
williamr@2
|
343 |
IMPORT_C CWindowGc* CreateGcL();
|
williamr@2
|
344 |
IMPORT_C CWindowGc* SwapSystemGc(CWindowGc* aGc);
|
williamr@2
|
345 |
IMPORT_C void Flush(TTimeIntervalMicroSeconds32 aDelay=0);
|
williamr@2
|
346 |
IMPORT_C void SuppressNextFlush();
|
williamr@2
|
347 |
IMPORT_C TBool IsWservEventPending() const;
|
williamr@2
|
348 |
IMPORT_C TBool IsRedrawEventPending() const;
|
williamr@2
|
349 |
// Fonts (legacy API)
|
williamr@2
|
350 |
IMPORT_C CFbsFont* CreateDeviceFontL(CGraphicsDevice* aDevice,const TFontSpec& aFontSpec);
|
williamr@2
|
351 |
IMPORT_C CFbsFont* CreateScreenFontL(const TFontSpec& aFontSpec);
|
williamr@2
|
352 |
IMPORT_C void ReleaseScreenFont(CFont* aFont) const;
|
williamr@2
|
353 |
// Font provider
|
williamr@2
|
354 |
IMPORT_C const CCoeFontProvider& DefaultFontProvider() const;
|
williamr@2
|
355 |
// Text drawer
|
williamr@2
|
356 |
IMPORT_C CCoeTextDrawerBase& DefaultTextDrawer() const;
|
williamr@2
|
357 |
// Zooming
|
williamr@2
|
358 |
IMPORT_C TZoomFactor ZoomFactor() const;
|
williamr@2
|
359 |
IMPORT_C void SetZoomFactor(const TZoomFactor& aZoomFactor);
|
williamr@2
|
360 |
// Resource reading
|
williamr@2
|
361 |
IMPORT_C TInt AddResourceFileL(const TDesC& aFileName);
|
williamr@2
|
362 |
IMPORT_C void DeleteResourceFile(TInt aOffset);
|
williamr@2
|
363 |
IMPORT_C TBool IsResourceAvailableL(TInt aResourceId) const;
|
williamr@2
|
364 |
IMPORT_C void CreateResourceReaderLC(TResourceReader& aReader,TInt aResourceId) const;
|
williamr@2
|
365 |
inline void ReadResource(TDes& aDes,TInt aResourceId) const;
|
williamr@2
|
366 |
inline void ReadResourceL(TDes& aDes,TInt aResourceId) const;
|
williamr@2
|
367 |
inline HBufC* AllocReadResourceL(TInt aResourceId) const;
|
williamr@2
|
368 |
inline HBufC* AllocReadResourceLC(TInt aResourceId) const;
|
williamr@2
|
369 |
inline CDesCArrayFlat* ReadDesCArrayResourceL(TInt aResourceId);
|
williamr@2
|
370 |
IMPORT_C void ReadResourceAsDes8(TDes8& aDes,TInt aResourceId) const; /** @deprecated 7.0*/
|
williamr@2
|
371 |
IMPORT_C void ReadResourceAsDes8L(TDes8& aDes,TInt aResourceId) const;
|
williamr@2
|
372 |
IMPORT_C HBufC8* AllocReadResourceAsDes8L(TInt aResourceId) const;
|
williamr@2
|
373 |
IMPORT_C HBufC8* AllocReadResourceAsDes8LC(TInt aResourceId) const;
|
williamr@2
|
374 |
IMPORT_C CDesC8ArrayFlat* ReadDesC8ArrayResourceL(TInt aResourceId);
|
williamr@2
|
375 |
IMPORT_C void ReadResourceAsDes16(TDes16& aDes,TInt aResourceId) const; /** @deprecated 7.0*/
|
williamr@2
|
376 |
IMPORT_C void ReadResourceAsDes16L(TDes16& aDes,TInt aResourceId) const;
|
williamr@2
|
377 |
IMPORT_C HBufC16* AllocReadResourceAsDes16L(TInt aResourceId) const;
|
williamr@2
|
378 |
IMPORT_C HBufC16* AllocReadResourceAsDes16LC(TInt aResourceId) const;
|
williamr@2
|
379 |
IMPORT_C CDesC16ArrayFlat* ReadDesC16ArrayResourceL(TInt aResourceId);
|
williamr@2
|
380 |
IMPORT_C void Format128(TDes& aDes,TInt aResourceId,...);
|
williamr@2
|
381 |
IMPORT_C void Format256(TDes& aDes,TInt aResourceId,...);
|
williamr@2
|
382 |
// Error handling
|
williamr@2
|
383 |
IMPORT_C void LeaveWithErrorText(const TDesC& aMsg,const TDesC* aContextText=NULL);
|
williamr@2
|
384 |
// Key handling
|
williamr@2
|
385 |
IMPORT_C void SimulateKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
williamr@2
|
386 |
// FEP handling
|
williamr@2
|
387 |
IMPORT_C void AddObserverOfLoadedFepL(MCoeObserverOfLoadedFep& aObserverOfLoadedFep);
|
williamr@2
|
388 |
IMPORT_C void RemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep& aObserverOfLoadedFep);
|
williamr@2
|
389 |
IMPORT_C void AddFepObserverL(MCoeFepObserver& aFepObserver);
|
williamr@2
|
390 |
IMPORT_C void RemoveFepObserver(MCoeFepObserver& aFepObserver);
|
williamr@2
|
391 |
IMPORT_C void ForEachFepObserverCall(TCoeFepObserverFunction aFepObserverFunction);
|
williamr@2
|
392 |
void EnsureCorrectFepIsLoadedL();
|
williamr@2
|
393 |
void EnsureSpecifiedFepIsLoadedL(TUid aFepUid);
|
williamr@2
|
394 |
IMPORT_C void InstallFepL(TUid aFepUid);
|
williamr@2
|
395 |
IMPORT_C void InstallFepL(TUid aFepUid, const TBool aLeave);
|
williamr@2
|
396 |
IMPORT_C void AvailableFepsL(RArray<TUid>& aUids, CDesCArray* aDisplayNames);
|
williamr@2
|
397 |
IMPORT_C void ExecuteFepSettingsDialogL(TUid aFepUid);
|
williamr@2
|
398 |
IMPORT_C CCoeFep* Fep() const;
|
williamr@2
|
399 |
IMPORT_C TUid FepUid() const;
|
williamr@2
|
400 |
IMPORT_C void InputCapabilitiesChanged();
|
williamr@2
|
401 |
// Control focus handling
|
williamr@2
|
402 |
IMPORT_C void AddFocusObserverL(MCoeFocusObserver& aFocusObserver);
|
williamr@2
|
403 |
IMPORT_C void RemoveFocusObserver(MCoeFocusObserver& aFocusObserver);
|
williamr@2
|
404 |
IMPORT_C void SyncNotifyFocusObserversOfChangeInFocus();
|
williamr@2
|
405 |
void NotifyFocusObserversOfDestructionOfFocusedItem();
|
williamr@2
|
406 |
// Application focus (foreground) handling
|
williamr@2
|
407 |
IMPORT_C void BringOwnerToFront();
|
williamr@2
|
408 |
IMPORT_C void AddForegroundObserverL(MCoeForegroundObserver& aForegroundObserver);
|
williamr@2
|
409 |
IMPORT_C void RemoveForegroundObserver(MCoeForegroundObserver& aForegroundObserver);
|
williamr@2
|
410 |
void NotifyForegroundObserversOfGainingForeground();
|
williamr@2
|
411 |
void NotifyForegroundObserversOfLosingForeground();
|
williamr@2
|
412 |
// Resource change handling
|
williamr@2
|
413 |
IMPORT_C void AddResourceChangeObserverL(MCoeResourceChangeObserver& aResourceChangeObserver);
|
williamr@2
|
414 |
IMPORT_C void RemoveResourceChangeObserver(MCoeResourceChangeObserver& aResourceChangeObserver);
|
williamr@2
|
415 |
void NotifyResourceObserversOfChangeInResource();
|
williamr@2
|
416 |
// Window server message handling
|
williamr@2
|
417 |
IMPORT_C void AddMessageObserverL(MCoeMessageObserver& aMessageObserver);
|
williamr@2
|
418 |
IMPORT_C void RemoveMessageObserver(MCoeMessageObserver& aMessageObserver);
|
williamr@2
|
419 |
IMPORT_C void AddMessageMonitorObserverL(MCoeMessageMonitorObserver& aMessageMonitorObserver);
|
williamr@2
|
420 |
IMPORT_C void RemoveMessageMonitorObserver(MCoeMessageMonitorObserver& aMessageMonitorObserver);
|
williamr@2
|
421 |
void NotifyMessageMonitorObserversOfEvent(const TWsEvent& aEvent);
|
williamr@2
|
422 |
// Singleton access
|
williamr@2
|
423 |
IMPORT_C static CCoeStatic* Static(TUid aUid);
|
williamr@2
|
424 |
IMPORT_C CCoeStatic* FindStatic(TUid aUid);
|
williamr@2
|
425 |
#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
|
williamr@2
|
426 |
//multiple screens
|
williamr@2
|
427 |
IMPORT_C CWsScreenDevice* ScreenDevice(TInt aScreenNumber) const;
|
williamr@2
|
428 |
IMPORT_C RWindowGroup* RootWin(TInt aScreenNumber) const;
|
williamr@2
|
429 |
#endif
|
williamr@2
|
430 |
public: // *** Do not use! API liable to change ***
|
williamr@2
|
431 |
TInt AppStartupInstrumentationEventIdBase();
|
williamr@2
|
432 |
public: // Internal to Symbian
|
williamr@2
|
433 |
IMPORT_C void GetMessageNotifyingObserversLC(TUint32 aClientHandleOfTargetWindowGroup, TUid& aMessageUid, TPtr8& aMessageParameters, const TWsEvent& aMessageEvent);
|
williamr@2
|
434 |
IMPORT_C TBool DisableShutdownChecks() const;
|
williamr@2
|
435 |
protected: // Internal to Symbian
|
williamr@2
|
436 |
IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aAppStartupInstrumentationEventIdBase);
|
williamr@2
|
437 |
IMPORT_C void DestroyEnvironmentStatic();
|
williamr@2
|
438 |
IMPORT_C void DestroyEnvironmentEnd();
|
williamr@2
|
439 |
IMPORT_C TInt CoeEnvConstructorError() const;
|
williamr@2
|
440 |
private: // reserved virtual function space
|
williamr@2
|
441 |
IMPORT_C virtual void Reserved_1();
|
williamr@2
|
442 |
IMPORT_C virtual void Reserved_2();
|
williamr@2
|
443 |
private: // from CActive
|
williamr@2
|
444 |
IMPORT_C TInt RunError(TInt aError);
|
williamr@2
|
445 |
protected: // from MObjectProvider
|
williamr@2
|
446 |
IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
williamr@2
|
447 |
protected:
|
williamr@2
|
448 |
IMPORT_C virtual void DestroyScreen();
|
williamr@2
|
449 |
inline TDes& ErrorText();
|
williamr@2
|
450 |
inline TDes& ErrorContextText();
|
williamr@2
|
451 |
public: // but not exported
|
williamr@2
|
452 |
void ReadEvent();
|
williamr@2
|
453 |
CVwsSessionWrapper* InitViewServerSessionL(MVwsSessionWrapperObserver& aObserver);
|
williamr@2
|
454 |
void AddStatic(CCoeStatic* aStatic);
|
williamr@2
|
455 |
void QueueNotificationToFocusObserversOfChangeInFocus();
|
williamr@2
|
456 |
TInt FocusObserverNotificationIdentifier() const;
|
williamr@2
|
457 |
TBool FocusObserverNotificationIsStillPending(TInt aFocusObserverNotificationIdentifier) const;
|
williamr@2
|
458 |
void RefetchPixelMappingL();
|
williamr@2
|
459 |
TBool ControlStateChange();
|
williamr@2
|
460 |
private:
|
williamr@2
|
461 |
void CreateActiveSchedulerL();
|
williamr@2
|
462 |
void ConnectToFileServerL();
|
williamr@2
|
463 |
void ConnectToWindowServerL();
|
williamr@2
|
464 |
void InitScreenL( TInt aDefaultScreenNumber );
|
williamr@2
|
465 |
void InitRootWindowL(TBool aInitialFocusState, TInt aWindowGroupID=0);
|
williamr@2
|
466 |
void InitSystemGcL();
|
williamr@2
|
467 |
IMPORT_C virtual void InitSystemFontsL();
|
williamr@2
|
468 |
IMPORT_C virtual TInt ResourceFileVersionNumber() const;
|
williamr@2
|
469 |
RResourceFile& ResourceFileForId(TInt aResourceId) const;
|
williamr@2
|
470 |
void DestroyAllResourceFiles();
|
williamr@2
|
471 |
void AddObserverL(TAny* aObserver, RGenericPointerArray& aArray);
|
williamr@2
|
472 |
void RemoveObserver(TAny* aObserver, RGenericPointerArray& aArray);
|
williamr@2
|
473 |
void UpdateStatic(CCoeAppUi* aNewAppUi);
|
williamr@2
|
474 |
void SetInitialHandleCount();
|
williamr@2
|
475 |
TUint InitialHandleCount() const;
|
williamr@2
|
476 |
RResourceFile* DoResourceFileForIdL(TInt aResourceId) const;
|
williamr@2
|
477 |
#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
|
williamr@2
|
478 |
void PopulateArrayOfScreenItemsL();
|
williamr@2
|
479 |
void DeleteArrayOfScreensItems();
|
williamr@2
|
480 |
#endif
|
williamr@2
|
481 |
protected:
|
williamr@2
|
482 |
CCoeAppUi* iAppUi;
|
williamr@2
|
483 |
RFs iFsSession;
|
williamr@2
|
484 |
RWsSession iWsSession;
|
williamr@2
|
485 |
RWindowGroup iRootWin;
|
williamr@2
|
486 |
CWindowGc* iSystemGc;
|
williamr@2
|
487 |
const CFont* iNormalFont;
|
williamr@2
|
488 |
CWsScreenDevice* iScreen;
|
williamr@2
|
489 |
TWsEvent iLastEvent;
|
williamr@2
|
490 |
CArrayFix<RResourceFile>* iResourceFileArray;
|
williamr@2
|
491 |
private:
|
williamr@2
|
492 |
enum TFlags // used in the bottom 16 bits only of iEnvFlags
|
williamr@2
|
493 |
{
|
williamr@2
|
494 |
ENoShutdownChecks =0x0001,
|
williamr@2
|
495 |
EExtraPointerIsErrorCode =0x0002,
|
williamr@2
|
496 |
ESchedulerIsRunning =0x0004
|
williamr@2
|
497 |
};
|
williamr@2
|
498 |
private:
|
williamr@2
|
499 |
TDes* iErrorText;
|
williamr@2
|
500 |
TDes* iErrorContextText;
|
williamr@2
|
501 |
CCoeEnvExtra* iExtra;
|
williamr@2
|
502 |
CTrapCleanup* iCleanup;
|
williamr@2
|
503 |
TUint iEnvFlags;
|
williamr@2
|
504 |
};
|
williamr@2
|
505 |
|
williamr@2
|
506 |
/** Base class for creating singleton objects that will be stored by CCoeEnv.
|
williamr@2
|
507 |
|
williamr@2
|
508 |
Each object must have a unique TUid.
|
williamr@2
|
509 |
|
williamr@2
|
510 |
Symbian OS does not provide writeable global static data. Singleton objects
|
williamr@2
|
511 |
provide its equivalent in thread local storage, which is supported.
|
williamr@2
|
512 |
|
williamr@2
|
513 |
This behaviour is useful for objects in which only one copy is ever needed
|
williamr@2
|
514 |
in the thread or application, e.g. in alert windows.
|
williamr@2
|
515 |
|
williamr@2
|
516 |
@publishedAll
|
williamr@2
|
517 |
@released */
|
williamr@2
|
518 |
class CCoeStatic : public CBase
|
williamr@2
|
519 |
{
|
williamr@2
|
520 |
public:
|
williamr@2
|
521 |
/** Scope of access to the singleton object. */
|
williamr@2
|
522 |
enum TScope
|
williamr@2
|
523 |
{
|
williamr@2
|
524 |
/** Access from the entire thread. */
|
williamr@2
|
525 |
EThread,
|
williamr@2
|
526 |
/** Access from an appUi in that thread. */
|
williamr@2
|
527 |
EApp,
|
williamr@2
|
528 |
};
|
williamr@2
|
529 |
/** The default destruction priority if none is specified in the constructor */
|
williamr@2
|
530 |
enum {EDefaultDestructionPriority=100};
|
williamr@2
|
531 |
public:
|
williamr@2
|
532 |
IMPORT_C ~CCoeStatic();
|
williamr@2
|
533 |
protected:
|
williamr@2
|
534 |
IMPORT_C CCoeStatic();
|
williamr@2
|
535 |
IMPORT_C CCoeStatic(TUid aUid,TScope=EThread);
|
williamr@2
|
536 |
IMPORT_C CCoeStatic(TUid aUid,TInt aDestructionPriority,TScope aScope=EThread);
|
williamr@2
|
537 |
private:
|
williamr@2
|
538 |
IMPORT_C virtual void CCoeStatic_Reserved1();
|
williamr@2
|
539 |
IMPORT_C virtual void CCoeStatic_Reserved2();
|
williamr@2
|
540 |
private:
|
williamr@2
|
541 |
void DoConstruction(const TUid& aUid,TInt aDestructionPriority,TScope aScope);
|
williamr@2
|
542 |
void SetCsAppUi(CCoeAppUi* aAppUi);
|
williamr@2
|
543 |
CCoeAppUi* CsAppUi() const;
|
williamr@2
|
544 |
TScope CsScope() const;
|
williamr@2
|
545 |
inline TInt DestructionPriority() const {return iCsLink.iPriority;}
|
williamr@2
|
546 |
private:
|
williamr@2
|
547 |
TPriQueLink iCsLink;
|
williamr@2
|
548 |
TUid iCsUid;
|
williamr@2
|
549 |
TUint iCsAppUiAndScope;
|
williamr@2
|
550 |
TInt iCCoeStatic_Reserved1;
|
williamr@2
|
551 |
private:
|
williamr@2
|
552 |
friend class CCoeEnv;
|
williamr@2
|
553 |
friend class CCoeEnvExtra;
|
williamr@2
|
554 |
};
|
williamr@2
|
555 |
|
williamr@2
|
556 |
#include <coemain.inl>
|
williamr@2
|
557 |
|
williamr@2
|
558 |
#endif // __COEMAIN_H__
|