CSaveNotifier Class Reference

class CSaveNotifier : public CActive

This class describes an object, which can be used by the clients, which want to be notified about events like powerdown/low memory. The clients have to implement MSaveObserver interface. When a particular event happens, the client's implementation of MSaveObserver::SaveL() will be called. MSaveObserver

Inherits from

Constructor & Destructor Documentation

CSaveNotifier(MSaveObserver &)

CSaveNotifier ( MSaveObserver & aObserver ) [private, inline]

Parameters

MSaveObserver & aObserver A reference to the client's object, which implements MSaveObserver::SaveL() method.

~CSaveNotifier()

IMPORT_C ~CSaveNotifier ( )

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

Standard phase-two construction method for creating CSaveNotifier instances. It creates a session with the shutdown server.

DelayRequeue()

IMPORT_C void DelayRequeue ( )

This method can delay/stop the powerdown sequence, if called after the client got the powerdown notification (inside MSaveObserver::SaveL() implementation). CSaveNotifier::Queue()

DoCancel()

void DoCancel ( ) [private, virtual]

The method cancels the client's registration.

HandleError(TInt)

IMPORT_C void HandleError ( TInt )

The client will call this method if an error occurred during the powerdown processing. But it ignores the error code supplied and re-queues for further events. The server will not handle the error message from the client.

Parameters

TInt

NewL(MSaveObserver &)

IMPORT_C CSaveNotifier * NewL ( MSaveObserver & aObserver ) [static]

Standard phase one factory method for creating CSaveNotifier instances. The caller of this method will be automatically registered to receive powerdown/low memory notifications from the shutdown server. MSaveObserver class.

Parameters

MSaveObserver & aObserver A reference to the client's object, which implements MSaveObserver::SaveL() method.

Queue()

IMPORT_C void Queue ( )

This method re-register the client to receive powerdown/low memory notifications from the shutdown server. It clears the effect of CSaveNotifier::DelayRequeue() call. CSaveNotifier::DelayRequeue()

RunL()

void RunL ( ) [private, virtual]

This method gets called when the shutdown server completes the client request for notification, registered when NotifySave() was called. It calls the implementation of MSaveObserver::SaveL() .

ServerPowerState(TBool &)

IMPORT_C TInt ServerPowerState ( TBool & aPowerOff ) [private]

With SYSLIBS_TEST macro defined, this method sends a request to query the power state of the server. Otherwise, it returns with KErrNotSupported.

Parameters

TBool & aPowerOff The result of the query. Non-zero if the power state of the server is off.

Start()

void Start ( ) [private]

The method notifies the shutdown server tha the client wants to be notified when there is an event like powerdown/low memory (client registration).

SwitchOff(MSaveObserver::TSaveType, TBool)

IMPORT_C TInt SwitchOff ( MSaveObserver::TSaveType aAction,
TBool aPowerOff
) [private]

With SYSLIBS_TEST macro defined, this method initiates a powerdown sequence. Otherwise, it returns with KErrNotSupported.

Parameters

MSaveObserver::TSaveType aAction The action, which will be given to the clients, when calling their MSaveObserver::SaveL() implementations.
TBool aPowerOff Non-zero if you want to switch the power off.

Member Data Documentation

TUint iFlags

TUint iFlags [private]

MSaveObserver & iSaveObserver

MSaveObserver & iSaveObserver [private]

RSaveSession iSaveSession

RSaveSession iSaveSession [private]