libraries/iosrv/inc/ioutils.h
changeset 45 534b01198c2d
parent 23 092bcc217d9d
child 50 e81b4e28b3e2
equal deleted inserted replaced
43:698ccde15713 45:534b01198c2d
    98 	EValueTypeAlreadySet = 48,
    98 	EValueTypeAlreadySet = 48,
    99 	EValueDescriptionAlreadySet = 49,
    99 	EValueDescriptionAlreadySet = 49,
   100 	EEnumValueListAlreadySet = 50,
   100 	EEnumValueListAlreadySet = 50,
   101 	EEnumDescriptionListAlreadySet = 51,
   101 	EEnumDescriptionListAlreadySet = 51,
   102 	EIncompleteArgumentOrOptionInitialization = 52,
   102 	EIncompleteArgumentOrOptionInitialization = 52,
       
   103 	EENotifyKeypressesSpecifiedWithoutExtensionBeingSet = 53,
   103 	};
   104 	};
   104 
   105 
   105 class CCommandBase;
   106 class CCommandBase;
   106 class CReaderChangeNotifier;
   107 class CReaderChangeNotifier;
   107 class CCommandCompleter;
   108 class CCommandCompleter;
   108 class MLineReader;
   109 class MLineReader;
   109 
   110 class CKeypressWatcher;
   110 
   111 
   111 class TOverflowTruncate : public TDes16Overflow
   112 class TOverflowTruncate : public TDes16Overflow
   112 	{
   113 	{
   113 public:
   114 public:
   114 	virtual void Overflow(TDes16&) {}
   115 	virtual void Overflow(TDes16&) {}
   639 	};
   640 	};
   640 
   641 
   641 enum TCommandExtensionVersion
   642 enum TCommandExtensionVersion
   642 	{
   643 	{
   643 	ECommandExtensionV1 = 1,
   644 	ECommandExtensionV1 = 1,
       
   645 	ECommandExtensionV2 = 2,
   644 	};
   646 	};
   645 
   647 
   646 class MCommandExtensionsV1
   648 class MCommandExtensionsV1
   647 	{
   649 	{
   648 public:
   650 public:
   649 	IMPORT_C virtual TCommandExtensionVersion ExtensionVersion() const; // Don't override this yourself!
   651 	IMPORT_C virtual TCommandExtensionVersion ExtensionVersion() const; // Don't override this yourself!
   650 	
   652 	
   651 	// Override this if you have custom error codes you want CCommandBase to understand
   653 	// Override this if you have custom error codes you want CCommandBase to understand
   652 	IMPORT_C virtual const TDesC* StringifyError(TInt aError) const;
   654 	IMPORT_C virtual const TDesC* StringifyError(TInt aError) const;
       
   655 	};
       
   656 
       
   657 class MCommandExtensionsV2 : public MCommandExtensionsV1
       
   658 	{
       
   659 public:
       
   660 	IMPORT_C virtual TCommandExtensionVersion ExtensionVersion() const; // Don't override this yourself!
       
   661 
       
   662 	IMPORT_C virtual void KeyPressed(TUint aKeyCode, TUint aModifiers);
       
   663 
       
   664 	// Override this and set the ECaptureCtrlC flag to get a callback for custom cleanup when ctrl-c is pressed
       
   665 	IMPORT_C virtual void CtrlCPressed();
   653 	};
   666 	};
   654 
   667 
   655 class CCommandBase : public CActive
   668 class CCommandBase : public CActive
   656 	{
   669 	{
   657 public:
   670 public:
   659 		{
   672 		{
   660 		EManualComplete			= 0x00000001,
   673 		EManualComplete			= 0x00000001,
   661 		ESharableIoSession		= 0x00000002,
   674 		ESharableIoSession		= 0x00000002,
   662 		EReportAllErrors		= 0x00000004,
   675 		EReportAllErrors		= 0x00000004,
   663 		ENotifyStdinChanges		= 0x00000008,
   676 		ENotifyStdinChanges		= 0x00000008,
   664 		//EDeprecated			= 0x00000010,
   677 		ENotifyKeypresses		= 0x00000010,
   665 		ECompleteOnRunL			= 0x00000020,
   678 		ECompleteOnRunL			= 0x00000020, // Implies EManualComplete
       
   679 		ECaptureCtrlC			= 0x00000040, // Implies ENotifyKeypresses
   666 		};
   680 		};
   667 public:
   681 public:
   668 	IMPORT_C ~CCommandBase();
   682 	IMPORT_C ~CCommandBase();
   669 	IMPORT_C void RunCommandL();
   683 	IMPORT_C void RunCommandL();
   670 	IMPORT_C void RunCommandL(const TDesC* aCommandLine, CEnvironment* aEnv);
   684 	IMPORT_C void RunCommandL(const TDesC* aCommandLine, CEnvironment* aEnv);
   686 	IMPORT_C void CompleteAsync(TInt aError);
   700 	IMPORT_C void CompleteAsync(TInt aError);
   687 	IMPORT_C void CompleteAsync(TInt aError, TRefByValue<const TDesC> aFmt, ...);
   701 	IMPORT_C void CompleteAsync(TInt aError, TRefByValue<const TDesC> aFmt, ...);
   688 	IMPORT_C CEnvironment& Env();
   702 	IMPORT_C CEnvironment& Env();
   689 	IMPORT_C const CEnvironment& Env() const;
   703 	IMPORT_C const CEnvironment& Env() const;
   690 	IMPORT_C void ReadL(TDes& aData);
   704 	IMPORT_C void ReadL(TDes& aData);
       
   705 	IMPORT_C TUint ReadKey();
   691 	IMPORT_C void Write(const TDesC& aData);
   706 	IMPORT_C void Write(const TDesC& aData);
   692 	IMPORT_C void Printf(TRefByValue<const TDesC> aFmt, ...);
   707 	IMPORT_C void Printf(TRefByValue<const TDesC> aFmt, ...);
   693 	IMPORT_C void Printf(TRefByValue<const TDesC8> aFmt, ...);
   708 	IMPORT_C void Printf(TRefByValue<const TDesC8> aFmt, ...);
   694 	IMPORT_C void PrintError(TInt aError, TRefByValue<const TDesC> aFmt, ...);
   709 	IMPORT_C void PrintError(TInt aError, TRefByValue<const TDesC> aFmt, ...);
   695 	IMPORT_C void PrintWarning(TRefByValue<const TDesC> aFmt, ...);
   710 	IMPORT_C void PrintWarning(TRefByValue<const TDesC> aFmt, ...);
   806 	CCommandCompleter* iCompleter;
   821 	CCommandCompleter* iCompleter;
   807 	CReaderChangeNotifier* iReadChangeNotifier;
   822 	CReaderChangeNotifier* iReadChangeNotifier;
   808 	TInt iCompletionReason;
   823 	TInt iCompletionReason;
   809 	CCommandInfoFile* iCif;
   824 	CCommandInfoFile* iCif;
   810 	MCommandExtensionsV1* iExtension;
   825 	MCommandExtensionsV1* iExtension;
       
   826 	CKeypressWatcher* iKeypressWatcher;
   811 	void* iSpare1;
   827 	void* iSpare1;
   812 	void* iSpare2;
   828 	void* iSpare2;
   813 	void* iSpare3;
   829 	void* iSpare3;
   814 	void* iSpare4;
       
   815 	};
   830 	};
   816 
   831 
   817 
   832 
   818 /**
   833 /**
   819  * @brief A helper class for creating and running child processes that share 
   834  * @brief A helper class for creating and running child processes that share