1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(SAVENOTF_H)
23 This interface has to be implemented by all clients, which want to be notified about events
24 like shutdown/low memory. When this happens the implementation of MSaveObserver::SaveL() will
43 virtual void SaveL(TSaveType aSaveType)=0;
47 This class describes a client side session object, handling requests
48 to the shutdown server.
51 class RSaveSession : public RSessionBase
55 void NotifySave(TRequestStatus& aStatus);
56 void NotifySaveCancel();
57 TInt SwitchOff(MSaveObserver::TSaveType aAction, TBool aPowerOff);
58 TInt ServerPowerState(TBool& aPowerOff);
64 This class describes an object, which can be used by the clients, which want to be notified
65 about events like powerdown/low memory. The clients have to implement MSaveObserver interface.
66 When a particular event happens, the client's implementation of MSaveObserver::SaveL() will
72 class CSaveNotifier : public CActive
74 friend class CPowerdownClient;//test class
75 friend class CPowerdownClient2;//test class
77 IMPORT_C static CSaveNotifier* NewL(MSaveObserver& aObserver);
78 IMPORT_C ~CSaveNotifier();
79 IMPORT_C void DelayRequeue();
80 IMPORT_C void Queue();
81 IMPORT_C void HandleError(TInt /*aError*/);
83 IMPORT_C TInt SwitchOff(MSaveObserver::TSaveType aAction, TBool aPowerOff);
84 IMPORT_C TInt ServerPowerState(TBool& aPowerOff);
85 inline CSaveNotifier(MSaveObserver& aObserver);
88 private: // from CActive
92 RSaveSession iSaveSession;
93 MSaveObserver& iSaveObserver;