Location:
eikenv.h
Link against: eikcore.lib
CEikonEnv
Supported from 6.0
An environment for creating Uikon controls and utility functions
for manipulating those controls. Every Uikon application is provided with an
instance of CEikonEnv
by the framework, which can be accessed
through either CEikonEnv::Static()
or the iEikonEnv
macro of CEikApplication
.
This class is not intended for user derivation.
|
Defined in CEikonEnv
:
AddAlertDialogLikeControlToStackL()
, AddDialogLikeControlToStackL()
, AddPictureFactoryL()
, AddSleepingAlertDialogToStackL()
, AddSleepingDialogToStackL()
, AddWindowShadow()
, AlertWin()
, AllocInfoMsg()
, AnnotationFont()
, AppUiFactory()
, Beep()
, Bitmap()
, BringForwards()
, BusyMsgCancel()
, BusyMsgL()
, CEikonEnv()
, ClockDllL()
, Color()
, ColorList()
, ConfirmLossOfAllChangesL()
, ConstructAppFromCommandLineL()
, ConstructL()
, ControlColor()
, ControlStackReadyL()
, CreateBitmapL()
, CreateIconFromMaskedBitmapL()
, CreateIconL()
, CustomColorArray()
, DefaultDisplayMode()
, DenseFont()
, DocNameIsAFile()
, DrawCursor()
, EikAppUi()
, ExtendedPictureFactory()
, Font()
, FservAllocInfoMsg()
, GetPrinterNamesL()
, HandleErrorWithContext()
, HideCursor()
, InfoMsg()
, InfoMsgCancel()
, InfoMsgWithAlignment()
, InfoMsgWithAlignmentAndDuration()
, InfoMsgWithDuration()
, InfoWinL()
, IsBusy()
, IsSystem()
, LeaveWithInfoMsg()
, LegendFont()
, NewDefaultCharFormatLayerL()
, NewDefaultParaFormatLayerL()
, NewDefaultPrintSetupL()
, NewDefaultSingleLineParaFormatLayerL()
, NotifyIdleError()
, NotifyIdleErrorWhileRedrawing()
, NudgeCharMinus()
, NudgeCharPlus()
, OptionBitmap()
, PictureFactory()
, Process()
, QueryWinL()
, RemoveFromStack()
, RemovePictureFactory()
, RespondsToShutdownEvent()
, RespondsToSwitchFilesEvent()
, RouseSleepingDialog()
, SetAutoForwarding()
, SetBusy()
, SetColor()
, SetDocNameIsAFile()
, SetInfoDialog()
, SetQueryDialog()
, SetRequestInfoDialogFunc()
, SetRequestQueryDialogFunc()
, SetRespondsToShutdownEvent()
, SetRespondsToSwitchFilesEvent()
, SetSystem()
, Static()
, SymbolFont()
, SystemCharFormatLayerL()
, SystemParaFormatLayerL()
, SystemSingleLineParaFormatLayerL()
, TitleFont()
, UpdateTaskNameL()
, VerboseInfoMsg()
, Version()
, VirtualCursor()
, WservAllocInfoMsg()
, ~CEikonEnv()
Inherited from CActive
:
Cancel()
,
Deque()
,
DoCancel()
,
EPriorityHigh
,
EPriorityIdle
,
EPriorityLow
,
EPriorityStandard
,
EPriorityUserInput
,
IsActive()
,
IsAdded()
,
Priority()
,
RunError()
,
RunL()
,
SetActive()
,
SetPriority()
,
TPriority
,
iStatus
Inherited from CBase
:
operator new()
Inherited from CCoeEnv
:
AddFepObserverL()
,
AddFocusObserverL()
,
AddForegroundObserverL()
,
AddMessageObserverL()
,
AddObserverOfLoadedFepL()
,
AddResourceFileL()
,
AllocReadResourceAsDes16L()
,
AllocReadResourceAsDes16LC()
,
AllocReadResourceAsDes8L()
,
AllocReadResourceAsDes8LC()
,
AllocReadResourceL()
,
AllocReadResourceLC()
,
AppUi()
,
BringOwnerToFront()
,
CreateDeviceFontL()
,
CreateGcL()
,
CreateResourceReaderLC()
,
CreateScreenFontL()
,
DeleteResourceFile()
,
DestroyEnvironment()
,
DestroyScreen()
,
DisableExitChecks()
,
ErrorContextText()
,
ErrorText()
,
ExecuteD()
,
ExecuteFepSettingsDialogL()
,
Fep()
,
FepUid()
,
FileNamesOfAvailableFepsL()
,
Flush()
,
ForEachFepObserverCall()
,
Format128()
,
Format256()
,
FsSession()
,
HandleError()
,
InputCapabilitiesChanged()
,
InstallFepL()
,
IsRedrawEventPending()
,
IsWservEventPending()
,
LastEvent()
,
LeaveWithErrorText()
,
NameOfInstalledFepL()
,
NormalFont()
,
PrepareToExit()
,
ReadDesC16ArrayResourceL()
,
ReadDesC8ArrayResourceL()
,
ReadDesCArrayResourceL()
,
ReadResource()
,
ReadResourceAsDes16()
,
ReadResourceAsDes8()
,
ReleaseScreenFont()
,
RemoveFepObserver()
,
RemoveFocusObserver()
,
RemoveForegroundObserver()
,
RemoveMessageObserver()
,
RemoveObserverOfLoadedFep()
,
RootWin()
,
ScreenDevice()
,
SetAppUi()
,
SimulateKeyEventL()
,
SuppressNextFlush()
,
SwapSystemGc()
,
SystemGc()
,
WsSession()
Inherited from MApaAppStarter
:
StartAppL()
Applications do not normally need to create a new
CEikonEnv
. An instance is always available to the application
through CEikApplication::iCoeEnv
, CEikonEnv::Static()
or the iEikonEnv
macro of CEikApplication
.
CEikonEnv();
Default C++ constructor. Allocates memory for the new
CEikonEnv
object; invoke using new(ELeave)
. The
second phase constructor should be called after the constructor for the
environment to be correctly initialised.
void ConstructL(TBool aInitialFocusState);
Second-phase constructor.
This is called by the previous constructor
ConstructL()
, with aInitialFocusState
of
ETrue
.
|
~CEikonEnv();
Destructor
Frees any resources acquired by this CEikonEnv
during its construction.
void ConstructAppFromCommandLineL(const CApaCommandLine& aCommandLine);
Initialises an application
Constructs a new application consisting of a
CEikAppUi
, a CEikApplication
, and a
CEikDocument
. The new Uikon application starts with a new
controlling process and runs in this Uikon environment. The new application is
passed any command line file using the function
CEikAppUi::ProcessCommandParametersL()
.
|
static CEikonEnv* Static();
Gets the CEikonEnv
maintained by the framework for
the application. Compare CCoeEnv::Static()
.
This function should never be run in a thread where such a static Uikon environment does not exist. Code that may run on the server side of an application server is one such case.
|
static TVersion Version();
Gets the Uikon version that is currently running.
|
static void InfoWinL(const TDesC& aFirstLine, const TDesC& aSecondLine);
Displays a modal information dialog
(CEikInfoDialog
) on the screen with the specified lines of text.
User input cannot continue outside a modal dialog until the dialog is dismissed, although applications can be switched.
|
static void AddWindowShadow(CCoeControl* aWinArea);
Adds a window shadow of the standard height to a control.
static TBool QueryWinL(const TDesC& aFirstLine,const TDesC& aSecondLine);
Requests a yes or no response to a question from the user using a modal query dialog.
|
|
static CParaFormatLayer* NewDefaultSingleLineParaFormatLayerL();
Creates a paragraph format layer for single line texts.
|
static CParaFormatLayer* NewDefaultParaFormatLayerL();
Creates a default paragraph format layer for text that has more than one line.
|
static CCharFormatLayer* NewDefaultCharFormatLayerL();
Creates a default character format layer.
|
static void GetPrinterNamesL(CPrinterModelList* aModelNameList,CDesCArray& aPrinterNameList);
Gets printer names from a CPrinterModelList
The printer names are returned through
aPrinterNameList
.
|
MEikAppUiFactory* AppUiFactory() const;
Gets the Application UI factory object.
This object implements the MEikAppUiFactory
interface.
|
MEikAppUiFactory* AppUiFactory(const CEikAppUi& aAppUi) const;
Supported from 6.1
Gets the Application UI factory object for the specified App UI.
If the specified app UI does not exist in this environment the
function returns NULL. Otherwise the function returns an object which
implements the MEikAppUiFactory
interface.
|
|
CEikProcess* Process() const;
Gets the Uikon process that manages the files of applications started in this environment.
|
RAnimDll& ClockDllL();
Gets the animated Dll that is used to animate the toolbar clock
of the Uikon application using this CEikonEnv
.
|
CEikAppUi* EikAppUi() const;
Gets the application UI of the application using this
CEikonEnv
.
|
CPrintSetup* NewDefaultPrintSetupL();
Creates and returns a pointer to a new default printer setup object.
|
TDisplayMode DefaultDisplayMode() const;
Gets the default display mode for the window server session with the maximum possible number of colours.
|
TChar NudgeCharMinus() const;
Gets the minus nudge character, this could be the left arrow for example.
|
TChar NudgeCharPlus() const;
Gets the plus nudge character, this could be the right arrow for example.
|
TEikVirtualCursor& VirtualCursor();
Gets the virtual cursor.
|
MPictureFactory* PictureFactory() const;
Gets the picture factory for this environment.
|
MEikPictureFactory* ExtendedPictureFactory(TUid aPictureType) const;
Supported from 6.1
Gets a picture factory object in the environment which supports the specified picture type.
If none exists, then the function returns NULL.
|
|
void AddPictureFactoryL(MEikPictureFactory& aFactory);
Supported from 6.1
Adds the picture factory to the set of factories maintained by the Uikon environment.
For a picture factory to be available system wide,
AddPictureFactoryL()
should normally be called during the
InitializeL()
method of a CEikLibrary
derived
class.
|
void RemovePictureFactory(TUid aFactoryId);
Supported from 6.1
Removes the specified picture factory, if it exists, from the set of picture factories owned by the Uikon environment.
|
CCharFormatLayer* SystemCharFormatLayerL();
Gets the character format layer if it exists. If it does not
exist, calls CEikonEnv::NewDefaultCharFormatLayerL()
to create a
new character format layer.
|
CParaFormatLayer* SystemParaFormatLayerL();
Gets the paragraph format layer if it exists. If it does not
exist, calls CEikonEnv::NewDefaultParaFormatLayerL()
to create a
new paragraph format layer.
|
CParaFormatLayer* SystemSingleLineParaFormatLayerL();
Gets the single line paragraph format layer if it exists. If it
does not exist, calls
CEikonEnv::NewDefaultSingleLineParaFormatLayerL()
to create a new
paragraph format layer for single-line texts.
|
const CFont* Font(const TLogicalFont& aLogicalFont) const;
Gets the nearest match to the specified font. The return value
is never NULL
.
|
|
const CFont* AnnotationFont() const;
Gets the standard annotation font for this environment.
|
const CFont* TitleFont() const;
Gets the standard title font for this environment.
|
const CFont* LegendFont() const;
Gets the standard legend font for this environment.
|
const CFont* SymbolFont() const;
Gets the standard symbol font for this environment.
|
const CFont* DenseFont() const;
Gets the standard dense font for this environment.
|
CGulIcon* CreateIconFromMaskedBitmapL(const CApaMaskedBitmap& aApaMaskedBitmap);
Creates an icon from a masked bitmap. The icon is created by
copying the image bitmap and mask from the application architecture masked
bitmap aApaMaskedBitmap
. Returns a pointer to the icon and
transfers ownership.
|
|
CGulIcon* CreateIconL(const TDesC& aFileName,TInt aBitmapId,TInt aMaskId);
Creates an icon. The icon is created by loading the image
bitmap identified by aBitmapId
and the mask identified by
aMaskId
from the resource file aFileName
. Returns a
pointer to the icon and transfers ownership.
|
|
const CFbsBitmap* Bitmap(TUid aUidBmp) const;
Gets the specified bitmap. This function returns a bitmap from the list of bitmaps by using the UID as an index.
|
|
const CFbsBitmap* OptionBitmap() const;
Gets the bitmap that is used by the horizontal option buttons for this environment.
|
CWsBitmap* CreateBitmapL(const TDesC& aFileName, TInt aId);
Loads, allocates and returns a pointer to a bitmap loaded from
a multi-bitmap file (.mbm). If
aFileName
is an empty TDesC
, then a default value of
z:\system\data\eikon.mbm
is used.
|
|
void AlertWin(const TDesC& aMsg1, const TDesC& aMsg2);
Displays an alert window with a brief message.
|
TBool QueryWinL(TInt aFirstLineId, TInt aSecondLineId=0) const;
Displays a yes or no query dialog and returns the user's choice. The query text is read from the passed resource IDs.
|
|
TBool ConfirmLossOfAllChangesL() const;
Displays a dialog asking the user to confirm that all changes be lost to the current document, and returns their response.
|
Information messages are brief, informative messages that are displayed in the top-right corner of the screen for a few seconds.
void AllocInfoMsg();
Constructs an allocation information message. The message includes the total number of cells allocated on the current thread's heap and the total space allocated to them.
void FservAllocInfoMsg();
Creates a file server allocation information message from resource.
The message indicates the number of resources currently open for the file server session.
void WservAllocInfoMsg();
Creates a window server allocation information message from resource.
The message indicates the number of resources currently open for the window server session.
void InfoMsg (TInt aResourceId,VA_LIST aList);
Displays a message in the top-right corner of the screen.
The message window disappears after a few seconds.
A TBUF
-resource-specified formatting string may be
used to build the message at run-time from arbitrary data in a similar way to
C's printf()
.
|
void InfoMsgWithAlignment(TGulAlignment aCorner,TInt aResourceId,VA_LIST aList);
Displays a message in the specified corner of the screen.
Information messages can be built at run-time from a formatting
string defined as a TBUF
resource and a list of arbitrary
data.
|
void LeaveWithInfoMsg(TInt aResourceId,...);
Displays a formatted information message and then leaves.
This function calls
User::Leave(KLeaveWithoutAlert)
, this is defined in
basched.h.
|
void VerboseInfoMsg(const TDesC& aDes);
Displays an information message if verbose information reporting has been set.
The message is not displayed if verbose information reporting has not been set.
|
void BusyMsgL(const TDesC& aDes);
void BusyMsgL(const TDesC& aDes,TGulAlignment aCorner);
void BusyMsgL(const TDesC& aDes,TGulAlignment aCorner,TTimeIntervalMicroSeconds32 aInitialDelay);
void BusyMsgL(const TDesC& aDes,TTimeIntervalMicroSeconds32 aInitialDelay);
void BusyMsgL(TInt aResourceId);
void BusyMsgL(TInt aResourceId,TTimeIntervalMicroSeconds32 aInitialDelay);
Displays a flashing busy message in the lower right corner of the screen.
The message's initial delay and screen corner may optionally be overridden.
|
TBool IsBusy() const;
Determines whether the windows group is busy.
|
void SetBusy(TBool aBusy);
Sets windows group busy state.
|
void SetInfoDialog(MEikInfoDialog* aInfoDialog);
Sets the dialog.
|
void SetQueryDialog(MEikInfoDialog* aQueryDialog);
Sets the query dialog.
|
void SetRequestInfoDialogFunc(TRequestDialogFunc aInfoDialogFunc);
Sets the request information dialog.
|
void SetRequestQueryDialogFunc(TRequestDialogFunc aQueryDialogFunc);
Sets the request query dialog.
|
void InfoWinL(TInt aFirstLineId, TInt aSecondLineId=0) const;
Displays an information window with a one or two-line message read from the passed resources.
|
void DrawCursor(const CCoeControl* aControl,const TPoint& aPosition,TInt aWidth, TInt aAscent,TInt aHeight);
Draws the text cursor into a control with the specified
position and width. The cursor’s height and ascent is by default
suitable for this CEikonEnv
’s normal font. If
aControl
is not focused when this function is called, a panic is
raised.
|
void HideCursor(const CCoeControl* aControl);
Removes the text cursor from a control. In debug builds, a panic is raised when this function is called on a control which is not the cursor owner.
|
void AddDialogLikeControlToStackL(CCoeControl* aControl);
Adds a dialog-like control to the stack. Leave()
s
with no alert if there is already a control in existence in the control stack
with a priority greater than ECoeStackPriorityDialog
and less than
ECoeStackPriorityFep
.
|
void AddAlertDialogLikeControlToStackL(CCoeControl* aControl);
Adds an alert-dialog-like control to the stack.
Leave()
s with no alert if there is already a control in existence
in the control stack with a priority greater than
ECoeStackPriorityAlert
and less than
ECoeStackPriorityFep
.
|
void RemoveFromStack(CCoeControl* aControl);
Removes a control from the control stack.
|
void AddSleepingDialogToStackL(CCoeControl* aControl);
Adds a sleeping dialog to the CONE control stack. The sleeping dialog is not initially visible.
|
public: void AddSleepingAlertDialogToStackL(CCoeControl* aControl);
Adds a sleeping dialog to the CONE control stack that when roused is displayed with a priority similar to an alert. The sleeping dialog is not initially visible.
|
void RouseSleepingDialog(CCoeControl* aControl, TBool aRoused);
Sets dialog sleep state.
|
The following functions enable custom controls to retrieve colours from the colour list, and to override the system default colour settings.
TRgb Color(TLogicalColor aLogicalColor) const;
Gets the physical (TRgb
) colour which corresponds
to the logical colour.
|
|
TRgb ControlColor (TLogicalColor aLogicalColor,const CCoeControl& aControl) const;
Gets the physical (TRgb
) colour which corresponds
to the logical colour specified from the application's colour list.
If the colour of the control specified in aControl
has been overridden using CCoeControl::OverrideColorL()
, this
function will return the overridden colour.
|
|
void SetColor(TLogicalColor aLogicalColor,TRgb aColor);
Sets the mapping in the application's colour list between the logical and physical colours specified.
|
CColorList& ColorList() const;
Gets the application's colour list. The colour list provides member functions to retrieve and modify colours in the list, and to append new arrays of colours to the colour list.
|
CColorArray& CustomColorArray() const;
Gets the custom colour array.
|
TBool RespondsToShutdownEvent() const;
Tests whether an application responds to shutdown events.
|
void SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent);
Sets whether an application responds to shutdown events.
|
TBool RespondsToSwitchFilesEvent() const;
Tests whether an application responds to switch files events.
|
void SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent);
Sets whether an application responds to switch files events.
|
TBool DocNameIsAFile() const;
Tests whether the document name is a file.
|
void SetDocNameIsAFile(TBool aDocNameIsAFile);
Sets whether a document name is a file.
|
TBool IsSystem() const;
Tests the value of the system attribute.
|
void SetSystem(TBool aSystem);
Sets the application's system attribute.
While the system attribute is set, the application cannot be closed down.
|
void HandleErrorWithContext(TInt aError,TInt aContextRid);
Handles the specified error. This function reads the error
context text from the resource identified by aContextRid
.
|
void NotifyIdleError(TInt aError,TInt aContextRid);
Notifies this environment of an idle error. This function reads
the error context text from the resource identified by
aContextRid
.
|
void NotifyIdleErrorWhileRedrawing(TInt aError);
Notifies this environment that an idle error occurred while redrawing was in progress.
|
void BringForwards(TBool aForwards,TInt aPriority=ECoeWinPriorityAlwaysAtFront);
Repositions the root window group in the stacking hierarchy, or
pushes it to the back. Calls to this function are ignored if the autoforward
flag is set to ETrue
.
|
void SetAutoForwarding(TBool aForwarding);
Sets auto-forward state.
|
void InfoMsgWithDuration(const TDesC& aDes, TTimeIntervalMicroSeconds32 aDuration);
Supported from 6.1
Displays an info message for a specified period.
The text displayed is supplied in a descriptor argument.
|
void InfoMsgWithDuration(TInt aResourceId, TTimeIntervalMicroSeconds32 aDuration,...);
Supported from 6.1
Displays an info message for a specified period.
The text displayed is supplied in a resource file, as a string with some formatting information. Values for the formatting information are supplied as extra arguments. These extra arguments are supplied through the variable argument list which is also passed into this function.
|
void InfoMsgWithDuration(TInt aResourceId, TTimeIntervalMicroSeconds32 aDuration, VA_LIST aList);
Supported from 6.1
Displays an info message for a specified period.
The text displayed is supplied in a resource file, as a string with some formatting information. Values for the formatting information are supplied as extra arguments. These extra arguments are packaged in a VA_LIST object which is also passed into this function.
|
void InfoMsgWithAlignmentAndDuration(TGulAlignment aCorner,const TDesC& aDes, TTimeIntervalMicroSeconds32 aDuration);
Supported from 6.1
Displays an info message with a specified alignment for a specified period.
The text displayed is supplied in a descriptor argument, and aligned using the 'aCorner' parameter.
|
void InfoMsgWithAlignmentAndDuration(TGulAlignment aCorner,TInt aResourceId, TTimeIntervalMicroSeconds32 aDuration,...);
Supported from 6.1
Displays an info message with a specified alignment for a specified period.
The text displayed is supplied in a resource file, as a string with some formatting information. Values for the formatting information are supplied as extra arguments. These extra arguments are supplied through the variable argument list which is also passed into this function. The text is aligned using the 'aCorner' parameter.
|
void InfoMsgWithAlignmentAndDuration(TGulAlignment aCorner,TInt aResourceId, TTimeIntervalMicroSeconds32 aDuration,VA_LIST aList);
Supported from 6.1
Displays an info message with a specified alignment for a specified period.
The text displayed is supplied in a resource file, as a string with some formatting information. Values for the formatting information are supplied as extra arguments. These extra arguments are packaged in a VA_LIST object which is also passed into this function. The text is aligned using the 'aCorner' parameter.
|