libraries/iosrv/client/command_base.h
changeset 0 7f656887cf89
child 45 534b01198c2d
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // command_base.h
       
     2 // 
       
     3 // Copyright (c) 2009 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 #ifndef __COMMAND_BASE_H__
       
    14 #define __COMMAND_BASE_H__
       
    15 
       
    16 #include <e32base.h>
       
    17 
       
    18 namespace IoUtils
       
    19 	{
       
    20 
       
    21 	NONSHARABLE_CLASS(CCommandCompleter) : public CActive
       
    22 		{
       
    23 	public:
       
    24 		CCommandCompleter(IoUtils::CCommandBase& aCmd);
       
    25 		~CCommandCompleter();
       
    26 		void Complete(TInt aError);
       
    27 		void Complete(TInt aError, const TDesC& aText, RIoWriteHandle& aWhere);
       
    28 		void Complete(TInt aError, const CTextBuffer* aTextBuffer, RIoWriteHandle& aWhere);
       
    29 	private:
       
    30 		virtual void RunL();
       
    31 		virtual void DoCancel();
       
    32 	private:
       
    33 		IoUtils::CCommandBase& iCmd;
       
    34 		TInt iError;
       
    35 		const CTextBuffer* iTextBuffer;
       
    36 		TBuf<0x100> iBuf;
       
    37 		};
       
    38 
       
    39 	NONSHARABLE_CLASS(CReaderChangeNotifier) : public CActive
       
    40 		{
       
    41 	public:
       
    42 		CReaderChangeNotifier(IoUtils::CCommandBase& aCmd, RIoReadHandle& aReadHandle);
       
    43 		~CReaderChangeNotifier();
       
    44 		void Notify();
       
    45 	private:
       
    46 		virtual void RunL();
       
    47 		virtual void DoCancel();
       
    48 	private:
       
    49 		IoUtils::CCommandBase& iCmd;
       
    50 		RIoReadHandle& iReadHandle;
       
    51 		TPckgBuf<TUint> iChangeType;
       
    52 		};
       
    53 
       
    54 	void Panic(TCmdBasePanic aReason);
       
    55 	}
       
    56 	
       
    57 #endif //__COMMAND_BASE_H__