1.1 --- a/epoc32/include/savenotf.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,97 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#if !defined(SAVENOTF_H)
1.20 -#define SAVENOTF_H
1.21 -
1.22 -#include <e32std.h>
1.23 -#include <e32base.h>
1.24 -
1.25 -/**
1.26 -This interface has to be implemented by all clients, which want to be notified about events
1.27 -like shutdown/low memory. When this happens the implementation of MSaveObserver::SaveL() will
1.28 -be called.
1.29 -@see CSaveNotifier
1.30 -@publishedPartner
1.31 -@released
1.32 -*/
1.33 -class MSaveObserver
1.34 - {
1.35 -public:
1.36 - enum TSaveType
1.37 - {
1.38 - ESaveNone,
1.39 - ESaveData,
1.40 - ESaveAll,
1.41 - ESaveQuick,
1.42 - EReleaseRAM,
1.43 - EReleaseDisk,
1.44 - };
1.45 -public:
1.46 - virtual void SaveL(TSaveType aSaveType)=0;
1.47 - };
1.48 -
1.49 -/**
1.50 -This class describes a client side session object, handling requests
1.51 -to the shutdown server.
1.52 -@internalComponent
1.53 -*/
1.54 -class RSaveSession : public RSessionBase
1.55 - {
1.56 -public:
1.57 - TInt ConnectL();
1.58 - void NotifySave(TRequestStatus& aStatus);
1.59 - void NotifySaveCancel();
1.60 - TInt SwitchOff(MSaveObserver::TSaveType aAction, TBool aPowerOff);
1.61 - TInt ServerPowerState(TBool& aPowerOff);
1.62 -private:
1.63 - TInt StartServerL();
1.64 - };
1.65 -
1.66 -/**
1.67 -This class describes an object, which can be used by the clients, which want to be notified
1.68 -about events like powerdown/low memory. The clients have to implement MSaveObserver interface.
1.69 -When a particular event happens, the client's implementation of MSaveObserver::SaveL() will
1.70 -be called.
1.71 -@see MSaveObserver
1.72 -@publishedPartner
1.73 -@released
1.74 -*/
1.75 -class CSaveNotifier : public CActive
1.76 - {
1.77 - friend class CPowerdownClient;//test class
1.78 - friend class CPowerdownClient2;//test class
1.79 -public:
1.80 - IMPORT_C static CSaveNotifier* NewL(MSaveObserver& aObserver);
1.81 - IMPORT_C ~CSaveNotifier();
1.82 - IMPORT_C void DelayRequeue();
1.83 - IMPORT_C void Queue();
1.84 - IMPORT_C void HandleError(TInt /*aError*/);
1.85 -private:
1.86 - IMPORT_C TInt SwitchOff(MSaveObserver::TSaveType aAction, TBool aPowerOff);
1.87 - IMPORT_C TInt ServerPowerState(TBool& aPowerOff);
1.88 - inline CSaveNotifier(MSaveObserver& aObserver);
1.89 - void ConstructL();
1.90 - void Start();
1.91 -private: // from CActive
1.92 - void DoCancel();
1.93 - void RunL();
1.94 -private:
1.95 - RSaveSession iSaveSession;
1.96 - MSaveObserver& iSaveObserver;
1.97 - TUint iFlags;
1.98 - };
1.99 -
1.100 -#endif