cryptoservices/filebasedcertificateandkeystores/test/keytool/keytool_engine.h
changeset 0 2c201484c85f
child 8 35751d3474b7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cryptoservices/filebasedcertificateandkeystores/test/keytool/keytool_engine.h	Wed Jul 08 11:25:26 2009 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef __KEYTOOL_ENGINE_H_
+#define __KEYTOOL_ENGINE_H_
+
+#include <e32base.h>
+#include <unifiedkeystore.h>
+
+#include "keytool_commands.h"
+
+class CKeyToolController;
+
+class CKeyToolEngine : public CActive
+	{
+public:
+	static CKeyToolEngine* NewLC(CKeyToolController* aController);
+	static CKeyToolEngine* NewL(CKeyToolController* aController);
+	~CKeyToolEngine();
+	void ConstructL();	
+		
+public: // Actual commands
+	void ListL(CKeyToolParameters* aParam);
+	void ImportL(CKeyToolParameters* aParam);
+	void RemoveL(CKeyToolParameters* aParam);
+	void DisplayUsageL(CKeyToolParameters* aParam);
+	void ListStoresL(CKeyToolParameters* aParam);	
+	void SetPolicyL(CKeyToolParameters* aParam);
+	
+public: // From CActive
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+
+protected:
+	void InitializeL();
+
+private:
+	CKeyToolEngine(CKeyToolController* aController);
+		
+private:
+	enum 
+		{		
+		EInitialise,
+		EExecuting,
+		EDone
+		} iState;
+	enum 
+		{
+		EIdle,
+		EList,
+		EImport,
+		ERemove,
+		ESetPolicy
+		} iCurrentAction;
+		
+	TBool iInitialized;
+	TBool iActiveStarted;	
+	CKeyToolCommand* iHandler;		
+	CKeyToolParameters* iParam;
+	CKeyToolController* iController;
+	
+	RFs iFs;
+	CUnifiedKeyStore* iKeyStore;
+	CActiveScheduler* iScheduler;	
+	};
+	
+#endif