sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // SCH_EXEC.H sl@0: // sl@0: // sl@0: sl@0: #ifndef __SCHEXEC_H__ sl@0: #define __SCHEXEC_H__ sl@0: sl@0: // System includes sl@0: #include sl@0: #include sl@0: sl@0: // Classes refereced sl@0: class CSchLogManager; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: NONSHARABLE_CLASS(CTaskExecutor) : public CActive sl@0: { sl@0: public: sl@0: static CTaskExecutor* NewLC(const TDesC& aErrorMessage, sl@0: const TDesC& aTaskFileName, sl@0: const TDesC& aClientFileName, sl@0: CSchLogManager& aSchLogManager); sl@0: sl@0: ~CTaskExecutor(); sl@0: sl@0: private: // Internal construct sl@0: CTaskExecutor(CSchLogManager& aSchLogManager); sl@0: sl@0: void ConstructL(const TDesC& aTaskFileName, sl@0: const TDesC& aClientFileName, sl@0: const TDesC& aErrorMessage); sl@0: sl@0: public: // Kick-off method sl@0: void ExecuteL(); sl@0: sl@0: private: // From CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: sl@0: private: // Error handling sl@0: void CheckErrorAndLeaveL(TInt aError); sl@0: void SaveExecutionErrorToLog(TInt aError); sl@0: sl@0: private: sl@0: RFs iFsSession; sl@0: RFile iTaskFile; sl@0: // The log manager in case of errors sl@0: CSchLogManager& iSchLogManager; sl@0: // The Log error message sl@0: HBufC* iLogErrorMessage; sl@0: // Name of executor program sl@0: HBufC* iClientFileName; sl@0: // Name of task file sl@0: HBufC* iTaskFileName; sl@0: sl@0: RProcess iProcess; sl@0: }; sl@0: sl@0: /** sl@0: Streaming operators for TSecurityInfo sl@0: @internalComponent sl@0: */ sl@0: RWriteStream& operator<<(RWriteStream& aWriteStream, sl@0: const TSecurityInfo& aSecurityInfo); sl@0: sl@0: /** sl@0: Streaming operators for TSecurityInfo sl@0: @internalComponent sl@0: */ sl@0: RReadStream& operator>>(RReadStream& aReadStream, sl@0: TSecurityInfo& aSecurityInfo); sl@0: sl@0: sl@0: sl@0: #endif