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