williamr@2: /* williamr@2: * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #if !defined(__EIKCONSO_H__) williamr@2: #define __EIKCONSO_H__ williamr@2: williamr@2: #if !defined(__E32CONS_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__EIKSBOBS_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__EIKSBFRM_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #include williamr@2: williamr@2: #define ATT_DOUBLEWIDTH 0x60 williamr@2: #define ATT_DOUBLETOP 0x20 williamr@2: #define ATT_DOUBLEBOTTOM 0x40 williamr@2: //////////////////////////////////////////// williamr@2: #define ATT_ITALIC 0x08 williamr@2: #define ATT_INVERSE 0x04 williamr@2: #define ATT_UNDERLINE 0x02 williamr@2: #define ATT_BOLD 0x01 williamr@2: //////////////////////////////////////////// williamr@2: #define ATT_COLORMASK 0x80 // &x!=0 : color williamr@2: #define ATT_DOUBLEMASK 0x60 // &x : only the bits relevant for doublewidth/doubleheight williamr@2: #define ATT_RIGHTMASK 0x10 // |x to set RIGHT indicator williamr@2: #define ATT_IGNORE_RIGHTLEFT 0xEF // &x to clear the RIGHT/LEFT flag williamr@2: #define ATT_IGNORE_INVERSE 0xFB // &x to clear the INVERSE flag williamr@2: //////////////////////////////////////////// williamr@2: #define ATT_MAXVALUE 0xFF // all flags set (maximum value of attribute byte) williamr@2: #define ATT_NORMAL 0 // the default character attribute williamr@2: williamr@2: enum TEikConsWinUnits williamr@2: { williamr@2: EEikConsWinInPixels, williamr@2: EEikConsWinInChars williamr@2: }; williamr@2: williamr@2: williamr@2: /** CEikConsoleScreen() williamr@2: williamr@2: @param aBuffer String that needs to be clipped. will be modified by this call williamr@2: @param aFont Font used in the code williamr@2: @param aMaxWidthInPixels Maximum length of text that will not be clipped. williamr@2: @param aDir Where is the text clipped from. EDoNotClip, EClipFromEnd, EClipFromBeginning. williamr@2: @param aClipWidth The length of the text after clipping. KDefaultClipWidth will make it use aMaxWidthInPixels. williamr@2: @param aClipString The representation of three dots. (not really used anywhere - use the default value always or "") williamr@2: williamr@2: returns true if the text was clipped and 3 dots were added. williamr@2: */ williamr@2: class CEikConsoleControl; williamr@2: class CEikConsoleScreen : public CConsoleBase williamr@2: { williamr@2: public: williamr@2: enum TEikConsoleFlags williamr@2: { williamr@2: EUseBackedUpWindow =0x1, williamr@2: ENoInitialCursor =0x2 williamr@2: }; williamr@2: public: williamr@2: /** williamr@2: * CEikConsoleScreen() constructor williamr@2: */ williamr@2: IMPORT_C CEikConsoleScreen(); williamr@2: /** williamr@2: * CEikConsoleScreen() destructor williamr@2: */ williamr@2: IMPORT_C ~CEikConsoleScreen(); williamr@2: williamr@2: /** Create() Creates a console and sets title and size williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: * @param aSize Size of the console in pixels williamr@2: * williamr@2: * returns error code williamr@2: */ williamr@2: IMPORT_C TInt Create(const TDesC& aTitle,TSize aSize); williamr@2: /** Read() williamr@2: * Not implemented williamr@2: */ williamr@2: IMPORT_C void Read(TRequestStatus& aStatus); williamr@2: /** ReadCancel() williamr@2: * Not implemented williamr@2: */ williamr@2: IMPORT_C void ReadCancel(); williamr@2: /** KeyCode() williamr@2: * Not implemented williamr@2: */ williamr@2: IMPORT_C TKeyCode KeyCode() const; williamr@2: /** KeyModifiers() williamr@2: * Not implemented williamr@2: */ williamr@2: IMPORT_C TUint KeyModifiers() const; williamr@2: /** ConstructL() Constructs a console and sets title williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor williamr@2: */ williamr@2: IMPORT_C void ConstructL(const TDesC &aTitle,TInt aFlags);// use full screen williamr@2: /** ConstructL() Constructs a console and sets title and size williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: * @param aSize Size of the console in pixels williamr@2: * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor williamr@2: * @param aUnit Unit of the console williamr@2: */ williamr@2: IMPORT_C void ConstructL(const TDesC &aTitle,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars); // place the screen at TPoint(0,0) williamr@2: /** ConstructL() Constructs a console and sets title and position and size williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: * @param aTopLeft TopLeft corner of the console window williamr@2: * @param aSize Size of the console in pixels williamr@2: * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor williamr@2: * @param aUnit Unit of the console williamr@2: */ williamr@2: IMPORT_C void ConstructL(const TDesC &aTitle,TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars); williamr@2: /** SetConsWin() Sets console window williamr@2: * williamr@2: * @param aConsWin Console control williamr@2: */ williamr@2: IMPORT_C void SetConsWin(CEikConsoleControl *aConsWin); // use if you don't want WHOLE screen williamr@2: /** ConsoleControl() fetching console control williamr@2: * williamr@2: * Returns console control williamr@2: */ williamr@2: inline CEikConsoleControl* ConsoleControl() const {return iConsoleControl;}; williamr@2: williamr@2: /** SetTitle() Set title of the console williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: */ williamr@2: IMPORT_C void SetTitle(const TDesC &aTitle); williamr@2: /** SetTitle() Set title of the console williamr@2: * williamr@2: * @param aTitle Title of the console williamr@2: */ williamr@2: IMPORT_C void SetTitleL(const TDesC &aTitle); williamr@2: /** Title() Gets title of the console williamr@2: * williamr@2: * returns Title of the console williamr@2: */ williamr@2: inline HBufC *Title() const {return iConsoleTitle;}; williamr@2: williamr@2: /** ScreenSize() Gets size of the screen williamr@2: * williamr@2: * returns Size of the screen in pixels williamr@2: */ williamr@2: IMPORT_C TSize ScreenSize() const; williamr@2: /** FlushChars() Updates the character buffers williamr@2: */ williamr@2: IMPORT_C void FlushChars(); //new williamr@2: /** CursorPos() Cursor position getter williamr@2: * returns cursor position williamr@2: */ williamr@2: IMPORT_C TPoint CursorPos() const; williamr@2: /** SetCursorPosAbs Moving cursor to absolute position williamr@2: * williamr@2: * @param aPoint Position in absolute coordinates williamr@2: */ williamr@2: IMPORT_C void SetCursorPosAbs(const TPoint &aPoint); williamr@2: /** SetCursorPosRel Moving cursor to relative position williamr@2: * williamr@2: * @param aPoint Position in relative coordinates williamr@2: */ williamr@2: IMPORT_C void SetCursorPosRel(const TPoint &aPoint); williamr@2: /** SetCursorHeight changes cursor height williamr@2: * williamr@2: * @param aPercentage Cursor height relative to character height williamr@2: */ williamr@2: IMPORT_C void SetCursorHeight(TInt aPercentage); williamr@2: /** Write() Writes text to the console williamr@2: * williamr@2: * @param aDes Text to be written to the console williamr@2: */ williamr@2: IMPORT_C void Write(const TDesC &aDes); williamr@2: /** ClearScreen() Clears the console screen williamr@2: * williamr@2: */ williamr@2: IMPORT_C void ClearScreen(); williamr@2: /** ClearToEndOfLine() Clears from cursor position to end of the line williamr@2: * williamr@2: */ williamr@2: IMPORT_C void ClearToEndOfLine(); williamr@2: /** ClearChars() Clears characters within rectangle matching attributes williamr@2: * williamr@2: * @param aRect Rectangle in pixels williamr@2: * @param aCharacterAttributes Matching character attributes williamr@2: */ williamr@2: IMPORT_C void ClearChars(const TRect &aRect,TUint aCharacterAttributes); williamr@2: /** HideCursor() Hides cursor williamr@2: * williamr@2: * @return nonzero if cursor was not visible williamr@2: */ williamr@2: IMPORT_C TInt HideCursor(); // returns nonzero if cursor wasn't visible williamr@2: /** DrawCursor() Draws cursor williamr@2: */ williamr@2: IMPORT_C void DrawCursor(); williamr@2: /** DrawInSight Moves topleft corner williamr@2: * williamr@2: * @param aPosition New position for insight williamr@2: */ williamr@2: IMPORT_C void DrawInSight(TPoint aPosition); williamr@2: /** DrawCursorInSight() Draws cursor and insight williamr@2: */ williamr@2: IMPORT_C void DrawCursorInSight(); williamr@2: williamr@2: /** Move cursor up williamr@2: * @param aCount Number of steps to move williamr@2: */ williamr@2: IMPORT_C void Up(TUint aCount=1); williamr@2: /** Move cursor down williamr@2: * @param aCount Number of steps to move williamr@2: */ williamr@2: IMPORT_C void Down(TUint aCount=1); williamr@2: /** Move cursor right williamr@2: * @param aCount Number of steps to move williamr@2: */ williamr@2: IMPORT_C void Right(TUint aCount=1); williamr@2: /** Move cursor left williamr@2: * @param aCount Number of steps to move williamr@2: */ williamr@2: IMPORT_C void Left(TUint aCount=1); williamr@2: /** Insert a CR williamr@2: */ williamr@2: IMPORT_C void Cr(); williamr@2: /** Insert a linefeed williamr@2: */ williamr@2: IMPORT_C void Lf(); williamr@2: /** Scroll characters williamr@2: * @param anArea Area to scroll williamr@2: * @param aVector How much to scroll williamr@2: */ williamr@2: IMPORT_C void ScrollChars(const TRect &anArea,const TPoint &aVector); williamr@2: williamr@2: /** Redraw a rectangle williamr@2: * @param aRect Rectangle to redraw williamr@2: */ williamr@2: IMPORT_C void Redraw(const TRect &aRect); // called by CEikConsoleControl williamr@2: /** Moves topleft williamr@2: * @param aVector new position of topleft williamr@2: */ williamr@2: IMPORT_C void MoveTopLeft(TPoint aVector); // called by CEikConsoleControl williamr@2: williamr@2: /** Size of the history williamr@2: * @return lines stored for history buffer williamr@2: */ williamr@2: inline TUint HistorySize() const {return iNoChrExtra;}; // lines ACTUALLY stored williamr@2: /** Set history buffer size williamr@2: * @param aMaxChrExtra lines allocated for history williamr@2: * @param aMaxAttExtra attributed lines allocated for history williamr@2: */ williamr@2: IMPORT_C void SetHistorySizeL(TUint aMaxChrExtra,TUint aMaxAttExtra); // lines of back-scroll history resp. lines of ATTRIBUTED backscroll history (aMaxAttExtra<=aMaxChrExtra) williamr@2: williamr@2: /** Att() Attributes williamr@2: * @returns attributes williamr@2: */ williamr@2: inline TUint Att() const {return iAtt;}; williamr@2: williamr@2: /** Set attributes williamr@2: * @param aCharacterAttributes Attributes for characters williamr@2: */ williamr@2: IMPORT_C void SetAtt(TUint aCharacterAttributes); williamr@2: /** Set attributes williamr@2: * @param aForegroundGray16 Grey16 attributes for foreground williamr@2: * @param aBackgroundGray16 Grey16 attribuets for background williamr@2: */ williamr@2: IMPORT_C void SetAtt(TUint aForegroundGray16,TUint aBackgroundGray16); williamr@2: williamr@2: /** SetFontL() Sets the font for console williamr@2: * @param aFontDesc font specification williamr@2: */ williamr@2: IMPORT_C void SetFontL(const TFontSpec &aFontDesc); williamr@2: /** Font() Gets the used font williamr@2: * @returns font specification williamr@2: */ williamr@2: IMPORT_C const TFontSpec& Font() const; williamr@2: williamr@2: /** SetSelection() Sets the selection position williamr@2: * @param aRange range of the selection williamr@2: */ williamr@2: IMPORT_C void SetSelection(const TRect &aRange); williamr@2: /** SelectCursor() Sets empty selection starting and ending at cursor position williamr@2: */ williamr@2: IMPORT_C void SelectCursor(); // empty selection starting and ending at cursor position williamr@2: /** Selection() Get selection position williamr@2: * @return selection position williamr@2: */ williamr@2: IMPORT_C TRect Selection(); williamr@2: /** RetrieveL() returns selected text williamr@2: * @param aRange selection williamr@2: * @return text in descriptor williamr@2: */ williamr@2: IMPORT_C HBufC *RetrieveL(const TRect &aRange); // returns selection in newly allocated buffer williamr@2: williamr@2: /** SetPureCRLF() sets pure flag williamr@2: * @param aFlag flags williamr@2: */ williamr@2: IMPORT_C void SetPureCRLF(TUint aFlag); williamr@2: /** SetAllPrintable() sets all printable flag williamr@2: * @param aFlag flags williamr@2: */ williamr@2: IMPORT_C void SetAllPrintable(TUint aFlag); williamr@2: /** SetScrollLock() sets scroll lock flag williamr@2: * @param aFlag flags williamr@2: */ williamr@2: IMPORT_C void SetScrollLock(TUint aFlag); williamr@2: /** SetKeepCursorInSight() sets cursor in sight flag williamr@2: * @param aFlag flags williamr@2: */ williamr@2: IMPORT_C void SetKeepCursorInSight(TUint aFlag); williamr@2: /** SetScrollBarVisibilityL() sets scrollbar visibility williamr@2: * @param aHBarVisibility horizontal scrollbar visibility williamr@2: * @param aVBarVisibility vertical scrollbar visibility williamr@2: */ williamr@2: IMPORT_C void SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility); williamr@2: /** UpdateScrollBars() updates scrollbars williamr@2: * williamr@2: */ williamr@2: IMPORT_C TBool UpdateScrollBars(); williamr@2: williamr@2: private: williamr@2: // high-level history manipulation williamr@2: void MemScrPut(const TDesC &aString,TPoint aPos,TUint8 aCharacterAttributes); williamr@2: void MemScrClr(const TRect &aRect,TUint8 aCharacterAttributes); williamr@2: void MemScrScrollUp(TUint aLines=1); williamr@2: void MemScrMove(TPoint anOldPt,TPoint aNewPt,TUint aLen); williamr@2: void MemScrScroll(const TRect &aRect,TPoint aVector); williamr@2: // low-level history access williamr@2: TPtr MemChrPtr(TPoint aPos,TUint aLen); williamr@2: TPtr8 MemAttPtr(TPoint aPos,TUint aLen); williamr@2: // console screen-to-visible window conversion williamr@2: TPoint ScrToVis(TPoint aPoint); williamr@2: TRect ScrToVis(const TRect &aRect); williamr@2: // recalculates iVisSize and iVisWin williamr@2: TBool RecalculateSize(); williamr@2: // calculate a TopLeft that would put aPosition in-sight williamr@2: TPoint GetAnInSightPosition(TPoint aPosition) const; williamr@2: // draw cursor or draw cursor in sight, depending on iKeepCursorInSight williamr@2: void DrawCursorWhereNeeded(); williamr@2: // smart cursor-clipping: clips cursor to within screen, but allows it to be past the last character williamr@2: void ClipCursor(); williamr@2: // redraw characters with doublewidth LEFT/RIGHT flag set depending on odd/even columns williamr@2: void RedrawChars(TInt anX,TInt anY,TInt aLength,TUint aCharacterAttributes); williamr@2: // routines needed for selection williamr@2: void InvertOverlap(TPoint aStart,TPoint aEnd,TPoint bStart,TPoint bEnd); williamr@2: void InvertRange(const TRect &aRect); williamr@2: williamr@2: private: williamr@2: CEikConsoleControl *iConsoleControl;// console window (handles redraw events) williamr@2: TSize iConsoleSize; // size of console in characters (e.g. 80x24) williamr@2: HBufC *iConsoleTitle; // console title williamr@2: TRect iSelection; // current selection williamr@2: TPoint iCursor; // current cursor position williamr@2: TUint iAtt; // current character attribute williamr@2: williamr@2: TInt iWriteNow; // if FALSE, Write()-calls can be buffered williamr@2: TBuf<256> iWriteBuffer; // the Write() buffer williamr@2: williamr@2: TInt iMaxChrExtra; // max nr of extra lines of characters stored williamr@2: TInt iNoChrExtra; // actual nr of extra lines of characters stored williamr@2: TInt iMaxAttExtra; // max nr of extra lines of character attributes stored williamr@2: TText *iChrBuf; // character history williamr@2: TUint8 *iAttBuf; // attribute history williamr@2: williamr@2: TPoint iTopLeft; // coordinates of top left corner of visual display williamr@2: TRect iVisWin; // RECT visible window williamr@2: TSize iVisSize; // SIZE visible window williamr@2: williamr@2: // settings williamr@2: TUint iPureCRLF; // FALSE by default. If TRUE, CR and LF are "pure" williamr@2: TUint iAllPrintable; // FALSE by default. If TRUE, even chars 0-31 are printed williamr@2: TUint iScrollLock; // FALSE by default. If TRUE, will not scroll at bottom line williamr@2: TUint iKeepCursorInSight; // TRUE by default. If FALSE, cursor may be offscreen after a Write() williamr@2: TUint iCursorBlinking; // TRUE if cursor should be visible (i.e. user WANTS it to be visible) williamr@2: williamr@2: TInt iConsFlags; williamr@2: }; williamr@2: williamr@2: class CEikConsoleControl : public CAknControl, public MEikScrollBarObserver williamr@2: { williamr@2: public: williamr@2: // constructors, destructors, initialization williamr@2: /** Constructor williamr@2: */ williamr@2: IMPORT_C CEikConsoleControl(); williamr@2: /** Destructor williamr@2: */ williamr@2: IMPORT_C ~CEikConsoleControl(); williamr@2: /* ConstructL() williamr@2: */ williamr@2: IMPORT_C void ConstructL(TInt aFlags); williamr@2: /* ConstructL() williamr@2: */ williamr@2: IMPORT_C void ConstructL(TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit); williamr@2: /** SetRedrawer williamr@2: * @param aConsole console screen williamr@2: */ williamr@2: IMPORT_C void SetRedrawer(CEikConsoleScreen *aConsole); williamr@2: williamr@2: // font stuff williamr@2: /** SetFontL() sets the console font williamr@2: * @param aFontSpec font specification williamr@2: * @param aFont font instance williamr@2: */ williamr@2: IMPORT_C void SetFontL(const TFontSpec &aFontSpec,const CFbsFont* aFont); // change to font aFontSpec williamr@2: /** Font() gets font specification williamr@2: */ williamr@2: inline const TFontSpec& Font() const {return iFontSpec;}; // returns current fontspec williamr@2: williamr@2: /** CharSize() gets character size williamr@2: */ williamr@2: inline const TSize& CharSize() const {return iCharSize;}; williamr@2: /** VisibibleSize() gets visible size williamr@2: * williamr@2: */ williamr@2: IMPORT_C TSize VisibleSize() const; // returns maximal visible nr of visible characters williamr@2: williamr@2: // cursor stuff williamr@2: /** SetCursorHeight() Sets cursor height williamr@2: * @param aPercentage value 0..100% williamr@2: */ williamr@2: IMPORT_C void SetCursorHeight(TUint aPercentage); // set cursor height (0-100%) williamr@2: /** DrawCursor Draws cursor at position williamr@2: * @param aPosition position williamr@2: */ williamr@2: IMPORT_C void DrawCursor(TPoint aPosition); // draw cursor at character position williamr@2: /** HideCursor hides cursor williamr@2: */ williamr@2: IMPORT_C void HideCursor(); // hide cursor williamr@2: williamr@2: // basic graphic functions williamr@2: /** DrawChars() draws characters williamr@2: * @param aString string to be drawn williamr@2: * @param aPosition position of the string williamr@2: * @param aCharacterAttributes attributes of the drawn string williamr@2: */ williamr@2: IMPORT_C void DrawChars(const TDesC &aString,const TPoint &aPosition,TUint aCharacterAttributes); // draw aString at character position aPosition using williamr@2: /** ClearChars() clears characters williamr@2: * @param anArea area to be cleared williamr@2: * @param aCharacterAttributes attributes of cleared characters williamr@2: */ williamr@2: IMPORT_C void ClearChars(const TRect &anArea,TUint aCharacterAttributes); // clear the character area williamr@2: /** InsertChars() inserts character area williamr@2: * @param anArea area to be inserted williamr@2: */ williamr@2: IMPORT_C void InvertChars(const TRect &anArea); // invert the character area williamr@2: /** ScrollChars scrolls character area williamr@2: * @param anArea area to be scrolled williamr@2: * @param aVector direction to be scrolled williamr@2: */ williamr@2: IMPORT_C void ScrollChars(const TRect &anArea,const TPoint &aVector); // scroll characters inside anArea by the given vector williamr@2: williamr@2: // scrollbar stuff williamr@2: /** sets scrollbar visibility williamr@2: * @param aHBarVisibility horizontal scrollbar visibility williamr@2: * @param aVBarVisibility vertical scrollbar visibility williamr@2: */ williamr@2: IMPORT_C TInt SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility); williamr@2: /** Updates scrollbar williamr@2: * @param aDataSize size of the data williamr@2: * @param aVisibleSize how much of the data is visible on the console williamr@2: * @param aPos position of the visible area relative to whole data williamr@2: * @return ETrue if as a result, the visible window has changed williamr@2: */ williamr@2: IMPORT_C TBool UpdateScrollbarsL(const TSize &aDataSize,const TSize& aVisibleSize,TPoint aPos); williamr@2: /** Handles scroll event williamr@2: * @param aScrollBar scrollbar to be used for the event williamr@2: * @param aEventType type of the event that happened williamr@2: */ williamr@2: IMPORT_C void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); williamr@2: /** Updates an area williamr@2: */ williamr@2: IMPORT_C void UpdateArea(); williamr@2: williamr@2: public: // from CCoeControl williamr@2: /** GetColorUseListL provides color use list for the control williamr@2: */ williamr@2: IMPORT_C virtual void GetColorUseListL(CArrayFix& aColorUseList) const; // not available before Release 005u williamr@2: /** HandleResourceChange handles several kinds of resource change events williamr@2: */ williamr@2: IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u williamr@2: /** HandlePointerEventL handles touch pointer events williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: // virtual williamr@2: // window stuff williamr@2: /** Draws the control williamr@2: */ williamr@2: IMPORT_C void Draw(const TRect& aRect) const; williamr@2: /** Size has changed williamr@2: */ williamr@2: IMPORT_C void SizeChanged(); williamr@2: /** Focus has changed williamr@2: */ williamr@2: IMPORT_C void FocusChanged(TDrawNow aDrawNow); williamr@2: /** Component controls count williamr@2: */ williamr@2: IMPORT_C virtual TInt CountComponentControls() const; williamr@2: /** Component controls williamr@2: */ williamr@2: IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const; williamr@2: /** Writes internal state williamr@2: */ williamr@2: IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: // virtual - Reserved from CCoeControl williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: private: williamr@2: TPoint CharsToPixels(TPoint aPoint); williamr@2: TRect CharsToPixels(const TRect &aRect); williamr@2: TRect PixelsToChars(const TRect &aRect); williamr@2: void ClearPixels(const TRect &anArea,TRgb aColor) const; williamr@2: williamr@2: void NextFontL(); williamr@2: void InterpretAttribute(TUint AnAtt); williamr@2: void InterpretColorBits(TUint aCharacterAttributes); williamr@2: inline CEikConsoleControl &M() const {return((CEikConsoleControl&)(*this));} williamr@2: void CreateScrollBarFrameLayout(TEikScrollBarFrameLayout& aLayout) const; williamr@2: void InitFontSpecL(); williamr@2: williamr@2: private: williamr@2: CEikConsoleScreen *iConsole; // the console that owns this window williamr@2: TRgb iBackGray16; // current background color williamr@2: TRgb iPenGray16; // current pen color for characters williamr@2: TUint iLastAtt; // last attribute, to see if we need to change the gc williamr@2: TUint iLastFontFlags; // last attribute, to see if we need to load another font williamr@2: williamr@2: TSize iCharSize; // size of a single character (in pixels) williamr@2: TSize iViewInPixels; // size of area available for characters (in pixels) williamr@2: TSize iViewInChars; // size of area available for characters (in characters) williamr@2: williamr@2: TTextCursor iTextCursor; // cursor to use williamr@2: TUint iCursorHeightPercentage; // required height of cursor (as a percentage) williamr@2: williamr@2: TInt iRedrawing; // NONZERO IF BUSY REDRAWING williamr@2: williamr@2: CEikScrollBarFrame* iSBFrame; williamr@2: CEikScrollBarFrame::TScrollBarVisibility iHBarVisibility; williamr@2: CEikScrollBarFrame::TScrollBarVisibility iVBarVisibility; williamr@2: TPoint iLastThumbPos; williamr@2: williamr@2: const CFont *iCurrentFont; // Current font williamr@2: TFontSpec iFontSpec; // Current font spec williamr@2: TFontUnderline iFontUnderline; // Current font spec underline williamr@2: TUint iFontHeight; // Height of current font when not doubleheight/doublewidth williamr@2: TUint iFontIsProportional; // nonzero if font is proportional williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: #endif