CDefaultAppClient Class Reference

class CDefaultAppClient : public CBase

Client API for setting the default application.

This class defines the API that applications should use to trigger the launch of the Default Application Server, that asks the user to select default applications for those Service & MIME pairs for which the client application is a candidate.

A client application should first instantiate the service, using eithe NewL() or NewLC() The client application can check first if the sercive is available in the system (by using the ServiceAvailable() function. The client application may also check if there is anything to display (if there is any Service & MIME that the client application supports for which there is at least another application supporting the pair). If there is no such pair, then launching the server would display an empty list). This checking is performed using the PairsToDisplayL() function.

After the above checkings are done, the client application can ask the server to change defaults by calling the ChangeDefaultsL() function.

S60 v5.0

Inherits from

Constructor & Destructor Documentation


CDefaultAppClient ( ) [private]

C++ default constructor.


IMPORT_C ~CDefaultAppClient ( ) [virtual]


Member Functions Documentation


IMPORT_C void ChangeDefaultsL ( TInt aFlags = 0 )

This function launches the server, as a chained application. The client application will not be available to the user until the server does not exit. When the server exits, the client application gains control again. The observer (if specified during instantiation (NewL) is notified that the server has exited.

S60 v5.0


TInt aFlags = 0 service flags

ConstructL(MAknServerAppExitObserver *)

void ConstructL ( MAknServerAppExitObserver * aObserver ) [private]

Symbian constructor.


MAknServerAppExitObserver * aObserver

GetServiceParamsL(TUid *)

void GetServiceParamsL ( TUid * aServerAppUid ) [private, static]

This function finds out the uid of the Default Application Server (the application registered to handle the DefaultApp service)

S60 v5.0


TUid * aServerAppUid If parameter is non-NULL, it returns the Uid of the server there

NewL(MAknServerAppExitObserver *)

IMPORT_C CDefaultAppClient * NewL ( MAknServerAppExitObserver * aObserver ) [static]

Symbian OS two-phased constructor


MAknServerAppExitObserver * aObserver

NewLC(MAknServerAppExitObserver *)

IMPORT_C CDefaultAppClient * NewLC ( MAknServerAppExitObserver * aObserver ) [static]

Symbian OS two-phased constructor


MAknServerAppExitObserver * aObserver


IMPORT_C TInt PairsToDisplayL ( )

Function to check the number of Service & MIME pairs the server would display if the ChangeDefaultsL() would be called. The purpose of this function is to allow the client application not to display an entry for starting the server, in the Options menu, in case the Server's list of Service & MIME pairs is empty.

Please note that the function may return a higher number than the actual number of pairs, because it does not check for MIMEs with System priority (that would not be displayed).

S60 v5.0

ServiceAvailable(TInt &)

IMPORT_C TBool ServiceAvailable ( TInt & aErrorCode ) [static]

Function to check if a server is present in the system. If the server is present, the subsequent functions should not fail due to server unavailability.

S60 v5.0


TInt & aErrorCode

Member Enumerations Documentation

Enum TFlags

flags used to modify the service behaviour


EFlagNoObserver = 1
EFlagReserved1 = 2
EFlagReserved2 = 4

Member Data Documentation

CApaServerAppExitMonitor * iMonitor

CApaServerAppExitMonitor * iMonitor [private]

Monitor object that calls the iObserver when the server has exited. Owned.

MAknServerAppExitObserver * iObserver

MAknServerAppExitObserver * iObserver [private]

Pointer to the Observer to call after the operation initiated by ChangeDefaultsAsyncL() has finished. Not Owned.

TUid iServerAppUid

TUid iServerAppUid [private]

The UID of the server application (we discover the server)

RDefaultAppService * iService

RDefaultAppService * iService [private]

Pointer to the service class. Own.