CAknEnv Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikcore.lib

Capability Information

Required Capabilities

None


#include <aknenv.h>

Detailed Description

This class is a Series 60 extension to CEikonEnv.

Every Avkon application is provided with an instance of CAvkEnv by the framework, which can be accessed through the iAvkonEnv macro.


Public Member Functions

IMPORT_C  ~CAknEnv ()
  Destructor.
IMPORT_C void  ExecuteEmptyPopupListL (const TDesC *aEmptyText=0)
  Executes empty popup list.
IMPORT_C void  ExecuteEmptyPopupListL (const TDesC *aEmptyText, const TDesC *aTitle, TInt aSoftkeyId=0)
  Executes empty popup list.
IMPORT_C void  SetFepMenuObserver (MEikMenuObserver *aObserver)
  Set the FEP menu observer.
IMPORT_C MEikMenuObserver *  FepMenuObserver ()
  Get the FEP menu observer.
IMPORT_C MAknEditingStateIndicator EditingStateIndicator ()
  Get the editing state indicator.
IMPORT_C MAknEditingStateIndicator SwapEditingStateIndicator (MAknEditingStateIndicator *aIndicator)
  Swap the editing state indicator.
IMPORT_C void  RegisterIntermediateStateL (MAknIntermediateState *aState)
  Register the control implementing intermediate states.
IMPORT_C void  UnRegisterIntermediateState (MAknIntermediateState *aState)
  Unregister the control implementing intermediate states.
IMPORT_C void  CloseAllIntermediateStates ()
  Closes all intermediate states as a low-priority process.
IMPORT_C void  CreateCbaObserverL (CEikButtonGroupContainer *aCba, CEikListBox *aListBox)
  Create CBA observer.
IMPORT_C void  RemoveCbaObserver ()
  Remove CBA observer.
IMPORT_C void  InformCbaDeletion (CEikButtonGroupContainer *aCba)
  Remove CBA observer if the right one.
IMPORT_C void  RequestCommandMediationL (CEikButtonGroupContainer &aCba, MEikCommandObserver &aCommandObserver)
  Requests mediation of MSK commmands from specified CBA to the given observer.
IMPORT_C void  EndCommandMediation (MEikCommandObserver &aCommandObserver)
  Ends mediating MSK commands to specified command observer.
IMPORT_C void  GetCurrentLayoutId (TAknLayoutId &aCurrentLayoutId) const
  Get current layout ID.
IMPORT_C void  GetCurrentGlobalUiZoom (TAknUiZoom &aCurrentGlobalUiZoom) const
  Get current global zoom.
IMPORT_C TInt  StatusPaneResIdForCurrentLayout (TInt aResId) const
  Tells the type of status pane layout for UI.
IMPORT_C TInt  RequestWsBuffer (TInt aRequestedBufferSize)
  Requests Window Server client buffer used by the application to be of at least the given size.
IMPORT_C void  CancelWsBufferRequest (TInt aRequestID)
  Cancels a request made by call RequestWsBuffer.
IMPORT_C CAknSettingCache &  SettingCache () const
CAknFontRegistry &  FontRegistry () const
  Access to the registry of CAknLayoutFont pointers.
CArrayPtr< CAknSystemFont > *  SystemFontArray () const
  Access to the system font array that is owned by CEikonEnv.
void  UpdateSystemFontsL ()
IMPORT_C TBool  LoadAknLayoutL ()
  Load an appropraite Avkon layout.
IMPORT_C TBool  LoadAknLayoutL (const TAknLayoutConfigScreenMode &aScreenMode)
  Load an appropriate Avkon layout for a particular screen mode.
IMPORT_C const AknLayout::CInstance &  AknLayout () const
  Accessor method to layout.
IMPORT_C TBool  SplitViewActive () const
  Checks if split view is active.
void  SplitViewActive (const TBool aSplitViewActive)
  Sets split view flag.
void  TransitionEvent (TInt aEvent, const TUid &aAppUid)
void  TransitionEvent (TInt aEvent)
TBool  HasBlank () const
TBool  IsFeatureLanguage (TInt aFeatureLanguage)

Static Public Member Functions

static IMPORT_C CAknEnv Static ()
  Gets the CAknEnv maintained by the framework for the application.
static IMPORT_C void  ExitForegroundAppL ()
  Exit foreground application.
static IMPORT_C void  RunAppShutter ()
  Run application shutter.
static IMPORT_C CAknAppUi AppWithShutterRunning ()
  Get pointer to the most embedded application UI with Dialog Shutter running.
static IMPORT_C void  StopSchedulerWaitWithBusyMessage (CActiveSchedulerWait &aWait)
  Stop the scheduler.
static IMPORT_C TRgb  AvkonColor (TInt)
  Gets the TRgb value of the entry at the specified index in the colour lookup table.

Friends

class  AknBidiTextUtils
class  TAknTextWrapper
class  LafEnv

Data Structures

struct   TWsBufferRequest

Constructor & Destructor Documentation

IMPORT_C CAknEnv::~CAknEnv  ) 
 

Destructor.


Member Function Documentation

IMPORT_C const AknLayout::CInstance& CAknEnv::AknLayout  )  const
 

Accessor method to layout.

Returns:
Reference to the Layout.
static IMPORT_C CAknAppUi* CAknEnv::AppWithShutterRunning  )  [static]
 

Get pointer to the most embedded application UI with Dialog Shutter running.

Returns:
Pointer to the most embedded application UI with Dialog Shutter running. NULL if no any Dialog Shutter running.
static IMPORT_C TRgb CAknEnv::AvkonColor TInt   )  [static]
 

Gets the TRgb value of the entry at the specified index in the colour lookup table.

Parameters:
The  aIndex of the colour lookup table, integer between 0 and 255.
Returns:
The TRgb value of the colour lookup table at the aIndex.
IMPORT_C void CAknEnv::CancelWsBufferRequest TInt  aRequestID  ) 
 

Cancels a request made by call RequestWsBuffer.

This should be called in order to save RAM when higher than normal buffer size is no longer required.

Parameters:
aRequestID  The request ID returned by the RequestWsBuffer call which is to be canceled. Negative values are treated as error codes and ignored.
IMPORT_C void CAknEnv::CloseAllIntermediateStates  ) 
 

Closes all intermediate states as a low-priority process.

IMPORT_C void CAknEnv::CreateCbaObserverL CEikButtonGroupContainer aCba,
CEikListBox aListBox
 

Create CBA observer.

The possible existing one is removed first.

Parameters:
aCba  A control which ProcessCommandL handles the command.
aListBox  Stored to data member iListBox.
IMPORT_C MAknEditingStateIndicator* CAknEnv::EditingStateIndicator  ) 
 

Get the editing state indicator.

Returns:
Pointer to the editing state indicator.
IMPORT_C void CAknEnv::EndCommandMediation MEikCommandObserver &  aCommandObserver  ) 
 

Ends mediating MSK commands to specified command observer.

If commands are being mediated to the specifed observer, the command mediator is removed from the CBA to end mediation.

Parameters:
aCommandObserver  An observer.
IMPORT_C void CAknEnv::ExecuteEmptyPopupListL const TDesC *  aEmptyText,
const TDesC *  aTitle,
TInt  aSoftkeyId = 0
 

Executes empty popup list.

aSoftkeyId is soft key rescource used, but shown without left soft key (except R_AVKON_SOFTKEYS_OK_EMPTY).

Parameters:
aEmptyText  Text indicating empty popup list. NULL if R_AVKON_EMPTY_POPUP_LIST_TEXT used.
aTitle  A title of the popup list.
aSoftKeyId  CBA resource to be used as a base. 0 if R_AVKON_SOFTKEYS_CANCEL is used.
IMPORT_C void CAknEnv::ExecuteEmptyPopupListL const TDesC *  aEmptyText = 0  ) 
 

Executes empty popup list.

Parameters:
aEmptyText  Text indicating empty popup list. NULL if R_AVKON_EMPTY_POPUP_LIST_TEXT used.
static IMPORT_C void CAknEnv::ExitForegroundAppL  )  [static]
 

Exit foreground application.

IMPORT_C MEikMenuObserver* CAknEnv::FepMenuObserver  ) 
 

Get the FEP menu observer.

Returns:
Pointer to the FEP menu observer.
CAknFontRegistry& CAknEnv::FontRegistry  )  const
 

Access to the registry of CAknLayoutFont pointers.

Used for runtime checking of CFont pointers.

IMPORT_C void CAknEnv::GetCurrentGlobalUiZoom TAknUiZoom aCurrentGlobalUiZoom  )  const
 

Get current global zoom.

Parameters:
aCurrentGlobalUiZoom  On return, contains current global zoom.
IMPORT_C void CAknEnv::GetCurrentLayoutId TAknLayoutId aCurrentLayoutId  )  const
 

Get current layout ID.

Parameters:
aCurrentLayoutId  On return, contains current layout ID.
TBool CAknEnv::HasBlank  )  const
 
IMPORT_C void CAknEnv::InformCbaDeletion CEikButtonGroupContainer aCba  ) 
 

Remove CBA observer if the right one.

Parameters:
aCba  CBA to be checked.
TBool CAknEnv::IsFeatureLanguage TInt  aFeatureLanguage  ) 
 
IMPORT_C TBool CAknEnv::LoadAknLayoutL const TAknLayoutConfigScreenMode &  aScreenMode  ) 
 

Load an appropriate Avkon layout for a particular screen mode.

