Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: apparc.h
Link against: apparc.lib

Class CApaApplication

CApaApplication

Support

Supported from 5.0

Description

Defines the basic behaviour for applications.

The class defines the basic twin roles of an application class as a factory that creates concrete document objects, and as a supplier of utility functions not specific to any particular instance of a document. For example, returning an application's caption, or accessing its .ini file.

The class is derived from by the UI framework and is further derived from by the UI application.

Derivation

CApaApplicationDefines the basic behaviour for applications
CBaseBase class for all classes to be instantiated on the heap

Defined in CApaApplication:
AppDllUid(), AppFullName(), Capability(), CreateDocumentL(), DllName(), GenerateFileName(), OpenAppInfoFileL(), OpenAppInfoFileLC(), OpenIniFileL(), OpenIniFileLC(), PreDocConstructL()

Inherited from CBase:
operator new()

See also:


Construction


PreDocConstructL()

virtual void PreDocConstructL() = 0;

Description

Completes construction of this application object.

The function is called after an instance of a derived class has been successfully created using the ordinal 1 function of the application DLL.

After calling this function, an application can create document objects.

An implementation of this function is supplied by the UI framework.

See also:

[Top]


Document creation


CreateDocumentL()

virtual CApaDocument* CreateDocumentL(CApaProcess* aProcess) = 0;

Description

Creates a document object.

The function is called by the application process when a new document is required. The application process adds the new document to its list of documents.

An implementation of this function is supplied by the UI framework.

Parameters

CApaProcess* aProcess

A pointer to the process associated with the application.

Return value

CApaDocument*

A pointer to the newly created document.

See also:

[Top]


Application information


AppDllUid()

virtual TUid AppDllUid() const = 0;

Description

Gets the application specific UID.

The UID is used to differentiate between UI applications.

An implementation of this function must be supplied by the UI application.

Return value

TUid

The application specific UID.


AppFullName()

virtual TFileName AppFullName() const;

Description

Returns the full name and path of the application.

The default implementation returns the full path name of the application DLL.

An application can provide its own implementation.

Return value

TFileName

Full path name of the application.

See also:


DllName()

TFileName DllName() const;

Description

Returns the full name and path of the loaded application DLL.

Return value

TFileName

Full path name of the application DLL.


Capability()

virtual void Capability(TDes8& aInfo) const = 0;

Description

Returns the capabilities of the application.

Application capability information is represented by an instance of a TApaAppCapability object wrapped in a packaged modifiable buffer descriptor.

The function is called from a number of places within the application framework.

An implementation of this function is supplied by the UI framework.

Parameters

TDes8& aInfo

A packaged modifiable buffer descriptor (a TPckgBuf), encapsulating a TApaAppCapability object.

See also:

[Top]


AIF and INI file access


OpenIniFileL()

CDictionaryStore* OpenIniFileL(RFs& aFs) const;

Description

Opens the .ini file associated with the application, constructs the dictionary store object and returns a pointer to it.

The implementation of this function is provided by the OpenIniFileLC() function. The function pops the pointer returned by OpenIniFileLC() from the cleanup stack.

Parameters

RFs& aFs

Handle to a file server session.

Return value

CDictionaryStore*

A pointer to the dictionary store object representing the application's .ini file.

See also:


OpenIniFileLC()

virtual CDictionaryStore* OpenIniFileLC(RFs& aFs) const = 0;

Description

Opens the .ini file associated with the application, constructs the dictionary store object, returns a pointer to it and puts the pointer onto the cleanupstack.

The .ini file must be created, if it does not already exist.

An implementation of this function is supplied by the UI framework.

Parameters

RFs& aFs

Handle to a file server session

Return value

CDictionaryStore*

A pointer to the dictionary store object that represents the application's .ini file.

See also:


OpenAppInfoFileL()

CApaAppInfoFileReader* OpenAppInfoFileL() const;

Description

Opens the .aif file associated with the application, constructs the associated application information file reader object and returns a pointer to it.

The implementation of this function is provided by the OpenAppInfoFileLC() function. The function pops the pointer that is returned by OpenAppInfoFileLC() from the cleanup stack.

Return value

CApaAppInfoFileReader*

A pointer to the .aif reader object.

See also:


OpenAppInfoFileLC()

virtual CApaAppInfoFileReader* OpenAppInfoFileLC() const = 0;

Description

Opens the .aif file associated with the application, constructs the associated application information file reader object, returns a pointer to it and puts the pointer onto the cleanup stack.

An implementation of this function is supplied by the UI framework.

Return value

CApaAppInfoFileReader*

A pointer to the .aif reader object.

See also:

[Top]


Filename generation


GenerateFileName()

static TInt GenerateFileName(RFs& aFs,TFileName& aRootName);

Description

Generates a unique filename based on the file name contained within the specified full path name.

If necessary, the function creates the directory structure that is defined in the specified full path name.

If the file name does not yet exist, then this is the file name chosen. If this file name already exists, then a file name of the form: name(nn) is generated, where nn are decimal digits. The value of nn is incremented until a name is generated that is unique within the directory structure. A minimum of two decimal digits is generated.

The function is used by the UI framework.

Parameters

RFs& aFs

Handle to a file server session.

TFileName& aRootName

The full path name.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes. Specifically: KErrBadName, if the file name portion of the specified full path name has invalid format; KErrArgument, if the drive, path or file name parts are missing from the specified full path name; KErrOverflow, if the generated filename becomes too long.

See also: