Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: eikapp.h
Link against: eikcore.lib

Class CEikApplication

CEikApplication

Support

Supported from 6.0

Description

The root 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.

Each Uikon application class is derived from CEikApplication. Application writers must provide at least an implementation of the form of CreateDocumentL() that has no parameters.

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

Derivation

CApaApplicationDefines the basic behaviour for applications
CBaseBase class for all classes to be instantiated on the heap
CEikApplicationThe root of all Uikon applications

Defined in CEikApplication:
AllWindowsMustBeBackedUpWindows(), AppCaption(), BitmapStoreName(), CEikApplication(), Capability(), CreateDocumentL(), GetDefaultDocumentFileName(), OpenAppInfoFileLC(), OpenIniFileLC(), PreDocConstructL(), Process(), ResourceFileName(), ResourceFileOffset(), SetAllWindowsMustBeBackedUpWindowsL(), SetToIniFileNameL(), ~CEikApplication()

Inherited from CApaApplication:
AppDllUid(), AppFullName(), DllName(), GenerateFileName(), OpenAppInfoFileL(), OpenIniFileL()

Inherited from CBase:
operator new()

See also:


Construction and destruction


CEikApplication()

protected: CEikApplication();

Description

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.


~CEikApplication()

~CEikApplication();

Description

Destructor.

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

[Top]


Construction support


ResourceFileName()

virtual TFileName ResourceFileName() const;

Description

Gets the name of the resource file used by this application. By default, this file has an extension of .rsc with the same basename as the application file located in the same directory. Language variants are supported through BaflUtils::NearestLanguageFile().

Return value

TFileName

Name of the resource file. Used by PreDocConstructL().


OpenIniFileLC()

CDictionaryStore* OpenIniFileLC(RFs& aFs) const;

Description

Opens the application’s ini file if it exists. If an ini file does not exist for this application, or if it is corrupt, this function creates a new ini file and opens that. ini files are located on KIniFileDrive (by default, c:), in the same directory as the application DLL.

Parameters

RFs& aFs

File server session to use.

Return value

CDictionaryStore*

Pointer to the dictionary store for the opened file.

[Top]


Document creation


CreateDocumentL()

protected: CApaDocument* CreateDocumentL (CApaProcess* aProcess);

Description

Creates a new document. Called by the application DLL framework to create a new instance of the document associated with this application. The Uikon implementation of this CApaApplication member function makes a record of the CApaProcess argument, and returns a document created by the un-parameterised, private, form of CEikApplication::CreateDocumentL().


PreDocConstructL()

protected: void PreDocConstructL();

Description

Prepares for document creation. 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.

This function’s leaving should be treated as if construction had failed, and the object should be destroyed by the caller.

[Top]


Application information files


OpenAppInfoFileLC()

CApaAppInfoFileReader* OpenAppInfoFileLC() const;

Description

Reader for the default application information file. Creates a CApaAppInfoFileReader object for reading the application information file associated with this Uikon application, and returns a pointer to it.

Return value

CApaAppInfoFileReader*

Reader for the application’s information (.aif) file.


SetToIniFileNameL()

void SetToIniFileNameL(TParse& aParser) const;

Description

Makes a parser for this application’s ini file. Sets the fields of a supplied file name parser object, allowing it to find this application’s .ini file.

Parameters

TParse& aParser

A parser. On return, contains a parser which can be used to find this application’s ini file.

[Top]


Resource files


ResourceFileOffset()

TInt ResourceFileOffset() const;

Description

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.

Return value

TInt

Offset of a resource file.

[Top]


Access methods


AppCaption()

inline const TApaAppCaption& AppCaption() const;

Description

Gets the caption for this application. Captions are displayed in the task list.

Return value

TApaAppCaption&

Application caption.


BitmapStoreName()

virtual TFileName BitmapStoreName() const;

Description

Gets the default bitmap store’s name. By default, this file is a .mbm with the same basename as the application file in the same directory. Language variants are supported using BaflUtils::NearestLanguageFile().

Return value

TFileName

The file name of the bitmap store for this application.


GetDefaultDocumentFileName()

virtual void GetDefaultDocumentFileName(TFileName& aFileName) const;

Description

Gets the default document name for this application.

Parameters

TFileName& aFileName

On return, contains the default document file name.

[Top]


Global window backup store


SetAllWindowsMustBeBackedUpWindowsL()

void SetAllWindowsMustBeBackedUpWindowsL(TBool aAllWindowsMustBeBackedUpWindows);

Description

Sets the global backup store flag.

Sets the EFlagAllWindowsMustBeBackedUp flag in CEikApplication::CExtra. OPL requires this extension flag to be set to ETrue.

Parameters

TBool aAllWindowsMustBeBackedUpWindows

Whether all windows for the application must have a backing store.


AllWindowsMustBeBackedUpWindows()

TBool AllWindowsMustBeBackedUpWindows() const;

Description

Tests whether all windows for the application must have a backing store.

This is set with the EFlagAllWindowsMustBeBackedUp flag in CEikApplication::CExtra. By default, this flag is set to EFalse.

Return value

TBool

Whether all windows for the application must have a backing store.

[Top]


Public member functions


Process()

CApaProcess* Process() const;

Description

Gets the managing process.

Return value

CApaProcess*

A pointer to the process object managing this application’s documents.


Capability()

void Capability(TDes8&) const;

Description

Gets the application’s capabilities. This is an implementation of the pure virtual CApaApplication::Capability(). Uikon application developers should not need to override this function.