Parameters:
aScreenMode  The screen mode which the layout is required for
Returns:
EFalse if the layout is already loaded.
IMPORT_C TBool CAknEnv::LoadAknLayoutL  ) 
 

Load an appropraite Avkon layout.

Returns:
EFalse if the layout is already loaded.
IMPORT_C void CAknEnv::RegisterIntermediateStateL MAknIntermediateState aState  ) 
 

Register the control implementing intermediate states.

Call iAvkonEnv->RegisterIntermediateState(this) in control's ActivateL().

Parameters:
aState  The control implementing intermediate states.
IMPORT_C void CAknEnv::RemoveCbaObserver  ) 
 

Remove CBA observer.

IMPORT_C void CAknEnv::RequestCommandMediationL CEikButtonGroupContainer aCba,
MEikCommandObserver &  aCommandObserver
 

Requests mediation of MSK commmands from specified CBA to the given observer.

When called for the first time, this method creates an observer that is added to specified CBA to observe MSK commands and to mediate all received events to the given observer. The created observer exists until the CAknEnv instance is destroyed. All subsequent calls to this method replace the previously requested mediation.

Parameters:
aCba  CBA whose MSK is to be observed.
aCommandObserver  An observer for which the commands are sent.
IMPORT_C TInt CAknEnv::RequestWsBuffer TInt  aRequestedBufferSize  ) 
 

Requests Window Server client buffer used by the application to be of at least the given size.

All code that wants to increase (to avoid flicker) or decrease (to save RAM) the buffer compared to the default size should call this method instead of using WS interface directly. A list of all requests is maintained and the highest request is always effective. Only if there are no requests done, the default buffer size is used.

Parameters:
aRequestedBufferSize  requested Window Server client buffer size.
Returns:
Request ID. This is used when the request is canceled. In OOM situation, KErrNoMemory is returned. CancelWsBufferRequest ignores negative values as error codes so it is OK to pass any value returned by this method to CancelWsBufferRequest.
static IMPORT_C void CAknEnv::RunAppShutter  )  [static]
 

Run application shutter.

IMPORT_C void CAknEnv::SetFepMenuObserver MEikMenuObserver *  aObserver  ) 
 

Set the FEP menu observer.

Parameters:
aObserver  the FEP menu observer.
IMPORT_C CAknSettingCache& CAknEnv::SettingCache  )  const
 
void CAknEnv::SplitViewActive const TBool  aSplitViewActive  ) 
 

Sets split view flag.

Parameters:
aSplitViewActive  Etrue if split view is active.
IMPORT_C TBool CAknEnv::SplitViewActive  )  const
 

Checks if split view is active.

Returns:
ETrue if split view is active.
static IMPORT_C CAknEnv* CAknEnv::Static  )  [static]
 

Gets the CAknEnv maintained by the framework for the application.

Compare CCoeEnv::Static().

This function should never be run in a thread where such a static Avkon environment does not exist. Code that may run on the server side of an application server is one such case.

Returns:
A static CAknEnv.
IMPORT_C TInt CAknEnv::StatusPaneResIdForCurrentLayout TInt  aResId  )  const
 

Tells the type of status pane layout for UI.

Parameters:
aResId  resource id for current layout.
Returns:
Resource id equivalent type of status pane layout.
static IMPORT_C void CAknEnv::StopSchedulerWaitWithBusyMessage CActiveSchedulerWait &  aWait  )  [static]
 

Stop the scheduler.

If the waiting control can't stop the scheduler immediately, then trying to show a busy note.

Parameters:
aWait  Scheduler object to be stopped.
IMPORT_C MAknEditingStateIndicator* CAknEnv::SwapEditingStateIndicator MAknEditingStateIndicator aIndicator  ) 
 

Swap the editing state indicator.

Parameters:
aIndicator  The new editing state indicator.
Returns:
The old editing state indicator.
CArrayPtr<CAknSystemFont>* CAknEnv::SystemFontArray  )  const
 

Access to the system font array that is owned by CEikonEnv.

The member accessed by this is set during CEikonEnv construction and may be null during application startup.

void CAknEnv::TransitionEvent TInt  aEvent  ) 
 
void CAknEnv::TransitionEvent TInt  aEvent,
const TUid &  aAppUid
 
IMPORT_C void CAknEnv::UnRegisterIntermediateState MAknIntermediateState aState  ) 
 

Unregister the control implementing intermediate states.

Call iAvkonEnv->UnRegisterIntermediateState(this) in control's destructor.

Parameters:
aState  The control implementing intermediate states.
void CAknEnv::UpdateSystemFontsL  ) 
 

Friends And Related Function Documentation

friend class AknBidiTextUtils [friend]
 
friend class LafEnv [friend]
 
friend class TAknTextWrapper [friend]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top