epoc32/include/mw/coemain.inl
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  Gets the most recent standard event that was received by the application.
    18  
    19  Note: standard events are all events except redraw events and priority key events.
    20  
    21  @return The last event. 
    22 */
    23 inline const TWsEvent& CCoeEnv::LastEvent() const
    24 	{ return(iLastEvent); }
    25 
    26 /** Gets the application UI owned by this application.
    27 
    28 @return Pointer to the app UI owned by the application. */
    29 inline CCoeAppUi* CCoeEnv::AppUi() const
    30 	{ return(iAppUi); }
    31 
    32 /** Gets the file server session owned by this CCoeEnv. 
    33 
    34 This session is normally only used for accessing the application's resource 
    35 file.
    36 
    37 @return The file server session owned by this CCoeEnv. */
    38 inline RFs& CCoeEnv::FsSession() const
    39 	{ return((RFs&)iFsSession); }
    40 
    41 /** Gets the window server session owned by the application. 
    42 
    43 This provides access to window server functions not directly accessible via 
    44 the UI control framework.
    45 
    46 @return The window server session opened by the application. */
    47 inline RWsSession& CCoeEnv::WsSession() const
    48 	{ return((RWsSession&)iWsSession); }
    49 
    50 /** Gets the application's window group.
    51 
    52 Note: a window group is an invisible window which acts as the parent window for 
    53 all other windows in an application. Typically, each application has one window 
    54 group. In the window server, window groups are also the unit of keyboard focus.
    55 
    56 @return The application's window group. */inline RWindowGroup& CCoeEnv::RootWin() const
    57 	{ return((RWindowGroup&)iRootWin); }
    58 
    59 /** Gets the system graphics context. 
    60 
    61 This is the graphics context typically used for drawing controls, but an 
    62 alternative graphics context can be created if required using CreateGcL().
    63 
    64 @return The system graphics context. */
    65 inline CWindowGc& CCoeEnv::SystemGc() const
    66 	{ return((CWindowGc&)*iSystemGc); }
    67 
    68 /** Gets the normal environment font. 
    69 
    70 This is the font created during construction of the control environment.
    71 
    72 @return Pointer to the normal environment font.
    73 @see InitSystemFontsL() */
    74 inline const CFont* CCoeEnv::NormalFont() const
    75 	{ return(iNormalFont); }
    76 
    77 /** Gets the default screen device owned by this CCoeEnv. 
    78 
    79 This is typically used as the standard screen device for the CCoeEnv's application.
    80 
    81 @return The default screen device owned by this CCoeEnv. */
    82 inline CWsScreenDevice* CCoeEnv::ScreenDevice() const
    83 	{ return(iScreen); }
    84 
    85 /** Gets the current error message text.
    86 
    87 @return The current error message text. */
    88 inline TDes& CCoeEnv::ErrorText() 
    89 	{ return *iErrorText; }
    90 
    91 /** Gets the current error context text.
    92 
    93 @return The current error context text. */
    94 inline TDes& CCoeEnv::ErrorContextText() 
    95 	{ return *iErrorContextText; }
    96 
    97 #if defined(_UNICODE)
    98 /** Reads a resource into a descriptor. 
    99 
   100 The descriptor must be long enough to contain the entire resource. No memory 
   101 is allocated by this function. If the read fails, the function sets an error 
   102 condition and performs any cleanup required. The error condition causes the 
   103 GUI to launch an alert window.
   104 
   105 Deprecated - Use CCoeEnv::ReadResourceL() instead.
   106 
   107 @deprecated 
   108 @param aDes On return, contains the resource data.
   109 @param aResourceId The numeric ID of the resource to be read.
   110 @see RResourceFile::ReadL()
   111 @see KErrCoeFailedToReadFromProgDisk */
   112 inline void CCoeEnv::ReadResource(TDes& aDes,TInt aResourceId) const
   113 	{ ReadResourceAsDes16(aDes,aResourceId); }
   114 
   115 /** Reads a resource into a descriptor.
   116 
   117 The descriptor must be long enough to contain the entire resource. 
   118 No memory is allocated by this function.
   119 
   120 @param aDes On return, contains the resource data.
   121 @param aResourceId The numeric ID of the resource to be read.
   122 @return Pointer to a heap descriptor containing the resource. */
   123 inline void CCoeEnv::ReadResourceL(TDes& aDes,TInt aResourceId) const
   124 	{ ReadResourceAsDes16L(aDes,aResourceId); }
   125 
   126 /** Reads a resource into a heap descriptor, allocating memory for it. 
   127 
   128 Note: the calling program must destroy the heap descriptor when it is no longer 
   129 needed.
   130 
   131 @param aResourceId The numeric ID of the resource to be read.
   132 @return Pointer to a heap descriptor containing the resource data.
   133 @see RResourceFile::AllocReadL() */
   134 inline  HBufC* CCoeEnv::AllocReadResourceL(TInt aResourceId) const
   135 	{ return AllocReadResourceAsDes16L(aResourceId); }
   136 
   137 /** Reads a specified resource into a heap descriptor, allocating memory for it, 
   138 and pushing the descriptor onto the cleanup stack. 
   139 
   140 The calling program should pop and destroy the heap descriptor when it is 
   141 no longer needed.
   142 
   143 @param aResourceId The numeric ID of the resource to be read.
   144 @return Pointer to a heap descriptor containing the resource data.
   145 @see RResourceFile::AllocReadLC() */
   146 inline HBufC* CCoeEnv::AllocReadResourceLC(TInt aResourceId) const
   147 	{ return AllocReadResourceAsDes16LC(aResourceId); }
   148 
   149 /** Reads a resource into a Unicode descriptor array.
   150 
   151 @param aResourceId The numeric ID of the resource to be read.
   152 @return A pointer to the descriptor array containing the resource data.
   153 @see TResourceReader::ReadDesCArrayL() */
   154 inline CDesCArrayFlat* CCoeEnv::ReadDesCArrayResourceL(TInt aResourceId)
   155 	{ return ReadDesC16ArrayResourceL(aResourceId); }
   156 #else  // not UNICODE
   157 
   158 /** Deprecated - use CCoeEnv::ReadResourceL() instead.
   159 
   160 @deprecated */
   161 inline void CCoeEnv::ReadResource(TDes& aDes,TInt aResourceId) const
   162 	{ ReadResourceAsDes8(aDes,aResourceId); }
   163 
   164 inline void CCoeEnv::ReadResourceL(TDes& aDes,TInt aResourceId) const
   165 	{ ReadResourceAsDes8L(aDes,aResourceId); }
   166 inline  HBufC* CCoeEnv::AllocReadResourceL(TInt aResourceId) const
   167 	{ return AllocReadResourceAsDes8L(aResourceId); }
   168 inline HBufC* CCoeEnv::AllocReadResourceLC(TInt aResourceId) const
   169 	{ return AllocReadResourceAsDes8LC(aResourceId); }
   170 inline CDesCArrayFlat* CCoeEnv::ReadDesCArrayResourceL(TInt aResourceId)
   171 	{ return ReadDesC8ArrayResourceL(aResourceId); }
   172 #endif // UNICODE
   173 
   174 //
   175 // Tests if the Active Scheduler is started in the CCoeEnv::ExecuteD
   176 //
   177 // @return   "TBool"
   178 //            <code>ETrue</code> if Active Scheduler is started in
   179 //								 CCoeEnv::ExecuteD()	
   180 //            <code>EFalse</code> if Active Scheduler is not started in
   181 //								  CCoeEnv::ExecuteD()	
   182 //            
   183 inline TBool CCoeEnv::IsSchedulerRunning() const
   184 	{return iEnvFlags&ESchedulerIsRunning;}