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