00001 // 00002 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 00003 // All rights reserved. 00004 // This component and the accompanying materials are made available 00005 // under the terms of "Eclipse Public License v1.0" 00006 // which accompanies this distribution, and is available 00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00008 // 00009 // Initial Contributors: 00010 // Nokia Corporation - initial contribution. 00011 // 00012 // Contributors: 00013 // 00014 // Description: 00015 // Dummy Disk status policy is used to demonstrate a System Wide Property 00016 // policy file. It executes a command list which can start a process dummybackup.exe, 00017 // depending on the value of the dummy disk status policy. 00018 00019 00020 #ifndef __DUMMY_DISKSTATUS_SWPPOLICY_H__ 00021 #define __DUMMY_DISKSTATUS_SWPPOLICY_H__ 00022 00023 #include <e32cons.h> 00024 #include <f32file.h> 00025 00026 #include <ssm/ssmswppolicy.h> 00027 #include <ssm/ssmconditionalcallback.h> 00028 00029 // Forward declare 00030 class CSsmCommandListResourceReader; 00031 00039 NONSHARABLE_CLASS(CSsmDummyDiskStatusSwpPolicy) : public CBase, public MSsmSwpPolicy, public MSsmConditionalCallback 00040 { 00041 public: 00042 IMPORT_C static MSsmSwpPolicy* NewL(); 00043 00044 //from MSsmSwpPolicy 00045 void ConstructL(); 00046 void Initialize(TRequestStatus& aStatus); 00047 void InitializeCancel(); 00048 void Release(); 00049 TResponse TransitionAllowed(const TSsmSwp& aSwp, const RMessagePtr2& aMessage); 00050 void PrepareCommandList(const TSsmSwp& aSwp, TRequestStatus& aStatus); 00051 void PrepareCommandListCancel(); 00052 CSsmCommandList* CommandList(); 00053 void HandleCleReturnValue(const TSsmSwp& aSwp, TInt aError, TInt aSeverity, TRequestStatus& aStatus); 00054 void HandleCleReturnValueCancel(); 00055 00056 //from MSsmConditionalCallback 00057 TBool ConditionalCommandAllowedL(CResourceFile& aResourceFile, TInt aResourceId); 00058 00059 private: 00060 //from CBase 00061 CSsmDummyDiskStatusSwpPolicy(); 00062 ~CSsmDummyDiskStatusSwpPolicy(); 00063 00064 private: 00065 RFs iFs; 00066 CSsmCommandListResourceReader* iCommandListResourceReader; 00067 // Possible panic codes within Disk Status policy 00068 enum TDiskStatusPanicCodes 00069 { 00070 EInvalidResourceReader //Panic when command list resource reader is NULL 00071 }; 00072 }; 00073 00074 #endif //__DUMMY_DISKSTATUS_SWPPOLICY_H__
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.