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]

MSaveObserver class.

Parameters

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

~CSaveNotifier()

IMPORT_C~CSaveNotifier()

Member Functions Documentation

ConstructL()

voidConstructL()[private]

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

DelayRequeue()

IMPORT_C voidDelayRequeue()

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

DoCancel()

voidDoCancel()[private, virtual]

The method cancels the client's registration.

HandleError(TInt)

IMPORT_C voidHandleError(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 & aObserverA reference to the client's object, which implements MSaveObserver::SaveL() method.

Queue()

IMPORT_C voidQueue()

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

voidRunL()[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 TIntServerPowerState(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 & aPowerOffThe result of the query. Non-zero if the power state of the server is off.

Start()

voidStart()[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 TIntSwitchOff(MSaveObserver::TSaveTypeaAction,
TBoolaPowerOff
)[private]

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

Parameters

MSaveObserver::TSaveType aActionThe action, which will be given to the clients, when calling their MSaveObserver::SaveL() implementations.
TBool aPowerOffNon-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]