1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/coemain.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,558 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __COEMAIN_H__
1.20 +#define __COEMAIN_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <w32std.h>
1.24 +#include <barsc.h>
1.25 +#include <badesca.h>
1.26 +#include <basched.h>
1.27 +#include <coemop.h>
1.28 +#include <coetextdrawer.h>
1.29 +
1.30 +#if defined(USE_IH_RAISE_EVENT)
1.31 +#include <systemmonitor/raiseevent.h>
1.32 +#include <test/testinstrumentation.h>
1.33 +#endif
1.34 +
1.35 +class CVwsSessionWrapper;
1.36 +class MVwsSessionWrapperObserver;
1.37 +class TCoeInputCapabilities; // forward declaration of class defined in COEINPUT.H
1.38 +class CCoeAppUi;
1.39 +class CCoeEnv;
1.40 +class TResourceReader;
1.41 +class RGenericPointerArray;
1.42 +class CCoeFep; // must derive from CBase
1.43 +class CCoeFontProvider;
1.44 +class CCoeEnvExtra;
1.45 +class CCoeStatic;
1.46 +
1.47 +
1.48 +/** UI Control framework active object priorities.
1.49 +These are in addition to the values contained in the TPriority enum in class CActive.
1.50 +
1.51 +@publishedAll
1.52 +@released */
1.53 +enum TActivePriority
1.54 + {
1.55 + /** 300 */
1.56 + EActivePriorityClockTimer=300,
1.57 + /** 200 */
1.58 + EActivePriorityIpcEventsHigh=200,
1.59 + /** 150 */
1.60 + EActivePriorityFepLoader=150,
1.61 + /** 100 */
1.62 + EActivePriorityWsEvents=100,
1.63 + /** 50 */
1.64 + EActivePriorityRedrawEvents=50,
1.65 + /** 0 */
1.66 + EActivePriorityDefault=0,
1.67 + /** 10 */
1.68 + EActivePriorityLogonA=-10
1.69 + };
1.70 +
1.71 +
1.72 +/** Interface providing notification when there is a change in the currently
1.73 +loaded FEP.
1.74 +
1.75 +This happens either on application start-up, or as a result of a different
1.76 +front end processor having been installed.
1.77 +
1.78 +Anyone requiring this notification should derive from this class and implement
1.79 +its pure virtual function. Derived classes also need to call CCoeEnv::AddObserverOfLoadedFepL()
1.80 +during construction, and CCoeEnv::RemoveObserverOfLoadedFep() in their destructor.
1.81 +
1.82 +@publishedAll
1.83 +@released */
1.84 +class MCoeObserverOfLoadedFep
1.85 + {
1.86 +public:
1.87 + /** Handles a change in the loaded FEP.
1.88 +
1.89 + The function is called if a new FEP is loaded, or if the current one is unloaded. */
1.90 + virtual void HandleChangeInLoadedFep()=0;
1.91 +protected:
1.92 + IMPORT_C MCoeObserverOfLoadedFep();
1.93 +
1.94 +private:
1.95 + IMPORT_C virtual void MCoeObserverOfLoadedFep_Reserved_1();
1.96 + IMPORT_C virtual void MCoeObserverOfLoadedFep_Reserved_2();
1.97 +private:
1.98 + TInt iMCoeObserverOfLoadedFep_Reserved1;
1.99 + };
1.100 +
1.101 +
1.102 +/** Interface providing notification if any control gains or loses focus or is
1.103 +destroyed.
1.104 +
1.105 +The FEP framework uses this class to observe when a target control changes
1.106 +for reasons unrelated to the FEP.
1.107 +
1.108 +Anything that needs such notification should derive from this class and implement
1.109 +its two pure virtual functions.
1.110 +
1.111 +In addition, derived classes need to call CCoeEnv::AddFocusObserverL() during
1.112 +construction, and CCoeEnv::RemoveFocusObserver() in their destructors.
1.113 +
1.114 +@publishedAll
1.115 +@released
1.116 +@see CCoeFep */
1.117 +class MCoeFocusObserver
1.118 + {
1.119 +public:
1.120 + /** Handles changes in focus. The function is called if any control gains or loses
1.121 + focus. */
1.122 + virtual void HandleChangeInFocus()=0;
1.123 + /** Handles the destruction of any control. It is called by the framework if any
1.124 + control is destroyed. */
1.125 + virtual void HandleDestructionOfFocusedItem()=0;
1.126 +protected:
1.127 + IMPORT_C MCoeFocusObserver();
1.128 +private:
1.129 + IMPORT_C virtual void MCoeFocusObserver_Reserved_1();
1.130 + IMPORT_C virtual void MCoeFocusObserver_Reserved_2();
1.131 +private:
1.132 + TInt iMCoeFocusObserver_Reserved1;
1.133 + };
1.134 +
1.135 +/** An interface which enables message windows to observe resource changes.
1.136 +
1.137 +Resource change observers should be added to the control environment using
1.138 +CCoeEnv::AddResourceChangeObserverL().
1.139 +
1.140 +@publishedAll
1.141 +@released */
1.142 +class MCoeResourceChangeObserver
1.143 + {
1.144 +public:
1.145 + /** Handles a change to the application's resources. */
1.146 + virtual void HandleResourceChange()=0;
1.147 +protected:
1.148 + IMPORT_C MCoeResourceChangeObserver();
1.149 +private:
1.150 + IMPORT_C virtual void MCoeResourceChangeObserver_Reserved_1();
1.151 + IMPORT_C virtual void MCoeResourceChangeObserver_Reserved_2();
1.152 +private:
1.153 + TInt iMCoeResourceChangeObserver_Reserved1;
1.154 + };
1.155 +
1.156 +/** Interface providing notification of foreground/background changes.
1.157 +
1.158 +The FEP framework class, CCoeFep, derives from MCoeForegroundObserver, which
1.159 +enables FEPs to receive notification when the target application (which receives
1.160 +the FEP's output) goes into the foreground or background.
1.161 +
1.162 +Anything that needs this notification should derive from this class and override
1.163 +its two pure virtual functions.
1.164 +
1.165 +In addition, derived classes also need to call CCoeEnv::AddForegroundObserverL()
1.166 +during construction, and CCoeEnv::RemoveForegroundObserver() in their destructors.
1.167 +
1.168 +@publishedAll
1.169 +@released
1.170 +@see CCoeFep */
1.171 +class MCoeForegroundObserver
1.172 + {
1.173 +public:
1.174 + /** Handles the application coming to the foreground. */
1.175 + virtual void HandleGainingForeground()=0;
1.176 + /** Handles the application going into the background. */
1.177 + virtual void HandleLosingForeground()=0;
1.178 +protected:
1.179 + IMPORT_C MCoeForegroundObserver();
1.180 +private:
1.181 + IMPORT_C virtual void MCoeForegroundObserver_Reserved_1();
1.182 + IMPORT_C virtual void MCoeForegroundObserver_Reserved_2();
1.183 +private:
1.184 + TInt iMCoeForegroundObserver_Reserved1;
1.185 + };
1.186 +
1.187 +
1.188 +/** Interface for handling incoming window server messages.
1.189 +
1.190 +This interface is used to enable FEPs to keep their settings synchronised
1.191 +across all running instances.
1.192 +
1.193 +Anything that needs to be notified of messages that get sent by the window server's
1.194 +message-sending service should derive from this class and override its pure
1.195 +virtual function.
1.196 +
1.197 +In addition, derived classes also need to call CCoeEnv::AddMessageObserverL()
1.198 +during construction and CCoeEnv::RemoveMessageObserver() in their destructors.
1.199 +
1.200 +@publishedAll
1.201 +@released */
1.202 +class MCoeMessageObserver
1.203 + {
1.204 +public:
1.205 + /** Message response flags. */
1.206 + enum TMessageResponse
1.207 + {
1.208 + /** Message not handled. */
1.209 + EMessageNotHandled,
1.210 + /** Message handled. */
1.211 + EMessageHandled
1.212 + };
1.213 +public:
1.214 + /** Handles window server messages.
1.215 +
1.216 + Implementations should return EMessageHandled if they are able to handle the
1.217 + message, or EMessageNotHandled if the message is not appropriate to this observer.
1.218 +
1.219 + @param aClientHandleOfTargetWindowGroup The window group that the message
1.220 + was sent to. Many implementations will not need this information.
1.221 + @param aMessageUid The message UID.
1.222 + @param aMessageParameters The message parameters.
1.223 + @return Indicates whether the message was handled or not handled
1.224 + by the function. */
1.225 + virtual TMessageResponse HandleMessageL(TUint32 aClientHandleOfTargetWindowGroup, TUid aMessageUid, const TDesC8& aMessageParameters)=0;
1.226 +protected:
1.227 + IMPORT_C MCoeMessageObserver();
1.228 +private:
1.229 + IMPORT_C virtual void MCoeMessageObserver_Reserved_1();
1.230 + IMPORT_C virtual void MCoeMessageObserver_Reserved_2();
1.231 + };
1.232 +
1.233 +/** Mix-in interface for handling window visibility messages.
1.234 +
1.235 +@publishedAll
1.236 +@released */
1.237 +class MCoeMessageMonitorObserver
1.238 + {
1.239 +public:
1.240 + /** Received windows messages for monitoring.
1.241 + @param aEvent The windows server event data.*/
1.242 + virtual void MonitorWsMessage(const TWsEvent& aEvent)=0;
1.243 +private:
1.244 + IMPORT_C virtual void MCoeMessageMonitorObserver_Reserved_1();
1.245 + IMPORT_C virtual void MCoeMessageMonitorObserver_Reserved_2();
1.246 + };
1.247 +
1.248 +// classes defined in FEPBASE, declared here
1.249 +class MCoeFepObserver;
1.250 +
1.251 +/**
1.252 +@publishedAll
1.253 +@released
1.254 +*/
1.255 +typedef void (*TCoeFepObserverFunction)(MCoeFepObserver& aFepObserver);
1.256 +
1.257 +/**
1.258 +@publishedAll
1.259 +@released
1.260 +*/
1.261 +class CCoeFepParameters : public CBase
1.262 + {
1.263 +public:
1.264 + static CCoeFepParameters* NewLC();
1.265 +private:
1.266 + inline CCoeFepParameters() {}
1.267 + };
1.268 +
1.269 +
1.270 +/** Implements the active scheduler presupposed by the control environment.
1.271 +
1.272 +@publishedPartner
1.273 +@deprecated
1.274 +*/
1.275 +class CCoeScheduler : public CBaActiveScheduler
1.276 + {
1.277 +public:
1.278 + IMPORT_C CCoeScheduler(CCoeEnv* aCoeEnv);
1.279 + IMPORT_C virtual void WaitForAnyRequest();
1.280 + IMPORT_C virtual void DisplayError(TInt aError) const;
1.281 + /** Gets the control environment.
1.282 +
1.283 + @return A pointer to the control environment. */
1.284 + inline CCoeEnv* CoeEnv() {return iCoeEnv;}
1.285 + TBool Flush() const; // not to be called from outside CONE
1.286 + void SetFlush(TBool aFlush); // not to be called from outside CONE
1.287 +private:
1.288 + // from CBaActiveScheduler
1.289 + IMPORT_C virtual void Reserved_1();
1.290 + IMPORT_C virtual void Reserved_2();
1.291 +private:
1.292 + CCoeEnv* iCoeEnv;
1.293 + TBool iFlush;
1.294 + };
1.295 +
1.296 +
1.297 +
1.298 +/** Control environment.
1.299 +
1.300 +CCoeEnv provides an active environment for creating controls. It implements
1.301 +active objects and an active scheduler, which provide access to the window
1.302 +server, simplifying the API for application programs. It also provides utility
1.303 +functions that are useful to many applications.
1.304 +
1.305 +When a standard event occurs, the active scheduler calls CCoeEnv::RunL().
1.306 +When a redraw event occurs, it calls CCoeRedrawer::RunL(). Priority key events
1.307 +must be accessed using the Window Server API directly.
1.308 +
1.309 +Note: standard events are all events except redraw events and priority key events.
1.310 +
1.311 +@publishedAll
1.312 +@released */
1.313 +class CCoeEnv : public CActive, public MObjectProvider
1.314 + {
1.315 +public:
1.316 + // Properties
1.317 + IMPORT_C static TVersion Version();
1.318 + IMPORT_C static CCoeEnv* Static();
1.319 + // Construction and destruction
1.320 + IMPORT_C CCoeEnv();
1.321 + IMPORT_C ~CCoeEnv();
1.322 + IMPORT_C void ConstructL();
1.323 + IMPORT_C void ConstructL(TBool aInitialFocusState);
1.324 + IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber);
1.325 + IMPORT_C void ConstructL(TBool aInitialFocusState, TInt aDefaultScreenNumber, TInt aWindowGroupID);
1.326 + IMPORT_C CCoeAppUi* SetAppUi(CCoeAppUi* aAppUi);
1.327 + IMPORT_C void ExecuteD();
1.328 + IMPORT_C void Execute();
1.329 + IMPORT_C void RunL();
1.330 + IMPORT_C void DoCancel();
1.331 + IMPORT_C void PrepareToExit();
1.332 + IMPORT_C virtual void DestroyEnvironment();
1.333 + IMPORT_C void DisableExitChecks(TBool aDisable);
1.334 + IMPORT_C virtual void HandleError(TInt aError);
1.335 + // System resources
1.336 + inline CCoeAppUi* AppUi() const;
1.337 + inline RFs& FsSession() const;
1.338 + inline RWsSession& WsSession() const;
1.339 + inline RWindowGroup& RootWin() const;
1.340 + inline CWsScreenDevice* ScreenDevice() const;
1.341 + inline CWindowGc& SystemGc() const;
1.342 + inline const CFont* NormalFont() const;
1.343 + inline const TWsEvent& LastEvent() const;
1.344 + inline TBool IsSchedulerRunning() const;
1.345 + // Graphics
1.346 + IMPORT_C CWindowGc* CreateGcL();
1.347 + IMPORT_C CWindowGc* SwapSystemGc(CWindowGc* aGc);
1.348 + IMPORT_C void Flush(TTimeIntervalMicroSeconds32 aDelay=0);
1.349 + IMPORT_C void SuppressNextFlush();
1.350 + IMPORT_C TBool IsWservEventPending() const;
1.351 + IMPORT_C TBool IsRedrawEventPending() const;
1.352 + // Fonts (legacy API)
1.353 + IMPORT_C CFbsFont* CreateDeviceFontL(CGraphicsDevice* aDevice,const TFontSpec& aFontSpec);
1.354 + IMPORT_C CFbsFont* CreateScreenFontL(const TFontSpec& aFontSpec);
1.355 + IMPORT_C void ReleaseScreenFont(CFont* aFont) const;
1.356 + // Font provider
1.357 + IMPORT_C const CCoeFontProvider& DefaultFontProvider() const;
1.358 + // Text drawer
1.359 + IMPORT_C CCoeTextDrawerBase& DefaultTextDrawer() const;
1.360 + // Zooming
1.361 + IMPORT_C TZoomFactor ZoomFactor() const;
1.362 + IMPORT_C void SetZoomFactor(const TZoomFactor& aZoomFactor);
1.363 + // Resource reading
1.364 + IMPORT_C TInt AddResourceFileL(const TDesC& aFileName);
1.365 + IMPORT_C void DeleteResourceFile(TInt aOffset);
1.366 + IMPORT_C TBool IsResourceAvailableL(TInt aResourceId) const;
1.367 + IMPORT_C void CreateResourceReaderLC(TResourceReader& aReader,TInt aResourceId) const;
1.368 + inline void ReadResource(TDes& aDes,TInt aResourceId) const;
1.369 + inline void ReadResourceL(TDes& aDes,TInt aResourceId) const;
1.370 + inline HBufC* AllocReadResourceL(TInt aResourceId) const;
1.371 + inline HBufC* AllocReadResourceLC(TInt aResourceId) const;
1.372 + inline CDesCArrayFlat* ReadDesCArrayResourceL(TInt aResourceId);
1.373 + IMPORT_C void ReadResourceAsDes8(TDes8& aDes,TInt aResourceId) const; /** @deprecated 7.0*/
1.374 + IMPORT_C void ReadResourceAsDes8L(TDes8& aDes,TInt aResourceId) const;
1.375 + IMPORT_C HBufC8* AllocReadResourceAsDes8L(TInt aResourceId) const;
1.376 + IMPORT_C HBufC8* AllocReadResourceAsDes8LC(TInt aResourceId) const;
1.377 + IMPORT_C CDesC8ArrayFlat* ReadDesC8ArrayResourceL(TInt aResourceId);
1.378 + IMPORT_C void ReadResourceAsDes16(TDes16& aDes,TInt aResourceId) const; /** @deprecated 7.0*/
1.379 + IMPORT_C void ReadResourceAsDes16L(TDes16& aDes,TInt aResourceId) const;
1.380 + IMPORT_C HBufC16* AllocReadResourceAsDes16L(TInt aResourceId) const;
1.381 + IMPORT_C HBufC16* AllocReadResourceAsDes16LC(TInt aResourceId) const;
1.382 + IMPORT_C CDesC16ArrayFlat* ReadDesC16ArrayResourceL(TInt aResourceId);
1.383 + IMPORT_C void Format128(TDes& aDes,TInt aResourceId,...);
1.384 + IMPORT_C void Format256(TDes& aDes,TInt aResourceId,...);
1.385 + // Error handling
1.386 + IMPORT_C void LeaveWithErrorText(const TDesC& aMsg,const TDesC* aContextText=NULL);
1.387 + // Key handling
1.388 + IMPORT_C void SimulateKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
1.389 + // FEP handling
1.390 + IMPORT_C void AddObserverOfLoadedFepL(MCoeObserverOfLoadedFep& aObserverOfLoadedFep);
1.391 + IMPORT_C void RemoveObserverOfLoadedFep(MCoeObserverOfLoadedFep& aObserverOfLoadedFep);
1.392 + IMPORT_C void AddFepObserverL(MCoeFepObserver& aFepObserver);
1.393 + IMPORT_C void RemoveFepObserver(MCoeFepObserver& aFepObserver);
1.394 + IMPORT_C void ForEachFepObserverCall(TCoeFepObserverFunction aFepObserverFunction);
1.395 + void EnsureCorrectFepIsLoadedL();
1.396 + void EnsureSpecifiedFepIsLoadedL(TUid aFepUid);
1.397 + IMPORT_C void InstallFepL(TUid aFepUid);
1.398 + IMPORT_C void InstallFepL(TUid aFepUid, const TBool aLeave);
1.399 + IMPORT_C void AvailableFepsL(RArray<TUid>& aUids, CDesCArray* aDisplayNames);
1.400 + IMPORT_C void ExecuteFepSettingsDialogL(TUid aFepUid);
1.401 + IMPORT_C CCoeFep* Fep() const;
1.402 + IMPORT_C TUid FepUid() const;
1.403 + IMPORT_C void InputCapabilitiesChanged();
1.404 + // Control focus handling
1.405 + IMPORT_C void AddFocusObserverL(MCoeFocusObserver& aFocusObserver);
1.406 + IMPORT_C void RemoveFocusObserver(MCoeFocusObserver& aFocusObserver);
1.407 + IMPORT_C void SyncNotifyFocusObserversOfChangeInFocus();
1.408 + void NotifyFocusObserversOfDestructionOfFocusedItem();
1.409 + // Application focus (foreground) handling
1.410 + IMPORT_C void BringOwnerToFront();
1.411 + IMPORT_C void AddForegroundObserverL(MCoeForegroundObserver& aForegroundObserver);
1.412 + IMPORT_C void RemoveForegroundObserver(MCoeForegroundObserver& aForegroundObserver);
1.413 + void NotifyForegroundObserversOfGainingForeground();
1.414 + void NotifyForegroundObserversOfLosingForeground();
1.415 + // Resource change handling
1.416 + IMPORT_C void AddResourceChangeObserverL(MCoeResourceChangeObserver& aResourceChangeObserver);
1.417 + IMPORT_C void RemoveResourceChangeObserver(MCoeResourceChangeObserver& aResourceChangeObserver);
1.418 + void NotifyResourceObserversOfChangeInResource();
1.419 + // Window server message handling
1.420 + IMPORT_C void AddMessageObserverL(MCoeMessageObserver& aMessageObserver);
1.421 + IMPORT_C void RemoveMessageObserver(MCoeMessageObserver& aMessageObserver);
1.422 + IMPORT_C void AddMessageMonitorObserverL(MCoeMessageMonitorObserver& aMessageMonitorObserver);
1.423 + IMPORT_C void RemoveMessageMonitorObserver(MCoeMessageMonitorObserver& aMessageMonitorObserver);
1.424 + void NotifyMessageMonitorObserversOfEvent(const TWsEvent& aEvent);
1.425 + // Singleton access
1.426 + IMPORT_C static CCoeStatic* Static(TUid aUid);
1.427 + IMPORT_C CCoeStatic* FindStatic(TUid aUid);
1.428 +#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
1.429 + //multiple screens
1.430 + IMPORT_C CWsScreenDevice* ScreenDevice(TInt aScreenNumber) const;
1.431 + IMPORT_C RWindowGroup* RootWin(TInt aScreenNumber) const;
1.432 +#endif
1.433 +public: // *** Do not use! API liable to change ***
1.434 + TInt AppStartupInstrumentationEventIdBase();
1.435 +public: // Internal to Symbian
1.436 + IMPORT_C void GetMessageNotifyingObserversLC(TUint32 aClientHandleOfTargetWindowGroup, TUid& aMessageUid, TPtr8& aMessageParameters, const TWsEvent& aMessageEvent);
1.437 + IMPORT_C TBool DisableShutdownChecks() const;
1.438 +protected: // Internal to Symbian
1.439 + IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aAppStartupInstrumentationEventIdBase);
1.440 + IMPORT_C void DestroyEnvironmentStatic();
1.441 + IMPORT_C void DestroyEnvironmentEnd();
1.442 + IMPORT_C TInt CoeEnvConstructorError() const;
1.443 +private: // reserved virtual function space
1.444 + IMPORT_C virtual void Reserved_1();
1.445 + IMPORT_C virtual void Reserved_2();
1.446 +private: // from CActive
1.447 + IMPORT_C TInt RunError(TInt aError);
1.448 +protected: // from MObjectProvider
1.449 + IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
1.450 +protected:
1.451 + IMPORT_C virtual void DestroyScreen();
1.452 + inline TDes& ErrorText();
1.453 + inline TDes& ErrorContextText();
1.454 +public: // but not exported
1.455 + void ReadEvent();
1.456 + CVwsSessionWrapper* InitViewServerSessionL(MVwsSessionWrapperObserver& aObserver);
1.457 + void AddStatic(CCoeStatic* aStatic);
1.458 + void QueueNotificationToFocusObserversOfChangeInFocus();
1.459 + TInt FocusObserverNotificationIdentifier() const;
1.460 + TBool FocusObserverNotificationIsStillPending(TInt aFocusObserverNotificationIdentifier) const;
1.461 + void RefetchPixelMappingL();
1.462 + TBool ControlStateChange();
1.463 +private:
1.464 + void CreateActiveSchedulerL();
1.465 + void ConnectToFileServerL();
1.466 + void ConnectToWindowServerL();
1.467 + void InitScreenL( TInt aDefaultScreenNumber );
1.468 + void InitRootWindowL(TBool aInitialFocusState, TInt aWindowGroupID=0);
1.469 + void InitSystemGcL();
1.470 + IMPORT_C virtual void InitSystemFontsL();
1.471 + IMPORT_C virtual TInt ResourceFileVersionNumber() const;
1.472 + RResourceFile& ResourceFileForId(TInt aResourceId) const;
1.473 + void DestroyAllResourceFiles();
1.474 + void AddObserverL(TAny* aObserver, RGenericPointerArray& aArray);
1.475 + void RemoveObserver(TAny* aObserver, RGenericPointerArray& aArray);
1.476 + void UpdateStatic(CCoeAppUi* aNewAppUi);
1.477 + void SetInitialHandleCount();
1.478 + TUint InitialHandleCount() const;
1.479 + RResourceFile* DoResourceFileForIdL(TInt aResourceId) const;
1.480 +#if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
1.481 + void PopulateArrayOfScreenItemsL();
1.482 + void DeleteArrayOfScreensItems();
1.483 +#endif
1.484 +protected:
1.485 + CCoeAppUi* iAppUi;
1.486 + RFs iFsSession;
1.487 + RWsSession iWsSession;
1.488 + RWindowGroup iRootWin;
1.489 + CWindowGc* iSystemGc;
1.490 + const CFont* iNormalFont;
1.491 + CWsScreenDevice* iScreen;
1.492 + TWsEvent iLastEvent;
1.493 + CArrayFix<RResourceFile>* iResourceFileArray;
1.494 +private:
1.495 + enum TFlags // used in the bottom 16 bits only of iEnvFlags
1.496 + {
1.497 + ENoShutdownChecks =0x0001,
1.498 + EExtraPointerIsErrorCode =0x0002,
1.499 + ESchedulerIsRunning =0x0004
1.500 + };
1.501 +private:
1.502 + TDes* iErrorText;
1.503 + TDes* iErrorContextText;
1.504 + CCoeEnvExtra* iExtra;
1.505 + CTrapCleanup* iCleanup;
1.506 + TUint iEnvFlags;
1.507 + };
1.508 +
1.509 +/** Base class for creating singleton objects that will be stored by CCoeEnv.
1.510 +
1.511 +Each object must have a unique TUid.
1.512 +
1.513 +Symbian OS does not provide writeable global static data. Singleton objects
1.514 +provide its equivalent in thread local storage, which is supported.
1.515 +
1.516 +This behaviour is useful for objects in which only one copy is ever needed
1.517 +in the thread or application, e.g. in alert windows.
1.518 +
1.519 +@publishedAll
1.520 +@released */
1.521 +class CCoeStatic : public CBase
1.522 + {
1.523 +public:
1.524 + /** Scope of access to the singleton object. */
1.525 + enum TScope
1.526 + {
1.527 + /** Access from the entire thread. */
1.528 + EThread,
1.529 + /** Access from an appUi in that thread. */
1.530 + EApp,
1.531 + };
1.532 + /** The default destruction priority if none is specified in the constructor */
1.533 + enum {EDefaultDestructionPriority=100};
1.534 +public:
1.535 + IMPORT_C ~CCoeStatic();
1.536 +protected:
1.537 + IMPORT_C CCoeStatic();
1.538 + IMPORT_C CCoeStatic(TUid aUid,TScope=EThread);
1.539 + IMPORT_C CCoeStatic(TUid aUid,TInt aDestructionPriority,TScope aScope=EThread);
1.540 +private:
1.541 + IMPORT_C virtual void CCoeStatic_Reserved1();
1.542 + IMPORT_C virtual void CCoeStatic_Reserved2();
1.543 +private:
1.544 + void DoConstruction(const TUid& aUid,TInt aDestructionPriority,TScope aScope);
1.545 + void SetCsAppUi(CCoeAppUi* aAppUi);
1.546 + CCoeAppUi* CsAppUi() const;
1.547 + TScope CsScope() const;
1.548 + inline TInt DestructionPriority() const {return iCsLink.iPriority;}
1.549 +private:
1.550 + TPriQueLink iCsLink;
1.551 + TUid iCsUid;
1.552 + TUint iCsAppUiAndScope;
1.553 + TInt iCCoeStatic_Reserved1;
1.554 +private:
1.555 + friend class CCoeEnv;
1.556 + friend class CCoeEnvExtra;
1.557 + };
1.558 +
1.559 +#include <coemain.inl>
1.560 +
1.561 +#endif // __COEMAIN_H__