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.

defaultappclient.dll
Since
S60 v5.0

Inherits from

Constructor & Destructor Documentation

CDefaultAppClient()

CDefaultAppClient()[private]

C++ default constructor.

~CDefaultAppClient()

IMPORT_C~CDefaultAppClient()[virtual]

Destructor.

Member Functions Documentation

ChangeDefaultsL(TInt)

IMPORT_C voidChangeDefaultsL(TIntaFlags = 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.

Since
S60 v5.0

Parameters

TInt aFlags = 0service flags

ConstructL(MAknServerAppExitObserver *)

voidConstructL(MAknServerAppExitObserver *aObserver)[private]

Symbian constructor.

Parameters

MAknServerAppExitObserver * aObserver

GetServiceParamsL(TUid *)

voidGetServiceParamsL(TUid *aServerAppUid)[private, static]

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

Since
S60 v5.0

Parameters

TUid * aServerAppUidIf 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

Parameters

MAknServerAppExitObserver * aObserver

NewLC(MAknServerAppExitObserver *)

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

Symbian OS two-phased constructor

Parameters

MAknServerAppExitObserver * aObserver

PairsToDisplayL()

IMPORT_C TIntPairsToDisplayL()

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).

Since
S60 v5.0

ServiceAvailable(TInt &)

IMPORT_C TBoolServiceAvailable(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.

Since
S60 v5.0

Parameters

TInt & aErrorCode

Member Enumerations Documentation

Enum TFlags

flags used to modify the service behaviour

Enumerators

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.