Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

terminalcontrol.h

00001 /*    terminalcontrol.h
00002  *
00003  * A terminal UI control class
00004  *
00005  * Copyright 2002 Petteri Kangaslampi
00006  *
00007  * See license.txt for full copyright and license information.
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     // Terminal size has been changed
00021     virtual void TerminalSizeChanged(TInt aWidth, TInt aHeight) = 0;
00022 
00023     // A key has been pressed
00024     virtual void KeyPressed(TKeyCode aCode, TUint aModifiers) = 0;
00025 
00026     // Force window repaint. The user must draw each line again with DrawText()
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     // CCoeControl methods
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; // font char dimensions in pixels
00124     MTerminalObserver *iObserver;
00125     TBool iInDraw;
00126     TBool iGrayed;
00127 };
00128 
00129 
00130 #endif

Generated on Sun Feb 9 13:01:29 2003 for PuTTY by doxygen1.2.18