CEikApplication Class Reference

class CEikApplication : public CApaApplication

The base of all Uikon applications.

CEikApplication builds on CApaApplication, providing a basis for applications working within the framework provided by Uikon. It also contains an interface to the resource file and the document object belonging to the application.

Each Uikon application class is derived from CEikApplication. Application writers must provide at least an implementation of the pure virtual function CreateDocumentL().

The application's resource file can be changed from the default by overriding ResourceFileName().


Inherits from

Public Member Functions
const TApaAppCaption &AppCaption()
IMPORT_C TFileNameBitmapStoreName()
IMPORT_C voidCapability(TDes8 &)
IMPORT_C voidGetDefaultDocumentFileName(TFileName &)
IMPORT_C CDictionaryStore *OpenIniFileLC(RFs &)
CApaProcess *Process()
IMPORT_C TFileNameResourceFileName()
TInt ResourceFileOffset()
IMPORT_C voidSetToIniFileNameL(TParse &)
Protected Member Functions
IMPORT_C CApaDocument *CreateDocumentL(CApaProcess *)
IMPORT_C voidEnsureCaptionIsLocalisedL(const TDesC &)
IMPORT_C voidNewAppServerL(CApaAppServer *&)
IMPORT_C voidPreDocConstructL()
Private Member Functions
IMPORT_C voidCEikApplication_Reserved1()
IMPORT_C voidCEikApplication_Reserved2()
CApaDocument *CreateDocumentL()
voidInitAppNameParserWithPathAndExt(TParse &, const TDesC &, const TDesC &)
Inherited Functions
CApaApplication::GenerateFileName(RFs &,TFileName &)
CApaApplication::OpenIniFileL(RFs &)const
CApaApplication::SetAppFileNameRef(const RBuf &)
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
Private Member Enumerations
enumanonymous { EFlagCaptionCorrectlyLocalised = 0x00000001 }
Protected Attributes
CCoeEnv *iCoeEnv
TInt iResourceFileOffset
Private Attributes
TUint iAppFlags
TApaAppCapabilityBuf *iCapabilityBuf
TApaAppCaption iCaption
CApaProcess *iProcess
TInt iSpare

Constructor & Destructor Documentation



Default constructor.

The default constructor is empty, and there are no NewL() or NewLC() functions as Uikon applications are created automatically by the application DLL framework when applications are started.




Deletes any resources acquired by this CEikApplication during its construction phases.

Member Functions Documentation


const TApaAppCaption &AppCaption()const [inline]

Gets the caption for this application.

Captions are displayed in the task list.


IMPORT_C TFileNameBitmapStoreName()const [virtual]

Gets the localized name of the bitmap file used by this application.

By default, this file has an extension of .mbm and uses the same name as the application file in the same directory. Language variants are supported using BaflUtils::NearestLanguageFile().


IMPORT_C voidCEikApplication_Reserved1()[private, virtual]


IMPORT_C voidCEikApplication_Reserved2()[private, virtual]

Capability(TDes8 &)

IMPORT_C voidCapability(TDes8 &aInfo)const [virtual]

Gets the application's capabilities.

Application developers should not need to override this function.


TDes8 & aInfo

CreateDocumentL(CApaProcess *)

IMPORT_C CApaDocument *CreateDocumentL(CApaProcess *aProcess)[protected, virtual]

Creates a new document.

This function is called by the application DLL framework during application startup to create a new instance of the document associated with this application. This implementation of the function makes a record of the CApaProcess argument, and returns a document created by the un-parameterised, private, overload.


CApaProcess * aProcess


CApaDocument *CreateDocumentL()[private, pure virtual]

EnsureCaptionIsLocalisedL(const TDesC &)

IMPORT_C voidEnsureCaptionIsLocalisedL(const TDesC &aLocalisableResourceFile)[protected]

Calling this method will ensure that the application Caption has been localized. This is called at the start of applications override of CEikApplication's CreateDocumentL, when application needs to started in Critical phase of Start-Up.


const TDesC & aLocalisableResourceFileLocation of the localized resource file

GetDefaultDocumentFileName(TFileName &)

IMPORT_C voidGetDefaultDocumentFileName(TFileName &aDocumentName)const [virtual]

Gets the default document name for this application.


TFileName & aDocumentNameOn return, contains the default document file name.

InitAppNameParserWithPathAndExt(TParse &, const TDesC &, const TDesC &)

voidInitAppNameParserWithPathAndExt(TParse &aParser,
const TDesC &aPath,
const TDesC &aExt
)const [private]

Initiates the aParser object with the name of the application and the aPath and aExt specified.


TParse & aParser
const TDesC & aPath
const TDesC & aExt

NewAppServerL(CApaAppServer *&)

IMPORT_C voidNewAppServerL(CApaAppServer *&aAppServer)[protected, virtual]

Virtual function called by the framework when the application has been launched as a server application. Applications that wish to be used as server applications must override this function to return their implementation of the server.

Base class implementation of this function leaves with KErrNotSupported, to prevent non-server applications from being launched as server applications.


CApaAppServer *& aAppServerThe server pointer to be set.

OpenIniFileLC(RFs &)

IMPORT_C CDictionaryStore *OpenIniFileLC(RFs &aFs)const [virtual]

Opens the application's .ini file, if one exists.

If a .ini file does not exist for this application, or if it is corrupt, this function creates one and opens that. .ini files are located on system drive, in the same directory as the application EXE.


RFs & aFsFile server session to use.


IMPORT_C voidPreDocConstructL()[protected, virtual]

Prepares for document creation.

This function is called by the application DLL framework to complete construction and initialise the new application object. After this function has been called, the CEikApplication can create document objects. If there is a default resource file for this app, then it is added to the control environment.

If this function leaves, this should be treated as if construction had failed, and the object should be destroyed by the caller.


CApaProcess *Process()const [inline]

Gets the managing process.


IMPORT_C TFileNameResourceFileName()const [virtual]

Gets the localized name of the resource file used by this application.

By default, this file has an extension of .rsc and uses the same name as the application file located in the same directory. Language variants are supported through BaflUtils::NearestLanguageFile().


TInt ResourceFileOffset()const [inline]

Gets the offset value defined for this application's default resource file.

As the resource file offset can also be accessed through iResourceFileOffset, this function should not be needed by any apps.

SetToIniFileNameL(TParse &)

IMPORT_C voidSetToIniFileNameL(TParse &aParser)const

Sets a supplied file name parser to contain the path of this application's .ini file.


TParse & aParserA file name parser. On return, this contains the path of the application's ini file.

Member Enumerations Documentation

Enum anonymous


EFlagCaptionCorrectlyLocalised = 0x00000001

Member Data Documentation

TUint iAppFlags

TUint iAppFlags[private]

TApaAppCapabilityBuf * iCapabilityBuf

TApaAppCapabilityBuf *iCapabilityBuf[private]

TApaAppCaption iCaption

TApaAppCaption iCaption[private]

CCoeEnv * iCoeEnv

CCoeEnv *iCoeEnv[protected]

CApaProcess * iProcess

CApaProcess *iProcess[private]

TInt iResourceFileOffset

TInt iResourceFileOffset[protected]

TInt iSpare

TInt iSpare[private]