1.1 --- a/epoc32/include/coemain.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/coemain.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,186 @@
1.4 -coemain.inl
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 +
1.21 +
1.22 +/**
1.23 + Gets the most recent standard event that was received by the application.
1.24 +
1.25 + Note: standard events are all events except redraw events and priority key events.
1.26 +
1.27 + @return The last event.
1.28 +*/
1.29 +inline const TWsEvent& CCoeEnv::LastEvent() const
1.30 + { return(iLastEvent); }
1.31 +
1.32 +/** Gets the application UI owned by this application.
1.33 +
1.34 +@return Pointer to the app UI owned by the application. */
1.35 +inline CCoeAppUi* CCoeEnv::AppUi() const
1.36 + { return(iAppUi); }
1.37 +
1.38 +/** Gets the file server session owned by this CCoeEnv.
1.39 +
1.40 +This session is normally only used for accessing the application's resource
1.41 +file.
1.42 +
1.43 +@return The file server session owned by this CCoeEnv. */
1.44 +inline RFs& CCoeEnv::FsSession() const
1.45 + { return((RFs&)iFsSession); }
1.46 +
1.47 +/** Gets the window server session owned by the application.
1.48 +
1.49 +This provides access to window server functions not directly accessible via
1.50 +the UI control framework.
1.51 +
1.52 +@return The window server session opened by the application. */
1.53 +inline RWsSession& CCoeEnv::WsSession() const
1.54 + { return((RWsSession&)iWsSession); }
1.55 +
1.56 +/** Gets the application's window group.
1.57 +
1.58 +Note: a window group is an invisible window which acts as the parent window for
1.59 +all other windows in an application. Typically, each application has one window
1.60 +group. In the window server, window groups are also the unit of keyboard focus.
1.61 +
1.62 +@return The application's window group. */inline RWindowGroup& CCoeEnv::RootWin() const
1.63 + { return((RWindowGroup&)iRootWin); }
1.64 +
1.65 +/** Gets the system graphics context.
1.66 +
1.67 +This is the graphics context typically used for drawing controls, but an
1.68 +alternative graphics context can be created if required using CreateGcL().
1.69 +
1.70 +@return The system graphics context. */
1.71 +inline CWindowGc& CCoeEnv::SystemGc() const
1.72 + { return((CWindowGc&)*iSystemGc); }
1.73 +
1.74 +/** Gets the normal environment font.
1.75 +
1.76 +This is the font created during construction of the control environment.
1.77 +
1.78 +@return Pointer to the normal environment font.
1.79 +@see InitSystemFontsL() */
1.80 +inline const CFont* CCoeEnv::NormalFont() const
1.81 + { return(iNormalFont); }
1.82 +
1.83 +/** Gets the default screen device owned by this CCoeEnv.
1.84 +
1.85 +This is typically used as the standard screen device for the CCoeEnv's application.
1.86 +
1.87 +@return The default screen device owned by this CCoeEnv. */
1.88 +inline CWsScreenDevice* CCoeEnv::ScreenDevice() const
1.89 + { return(iScreen); }
1.90 +
1.91 +/** Gets the current error message text.
1.92 +
1.93 +@return The current error message text. */
1.94 +inline TDes& CCoeEnv::ErrorText()
1.95 + { return *iErrorText; }
1.96 +
1.97 +/** Gets the current error context text.
1.98 +
1.99 +@return The current error context text. */
1.100 +inline TDes& CCoeEnv::ErrorContextText()
1.101 + { return *iErrorContextText; }
1.102 +
1.103 +#if defined(_UNICODE)
1.104 +/** Reads a resource into a descriptor.
1.105 +
1.106 +The descriptor must be long enough to contain the entire resource. No memory
1.107 +is allocated by this function. If the read fails, the function sets an error
1.108 +condition and performs any cleanup required. The error condition causes the
1.109 +GUI to launch an alert window.
1.110 +
1.111 +Deprecated - Use CCoeEnv::ReadResourceL() instead.
1.112 +
1.113 +@deprecated
1.114 +@param aDes On return, contains the resource data.
1.115 +@param aResourceId The numeric ID of the resource to be read.
1.116 +@see RResourceFile::ReadL()
1.117 +@see KErrCoeFailedToReadFromProgDisk */
1.118 +inline void CCoeEnv::ReadResource(TDes& aDes,TInt aResourceId) const
1.119 + { ReadResourceAsDes16(aDes,aResourceId); }
1.120 +
1.121 +/** Reads a resource into a descriptor.
1.122 +
1.123 +The descriptor must be long enough to contain the entire resource.
1.124 +No memory is allocated by this function.
1.125 +
1.126 +@param aDes On return, contains the resource data.
1.127 +@param aResourceId The numeric ID of the resource to be read.
1.128 +@return Pointer to a heap descriptor containing the resource. */
1.129 +inline void CCoeEnv::ReadResourceL(TDes& aDes,TInt aResourceId) const
1.130 + { ReadResourceAsDes16L(aDes,aResourceId); }
1.131 +
1.132 +/** Reads a resource into a heap descriptor, allocating memory for it.
1.133 +
1.134 +Note: the calling program must destroy the heap descriptor when it is no longer
1.135 +needed.
1.136 +
1.137 +@param aResourceId The numeric ID of the resource to be read.
1.138 +@return Pointer to a heap descriptor containing the resource data.
1.139 +@see RResourceFile::AllocReadL() */
1.140 +inline HBufC* CCoeEnv::AllocReadResourceL(TInt aResourceId) const
1.141 + { return AllocReadResourceAsDes16L(aResourceId); }
1.142 +
1.143 +/** Reads a specified resource into a heap descriptor, allocating memory for it,
1.144 +and pushing the descriptor onto the cleanup stack.
1.145 +
1.146 +The calling program should pop and destroy the heap descriptor when it is
1.147 +no longer needed.
1.148 +
1.149 +@param aResourceId The numeric ID of the resource to be read.
1.150 +@return Pointer to a heap descriptor containing the resource data.
1.151 +@see RResourceFile::AllocReadLC() */
1.152 +inline HBufC* CCoeEnv::AllocReadResourceLC(TInt aResourceId) const
1.153 + { return AllocReadResourceAsDes16LC(aResourceId); }
1.154 +
1.155 +/** Reads a resource into a Unicode descriptor array.
1.156 +
1.157 +@param aResourceId The numeric ID of the resource to be read.
1.158 +@return A pointer to the descriptor array containing the resource data.
1.159 +@see TResourceReader::ReadDesCArrayL() */
1.160 +inline CDesCArrayFlat* CCoeEnv::ReadDesCArrayResourceL(TInt aResourceId)
1.161 + { return ReadDesC16ArrayResourceL(aResourceId); }
1.162 +#else // not UNICODE
1.163 +
1.164 +/** Deprecated - use CCoeEnv::ReadResourceL() instead.
1.165 +
1.166 +@deprecated */
1.167 +inline void CCoeEnv::ReadResource(TDes& aDes,TInt aResourceId) const
1.168 + { ReadResourceAsDes8(aDes,aResourceId); }
1.169 +
1.170 +inline void CCoeEnv::ReadResourceL(TDes& aDes,TInt aResourceId) const
1.171 + { ReadResourceAsDes8L(aDes,aResourceId); }
1.172 +inline HBufC* CCoeEnv::AllocReadResourceL(TInt aResourceId) const
1.173 + { return AllocReadResourceAsDes8L(aResourceId); }
1.174 +inline HBufC* CCoeEnv::AllocReadResourceLC(TInt aResourceId) const
1.175 + { return AllocReadResourceAsDes8LC(aResourceId); }
1.176 +inline CDesCArrayFlat* CCoeEnv::ReadDesCArrayResourceL(TInt aResourceId)
1.177 + { return ReadDesC8ArrayResourceL(aResourceId); }
1.178 +#endif // UNICODE
1.179 +
1.180 +//
1.181 +// Tests if the Active Scheduler is started in the CCoeEnv::ExecuteD
1.182 +//
1.183 +// @return "TBool"
1.184 +// <code>ETrue</code> if Active Scheduler is started in
1.185 +// CCoeEnv::ExecuteD()
1.186 +// <code>EFalse</code> if Active Scheduler is not started in
1.187 +// CCoeEnv::ExecuteD()
1.188 +//
1.189 +inline TBool CCoeEnv::IsSchedulerRunning() const
1.190 + {return iEnvFlags&ESchedulerIsRunning;}