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