genericservices/taskscheduler/SCHSVR/SCHEXEC.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2004-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // SCH_EXEC.H
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __SCHEXEC_H__
       
    19 #define __SCHEXEC_H__
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 // Classes refereced
       
    26 class CSchLogManager;
       
    27 
       
    28 /** 
       
    29 @internalComponent
       
    30 */
       
    31 NONSHARABLE_CLASS(CTaskExecutor) : public CActive
       
    32 	{
       
    33 public:
       
    34 	static CTaskExecutor* NewLC(const TDesC& aErrorMessage, 
       
    35 								const TDesC& aTaskFileName, 
       
    36 								const TDesC& aClientFileName,
       
    37 								CSchLogManager& aSchLogManager);
       
    38 								
       
    39 	~CTaskExecutor();
       
    40 
       
    41 private: // Internal construct
       
    42 	CTaskExecutor(CSchLogManager& aSchLogManager);
       
    43 	
       
    44 	void ConstructL(const TDesC& aTaskFileName, 
       
    45 					const TDesC& aClientFileName, 
       
    46 					const TDesC& aErrorMessage);
       
    47 
       
    48 public: // Kick-off method
       
    49 	void ExecuteL();
       
    50 
       
    51 private: // From CActive
       
    52 	void RunL();
       
    53 	void DoCancel();
       
    54 
       
    55 private: // Error handling
       
    56 	void CheckErrorAndLeaveL(TInt aError);
       
    57 	void SaveExecutionErrorToLog(TInt aError);
       
    58 
       
    59 private:
       
    60 	RFs iFsSession;
       
    61 	RFile iTaskFile;
       
    62 	// The log manager in case of errors
       
    63 	CSchLogManager& iSchLogManager;
       
    64 	// The Log error message
       
    65 	HBufC* iLogErrorMessage;
       
    66 	// Name of executor program
       
    67 	HBufC* iClientFileName;
       
    68 	// Name of task file
       
    69 	HBufC* iTaskFileName;
       
    70 
       
    71 	RProcess iProcess;
       
    72 	};
       
    73 	
       
    74 /**
       
    75 Streaming operators for TSecurityInfo
       
    76 @internalComponent
       
    77 */	
       
    78 RWriteStream& operator<<(RWriteStream& aWriteStream, 
       
    79 						const TSecurityInfo& aSecurityInfo);
       
    80 
       
    81 /**
       
    82 Streaming operators for TSecurityInfo
       
    83 @internalComponent
       
    84 */	
       
    85 RReadStream& operator>>(RReadStream& aReadStream,
       
    86 						TSecurityInfo& aSecurityInfo);
       
    87 	
       
    88 
       
    89 
       
    90 #endif