plugins/consoles/vt100cons/inc/vtc_base.h
changeset 0 7f656887cf89
child 28 169dfbeff8ee
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // vtc_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 __VT100CONS_BASE_H__
       
    14 #define __VT100CONS_BASE_H__
       
    15 
       
    16 #include <e32std.h>
       
    17 #include <e32cons.h>
       
    18 #include <fshell/settings.h>
       
    19 #include <fshell/vtc_controller.h>
       
    20 
       
    21 class CVtcConsoleBase : public CConsoleBase, public MConsoleOutput, public MConsoleInput
       
    22 	{
       
    23 public:
       
    24 	IMPORT_C virtual ~CVtcConsoleBase();
       
    25 	IMPORT_C virtual TInt Create(const TDesC& aTitle, TSize aSize);
       
    26 	IMPORT_C virtual void Read(TRequestStatus& aStatus);
       
    27 	IMPORT_C virtual void ReadCancel();
       
    28 	IMPORT_C virtual void Write(const TDesC& aDes);
       
    29 	IMPORT_C virtual TPoint CursorPos() const;
       
    30 	IMPORT_C virtual void SetCursorPosAbs(const TPoint& aPoint);
       
    31 	IMPORT_C virtual void SetCursorPosRel(const TPoint& aPoint);
       
    32 	IMPORT_C virtual void SetCursorHeight(TInt aPercentage);
       
    33 	IMPORT_C virtual void SetTitle(const TDesC& aTitle);
       
    34 	IMPORT_C virtual void ClearScreen();
       
    35 	IMPORT_C virtual void ClearToEndOfLine();
       
    36 	IMPORT_C virtual TSize ScreenSize() const;
       
    37 	IMPORT_C virtual TKeyCode KeyCode() const;
       
    38 	IMPORT_C virtual TUint KeyModifiers() const;
       
    39 	IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
       
    40 protected:
       
    41 	enum TVerbosity
       
    42 		{
       
    43 		EInformation,
       
    44 		EError,
       
    45 		EDebug,
       
    46 		};
       
    47 protected:
       
    48 	IMPORT_C void Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...);
       
    49 	IMPORT_C TBool Debug();
       
    50 	IMPORT_C void SetDebug(TBool aDebug);
       
    51 protected:
       
    52 	IMPORT_C CVtcConsoleBase();
       
    53 	IMPORT_C virtual void ConstructL(const TDesC& aTitle);
       
    54 	IMPORT_C static TInt ReadKeywordValuePair(TLex& aLex, TPtrC& aKeyword, TPtrC& aValue);
       
    55 
       
    56 private:
       
    57 	void DetectScreenSizeL(TSize& aSize);
       
    58 	TInt DoDetectScreenSize(TSize& aSize);
       
    59 	TInt ReadCursorPos(TPoint& aResult);
       
    60 private:
       
    61 	TKeyPress iKeyPress;
       
    62 	CVtConsoleOutputController* iOutputController;
       
    63 	CVtConsoleInputController* iInputController;
       
    64 	LtkUtils::CIniFile* iIniFile;
       
    65 	TInt iDebug;
       
    66 protected:
       
    67 	CConsoleBase* iUnderlyingConsole;
       
    68 	};
       
    69 
       
    70 
       
    71 #endif // __VT100CONS_BASE_H__