00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __TERMINALCONTROL_H__
00011 #define __TERMINALCONTROL_H__
00012
00013 #include <e32std.h>
00014 #include <coecntrl.h>
00015
00016
00017 class MTerminalObserver {
00018
00019 public:
00020
00021 virtual void TerminalSizeChanged(TInt aWidth, TInt aHeight) = 0;
00022
00023
00024 virtual void KeyPressed(TKeyCode aCode, TUint aModifiers) = 0;
00025
00026
00027 virtual void RePaintWindow() = 0;
00028 };
00029
00030
00031 class CFont;
00032
00033
00039 class CTerminalControl : public CCoeControl {
00040
00041 public:
00047 CTerminalControl(MTerminalObserver *anObserver);
00048
00057 void ConstructL(const TRect &aRect, RWindow &aContainerWindow);
00058
00062 ~CTerminalControl();
00063
00080 virtual void DrawText(TInt aX, TInt aY, const TDesC &aText, TBool aBold,
00081 TBool aUnderline, TRgb aForeground,
00082 TRgb aBackground);
00083
00089 void SetFontL(TBool aLargeFont);
00090
00091
00099 void SetGrayed(TBool aGrayed);
00100
00101
00111
00112 virtual TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent,
00113 TEventCode aType);
00114 virtual void Draw(const TRect &aRect) const;
00115 virtual void SizeChanged();
00116 virtual TCoeInputCapabilities InputCapabilities() const;
00117
00118 private:
00119 void Resize();
00120
00121 CFont *iFont;
00122 CFont *iBoldFont;
00123 TInt iFontWidth, iFontHeight;
00124 MTerminalObserver *iObserver;
00125 TBool iInDraw;
00126 TBool iGrayed;
00127 };
00128
00129
00130 #endif