1.1 --- a/epoc32/include/mw/eikconso.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/eikconso.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,580 @@
1.4 -eikconso.h
1.5 +/*
1.6 +* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#if !defined(__EIKCONSO_H__)
1.24 +#define __EIKCONSO_H__
1.25 +
1.26 +#if !defined(__E32CONS_H__)
1.27 +#include <e32cons.h>
1.28 +#endif
1.29 +
1.30 +#if !defined(__EIKSBOBS_H__)
1.31 +#include <eiksbobs.h>
1.32 +#endif
1.33 +
1.34 +#if !defined(__EIKSBFRM_H__)
1.35 +#include <eiksbfrm.h>
1.36 +#endif
1.37 +
1.38 +#include <akncontrol.h>
1.39 +
1.40 +#define ATT_DOUBLEWIDTH 0x60
1.41 +#define ATT_DOUBLETOP 0x20
1.42 +#define ATT_DOUBLEBOTTOM 0x40
1.43 +////////////////////////////////////////////
1.44 +#define ATT_ITALIC 0x08
1.45 +#define ATT_INVERSE 0x04
1.46 +#define ATT_UNDERLINE 0x02
1.47 +#define ATT_BOLD 0x01
1.48 +////////////////////////////////////////////
1.49 +#define ATT_COLORMASK 0x80 // &x!=0 : color
1.50 +#define ATT_DOUBLEMASK 0x60 // &x : only the bits relevant for doublewidth/doubleheight
1.51 +#define ATT_RIGHTMASK 0x10 // |x to set RIGHT indicator
1.52 +#define ATT_IGNORE_RIGHTLEFT 0xEF // &x to clear the RIGHT/LEFT flag
1.53 +#define ATT_IGNORE_INVERSE 0xFB // &x to clear the INVERSE flag
1.54 +////////////////////////////////////////////
1.55 +#define ATT_MAXVALUE 0xFF // all flags set (maximum value of attribute byte)
1.56 +#define ATT_NORMAL 0 // the default character attribute
1.57 +
1.58 +enum TEikConsWinUnits
1.59 + {
1.60 + EEikConsWinInPixels,
1.61 + EEikConsWinInChars
1.62 + };
1.63 +
1.64 +
1.65 + /** CEikConsoleScreen()
1.66 +
1.67 + @param aBuffer String that needs to be clipped. will be modified by this call
1.68 + @param aFont Font used in the code
1.69 + @param aMaxWidthInPixels Maximum length of text that will not be clipped.
1.70 + @param aDir Where is the text clipped from. EDoNotClip, EClipFromEnd, EClipFromBeginning.
1.71 + @param aClipWidth The length of the text after clipping. KDefaultClipWidth will make it use aMaxWidthInPixels.
1.72 + @param aClipString The representation of three dots. (not really used anywhere - use the default value always or "")
1.73 +
1.74 + returns true if the text was clipped and 3 dots were added.
1.75 + */
1.76 +class CEikConsoleControl;
1.77 +class CEikConsoleScreen : public CConsoleBase
1.78 + {
1.79 +public:
1.80 + enum TEikConsoleFlags
1.81 + {
1.82 + EUseBackedUpWindow =0x1,
1.83 + ENoInitialCursor =0x2
1.84 + };
1.85 +public:
1.86 + /**
1.87 + * CEikConsoleScreen() constructor
1.88 + */
1.89 + IMPORT_C CEikConsoleScreen();
1.90 + /**
1.91 + * CEikConsoleScreen() destructor
1.92 + */
1.93 + IMPORT_C ~CEikConsoleScreen();
1.94 +
1.95 + /** Create() Creates a console and sets title and size
1.96 + *
1.97 + * @param aTitle Title of the console
1.98 + * @param aSize Size of the console in pixels
1.99 + *
1.100 + * returns error code
1.101 + */
1.102 + IMPORT_C TInt Create(const TDesC& aTitle,TSize aSize);
1.103 + /** Read()
1.104 + * Not implemented
1.105 + */
1.106 + IMPORT_C void Read(TRequestStatus& aStatus);
1.107 + /** ReadCancel()
1.108 + * Not implemented
1.109 + */
1.110 + IMPORT_C void ReadCancel();
1.111 + /** KeyCode()
1.112 + * Not implemented
1.113 + */
1.114 + IMPORT_C TKeyCode KeyCode() const;
1.115 + /** KeyModifiers()
1.116 + * Not implemented
1.117 + */
1.118 + IMPORT_C TUint KeyModifiers() const;
1.119 + /** ConstructL() Constructs a console and sets title
1.120 + *
1.121 + * @param aTitle Title of the console
1.122 + * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor
1.123 + */
1.124 + IMPORT_C void ConstructL(const TDesC &aTitle,TInt aFlags);// use full screen
1.125 + /** ConstructL() Constructs a console and sets title and size
1.126 + *
1.127 + * @param aTitle Title of the console
1.128 + * @param aSize Size of the console in pixels
1.129 + * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor
1.130 + * @param aUnit Unit of the console
1.131 + */
1.132 + IMPORT_C void ConstructL(const TDesC &aTitle,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars); // place the screen at TPoint(0,0)
1.133 + /** ConstructL() Constructs a console and sets title and position and size
1.134 + *
1.135 + * @param aTitle Title of the console
1.136 + * @param aTopLeft TopLeft corner of the console window
1.137 + * @param aSize Size of the console in pixels
1.138 + * @param aFlags Flags, for example EUseBackedUpWindow or ENoInitialCursor
1.139 + * @param aUnit Unit of the console
1.140 + */
1.141 + IMPORT_C void ConstructL(const TDesC &aTitle,TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars);
1.142 + /** SetConsWin() Sets console window
1.143 + *
1.144 + * @param aConsWin Console control
1.145 + */
1.146 + IMPORT_C void SetConsWin(CEikConsoleControl *aConsWin); // use if you don't want WHOLE screen
1.147 + /** ConsoleControl() fetching console control
1.148 + *
1.149 + * Returns console control
1.150 + */
1.151 + inline CEikConsoleControl* ConsoleControl() const {return iConsoleControl;};
1.152 +
1.153 + /** SetTitle() Set title of the console
1.154 + *
1.155 + * @param aTitle Title of the console
1.156 + */
1.157 + IMPORT_C void SetTitle(const TDesC &aTitle);
1.158 + /** SetTitle() Set title of the console
1.159 + *
1.160 + * @param aTitle Title of the console
1.161 + */
1.162 + IMPORT_C void SetTitleL(const TDesC &aTitle);
1.163 + /** Title() Gets title of the console
1.164 + *
1.165 + * returns Title of the console
1.166 + */
1.167 + inline HBufC *Title() const {return iConsoleTitle;};
1.168 +
1.169 + /** ScreenSize() Gets size of the screen
1.170 + *
1.171 + * returns Size of the screen in pixels
1.172 + */
1.173 + IMPORT_C TSize ScreenSize() const;
1.174 + /** FlushChars() Updates the character buffers
1.175 + */
1.176 + IMPORT_C void FlushChars(); //new
1.177 + /** CursorPos() Cursor position getter
1.178 + * returns cursor position
1.179 + */
1.180 + IMPORT_C TPoint CursorPos() const;
1.181 + /** SetCursorPosAbs Moving cursor to absolute position
1.182 + *
1.183 + * @param aPoint Position in absolute coordinates
1.184 + */
1.185 + IMPORT_C void SetCursorPosAbs(const TPoint &aPoint);
1.186 + /** SetCursorPosRel Moving cursor to relative position
1.187 + *
1.188 + * @param aPoint Position in relative coordinates
1.189 + */
1.190 + IMPORT_C void SetCursorPosRel(const TPoint &aPoint);
1.191 + /** SetCursorHeight changes cursor height
1.192 + *
1.193 + * @param aPercentage Cursor height relative to character height
1.194 + */
1.195 + IMPORT_C void SetCursorHeight(TInt aPercentage);
1.196 + /** Write() Writes text to the console
1.197 + *
1.198 + * @param aDes Text to be written to the console
1.199 + */
1.200 + IMPORT_C void Write(const TDesC &aDes);
1.201 + /** ClearScreen() Clears the console screen
1.202 + *
1.203 + */
1.204 + IMPORT_C void ClearScreen();
1.205 + /** ClearToEndOfLine() Clears from cursor position to end of the line
1.206 + *
1.207 + */
1.208 + IMPORT_C void ClearToEndOfLine();
1.209 + /** ClearChars() Clears characters within rectangle matching attributes
1.210 + *
1.211 + * @param aRect Rectangle in pixels
1.212 + * @param aCharacterAttributes Matching character attributes
1.213 + */
1.214 + IMPORT_C void ClearChars(const TRect &aRect,TUint aCharacterAttributes);
1.215 + /** HideCursor() Hides cursor
1.216 + *
1.217 + * @return nonzero if cursor was not visible
1.218 + */
1.219 + IMPORT_C TInt HideCursor(); // returns nonzero if cursor wasn't visible
1.220 + /** DrawCursor() Draws cursor
1.221 + */
1.222 + IMPORT_C void DrawCursor();
1.223 + /** DrawInSight Moves topleft corner
1.224 + *
1.225 + * @param aPosition New position for insight
1.226 + */
1.227 + IMPORT_C void DrawInSight(TPoint aPosition);
1.228 + /** DrawCursorInSight() Draws cursor and insight
1.229 + */
1.230 + IMPORT_C void DrawCursorInSight();
1.231 +
1.232 + /** Move cursor up
1.233 + * @param aCount Number of steps to move
1.234 + */
1.235 + IMPORT_C void Up(TUint aCount=1);
1.236 + /** Move cursor down
1.237 + * @param aCount Number of steps to move
1.238 + */
1.239 + IMPORT_C void Down(TUint aCount=1);
1.240 + /** Move cursor right
1.241 + * @param aCount Number of steps to move
1.242 + */
1.243 + IMPORT_C void Right(TUint aCount=1);
1.244 + /** Move cursor left
1.245 + * @param aCount Number of steps to move
1.246 + */
1.247 + IMPORT_C void Left(TUint aCount=1);
1.248 + /** Insert a CR
1.249 + */
1.250 + IMPORT_C void Cr();
1.251 + /** Insert a linefeed
1.252 + */
1.253 + IMPORT_C void Lf();
1.254 + /** Scroll characters
1.255 + * @param anArea Area to scroll
1.256 + * @param aVector How much to scroll
1.257 + */
1.258 + IMPORT_C void ScrollChars(const TRect &anArea,const TPoint &aVector);
1.259 +
1.260 + /** Redraw a rectangle
1.261 + * @param aRect Rectangle to redraw
1.262 + */
1.263 + IMPORT_C void Redraw(const TRect &aRect); // called by CEikConsoleControl
1.264 + /** Moves topleft
1.265 + * @param aVector new position of topleft
1.266 + */
1.267 + IMPORT_C void MoveTopLeft(TPoint aVector); // called by CEikConsoleControl
1.268 +
1.269 + /** Size of the history
1.270 + * @return lines stored for history buffer
1.271 + */
1.272 + inline TUint HistorySize() const {return iNoChrExtra;}; // lines ACTUALLY stored
1.273 + /** Set history buffer size
1.274 + * @param aMaxChrExtra lines allocated for history
1.275 + * @param aMaxAttExtra attributed lines allocated for history
1.276 + */
1.277 + IMPORT_C void SetHistorySizeL(TUint aMaxChrExtra,TUint aMaxAttExtra); // lines of back-scroll history resp. lines of ATTRIBUTED backscroll history (aMaxAttExtra<=aMaxChrExtra)
1.278 +
1.279 + /** Att() Attributes
1.280 + * @returns attributes
1.281 + */
1.282 + inline TUint Att() const {return iAtt;};
1.283 +
1.284 + /** Set attributes
1.285 + * @param aCharacterAttributes Attributes for characters
1.286 + */
1.287 + IMPORT_C void SetAtt(TUint aCharacterAttributes);
1.288 + /** Set attributes
1.289 + * @param aForegroundGray16 Grey16 attributes for foreground
1.290 + * @param aBackgroundGray16 Grey16 attribuets for background
1.291 + */
1.292 + IMPORT_C void SetAtt(TUint aForegroundGray16,TUint aBackgroundGray16);
1.293 +
1.294 + /** SetFontL() Sets the font for console
1.295 + * @param aFontDesc font specification
1.296 + */
1.297 + IMPORT_C void SetFontL(const TFontSpec &aFontDesc);
1.298 + /** Font() Gets the used font
1.299 + * @returns font specification
1.300 + */
1.301 + IMPORT_C const TFontSpec& Font() const;
1.302 +
1.303 + /** SetSelection() Sets the selection position
1.304 + * @param aRange range of the selection
1.305 + */
1.306 + IMPORT_C void SetSelection(const TRect &aRange);
1.307 + /** SelectCursor() Sets empty selection starting and ending at cursor position
1.308 + */
1.309 + IMPORT_C void SelectCursor(); // empty selection starting and ending at cursor position
1.310 + /** Selection() Get selection position
1.311 + * @return selection position
1.312 + */
1.313 + IMPORT_C TRect Selection();
1.314 + /** RetrieveL() returns selected text
1.315 + * @param aRange selection
1.316 + * @return text in descriptor
1.317 + */
1.318 + IMPORT_C HBufC *RetrieveL(const TRect &aRange); // returns selection in newly allocated buffer
1.319 +
1.320 + /** SetPureCRLF() sets pure flag
1.321 + * @param aFlag flags
1.322 + */
1.323 + IMPORT_C void SetPureCRLF(TUint aFlag);
1.324 + /** SetAllPrintable() sets all printable flag
1.325 + * @param aFlag flags
1.326 + */
1.327 + IMPORT_C void SetAllPrintable(TUint aFlag);
1.328 + /** SetScrollLock() sets scroll lock flag
1.329 + * @param aFlag flags
1.330 + */
1.331 + IMPORT_C void SetScrollLock(TUint aFlag);
1.332 + /** SetKeepCursorInSight() sets cursor in sight flag
1.333 + * @param aFlag flags
1.334 + */
1.335 + IMPORT_C void SetKeepCursorInSight(TUint aFlag);
1.336 + /** SetScrollBarVisibilityL() sets scrollbar visibility
1.337 + * @param aHBarVisibility horizontal scrollbar visibility
1.338 + * @param aVBarVisibility vertical scrollbar visibility
1.339 + */
1.340 + IMPORT_C void SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility);
1.341 + /** UpdateScrollBars() updates scrollbars
1.342 + *
1.343 + */
1.344 + IMPORT_C TBool UpdateScrollBars();
1.345 +
1.346 +private:
1.347 + // high-level history manipulation
1.348 + void MemScrPut(const TDesC &aString,TPoint aPos,TUint8 aCharacterAttributes);
1.349 + void MemScrClr(const TRect &aRect,TUint8 aCharacterAttributes);
1.350 + void MemScrScrollUp(TUint aLines=1);
1.351 + void MemScrMove(TPoint anOldPt,TPoint aNewPt,TUint aLen);
1.352 + void MemScrScroll(const TRect &aRect,TPoint aVector);
1.353 + // low-level history access
1.354 + TPtr MemChrPtr(TPoint aPos,TUint aLen);
1.355 + TPtr8 MemAttPtr(TPoint aPos,TUint aLen);
1.356 + // console screen-to-visible window conversion
1.357 + TPoint ScrToVis(TPoint aPoint);
1.358 + TRect ScrToVis(const TRect &aRect);
1.359 + // recalculates iVisSize and iVisWin
1.360 + TBool RecalculateSize();
1.361 + // calculate a TopLeft that would put aPosition in-sight
1.362 + TPoint GetAnInSightPosition(TPoint aPosition) const;
1.363 + // draw cursor or draw cursor in sight, depending on iKeepCursorInSight
1.364 + void DrawCursorWhereNeeded();
1.365 + // smart cursor-clipping: clips cursor to within screen, but allows it to be past the last character
1.366 + void ClipCursor();
1.367 + // redraw characters with doublewidth LEFT/RIGHT flag set depending on odd/even columns
1.368 + void RedrawChars(TInt anX,TInt anY,TInt aLength,TUint aCharacterAttributes);
1.369 + // routines needed for selection
1.370 + void InvertOverlap(TPoint aStart,TPoint aEnd,TPoint bStart,TPoint bEnd);
1.371 + void InvertRange(const TRect &aRect);
1.372 +
1.373 +private:
1.374 + CEikConsoleControl *iConsoleControl;// console window (handles redraw events)
1.375 + TSize iConsoleSize; // size of console in characters (e.g. 80x24)
1.376 + HBufC *iConsoleTitle; // console title
1.377 + TRect iSelection; // current selection
1.378 + TPoint iCursor; // current cursor position
1.379 + TUint iAtt; // current character attribute
1.380 +
1.381 + TInt iWriteNow; // if FALSE, Write()-calls can be buffered
1.382 + TBuf<256> iWriteBuffer; // the Write() buffer
1.383 +
1.384 + TInt iMaxChrExtra; // max nr of extra lines of characters stored
1.385 + TInt iNoChrExtra; // actual nr of extra lines of characters stored
1.386 + TInt iMaxAttExtra; // max nr of extra lines of character attributes stored
1.387 + TText *iChrBuf; // character history
1.388 + TUint8 *iAttBuf; // attribute history
1.389 +
1.390 + TPoint iTopLeft; // coordinates of top left corner of visual display
1.391 + TRect iVisWin; // RECT visible window
1.392 + TSize iVisSize; // SIZE visible window
1.393 +
1.394 + // settings
1.395 + TUint iPureCRLF; // FALSE by default. If TRUE, CR and LF are "pure"
1.396 + TUint iAllPrintable; // FALSE by default. If TRUE, even chars 0-31 are printed
1.397 + TUint iScrollLock; // FALSE by default. If TRUE, will not scroll at bottom line
1.398 + TUint iKeepCursorInSight; // TRUE by default. If FALSE, cursor may be offscreen after a Write()
1.399 + TUint iCursorBlinking; // TRUE if cursor should be visible (i.e. user WANTS it to be visible)
1.400 +
1.401 + TInt iConsFlags;
1.402 + };
1.403 +
1.404 +class CEikConsoleControl : public CAknControl, public MEikScrollBarObserver
1.405 + {
1.406 +public:
1.407 + // constructors, destructors, initialization
1.408 + /** Constructor
1.409 + */
1.410 + IMPORT_C CEikConsoleControl();
1.411 + /** Destructor
1.412 + */
1.413 + IMPORT_C ~CEikConsoleControl();
1.414 + /* ConstructL()
1.415 + */
1.416 + IMPORT_C void ConstructL(TInt aFlags);
1.417 + /* ConstructL()
1.418 + */
1.419 + IMPORT_C void ConstructL(TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit);
1.420 + /** SetRedrawer
1.421 + * @param aConsole console screen
1.422 + */
1.423 + IMPORT_C void SetRedrawer(CEikConsoleScreen *aConsole);
1.424 +
1.425 + // font stuff
1.426 + /** SetFontL() sets the console font
1.427 + * @param aFontSpec font specification
1.428 + * @param aFont font instance
1.429 + */
1.430 + IMPORT_C void SetFontL(const TFontSpec &aFontSpec,const CFbsFont* aFont); // change to font aFontSpec
1.431 + /** Font() gets font specification
1.432 + */
1.433 + inline const TFontSpec& Font() const {return iFontSpec;}; // returns current fontspec
1.434 +
1.435 + /** CharSize() gets character size
1.436 + */
1.437 + inline const TSize& CharSize() const {return iCharSize;};
1.438 + /** VisibibleSize() gets visible size
1.439 + *
1.440 + */
1.441 + IMPORT_C TSize VisibleSize() const; // returns maximal visible nr of visible characters
1.442 +
1.443 + // cursor stuff
1.444 + /** SetCursorHeight() Sets cursor height
1.445 + * @param aPercentage value 0..100%
1.446 + */
1.447 + IMPORT_C void SetCursorHeight(TUint aPercentage); // set cursor height (0-100%)
1.448 + /** DrawCursor Draws cursor at position
1.449 + * @param aPosition position
1.450 + */
1.451 + IMPORT_C void DrawCursor(TPoint aPosition); // draw cursor at character position
1.452 + /** HideCursor hides cursor
1.453 + */
1.454 + IMPORT_C void HideCursor(); // hide cursor
1.455 +
1.456 + // basic graphic functions
1.457 + /** DrawChars() draws characters
1.458 + * @param aString string to be drawn
1.459 + * @param aPosition position of the string
1.460 + * @param aCharacterAttributes attributes of the drawn string
1.461 + */
1.462 + IMPORT_C void DrawChars(const TDesC &aString,const TPoint &aPosition,TUint aCharacterAttributes); // draw aString at character position aPosition using
1.463 + /** ClearChars() clears characters
1.464 + * @param anArea area to be cleared
1.465 + * @param aCharacterAttributes attributes of cleared characters
1.466 + */
1.467 + IMPORT_C void ClearChars(const TRect &anArea,TUint aCharacterAttributes); // clear the character area
1.468 + /** InsertChars() inserts character area
1.469 + * @param anArea area to be inserted
1.470 + */
1.471 + IMPORT_C void InvertChars(const TRect &anArea); // invert the character area
1.472 + /** ScrollChars scrolls character area
1.473 + * @param anArea area to be scrolled
1.474 + * @param aVector direction to be scrolled
1.475 + */
1.476 + IMPORT_C void ScrollChars(const TRect &anArea,const TPoint &aVector); // scroll characters inside anArea by the given vector
1.477 +
1.478 + // scrollbar stuff
1.479 + /** sets scrollbar visibility
1.480 + * @param aHBarVisibility horizontal scrollbar visibility
1.481 + * @param aVBarVisibility vertical scrollbar visibility
1.482 + */
1.483 + IMPORT_C TInt SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility);
1.484 + /** Updates scrollbar
1.485 + * @param aDataSize size of the data
1.486 + * @param aVisibleSize how much of the data is visible on the console
1.487 + * @param aPos position of the visible area relative to whole data
1.488 + * @return ETrue if as a result, the visible window has changed
1.489 + */
1.490 + IMPORT_C TBool UpdateScrollbarsL(const TSize &aDataSize,const TSize& aVisibleSize,TPoint aPos);
1.491 + /** Handles scroll event
1.492 + * @param aScrollBar scrollbar to be used for the event
1.493 + * @param aEventType type of the event that happened
1.494 + */
1.495 + IMPORT_C void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType);
1.496 + /** Updates an area
1.497 + */
1.498 + IMPORT_C void UpdateArea();
1.499 +
1.500 +public: // from CCoeControl
1.501 + /** GetColorUseListL provides color use list for the control
1.502 + */
1.503 + IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
1.504 + /** HandleResourceChange handles several kinds of resource change events
1.505 + */
1.506 + IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u
1.507 + /** HandlePointerEventL handles touch pointer events
1.508 + */
1.509 + IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1.510 +
1.511 +protected: // virtual
1.512 + // window stuff
1.513 + /** Draws the control
1.514 + */
1.515 + IMPORT_C void Draw(const TRect& aRect) const;
1.516 + /** Size has changed
1.517 + */
1.518 + IMPORT_C void SizeChanged();
1.519 + /** Focus has changed
1.520 + */
1.521 + IMPORT_C void FocusChanged(TDrawNow aDrawNow);
1.522 + /** Component controls count
1.523 + */
1.524 + IMPORT_C virtual TInt CountComponentControls() const;
1.525 + /** Component controls
1.526 + */
1.527 + IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
1.528 + /** Writes internal state
1.529 + */
1.530 + IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
1.531 +
1.532 +private: // virtual - Reserved from CCoeControl
1.533 + IMPORT_C virtual void Reserved_2();
1.534 +
1.535 +private:
1.536 + /**
1.537 + * From CAknControl
1.538 + */
1.539 + IMPORT_C void* ExtensionInterface( TUid aInterface );
1.540 +
1.541 +private:
1.542 + TPoint CharsToPixels(TPoint aPoint);
1.543 + TRect CharsToPixels(const TRect &aRect);
1.544 + TRect PixelsToChars(const TRect &aRect);
1.545 + void ClearPixels(const TRect &anArea,TRgb aColor) const;
1.546 +
1.547 + void NextFontL();
1.548 + void InterpretAttribute(TUint AnAtt);
1.549 + void InterpretColorBits(TUint aCharacterAttributes);
1.550 + inline CEikConsoleControl &M() const {return((CEikConsoleControl&)(*this));}
1.551 + void CreateScrollBarFrameLayout(TEikScrollBarFrameLayout& aLayout) const;
1.552 + void InitFontSpecL();
1.553 +
1.554 +private:
1.555 + CEikConsoleScreen *iConsole; // the console that owns this window
1.556 + TRgb iBackGray16; // current background color
1.557 + TRgb iPenGray16; // current pen color for characters
1.558 + TUint iLastAtt; // last attribute, to see if we need to change the gc
1.559 + TUint iLastFontFlags; // last attribute, to see if we need to load another font
1.560 +
1.561 + TSize iCharSize; // size of a single character (in pixels)
1.562 + TSize iViewInPixels; // size of area available for characters (in pixels)
1.563 + TSize iViewInChars; // size of area available for characters (in characters)
1.564 +
1.565 + TTextCursor iTextCursor; // cursor to use
1.566 + TUint iCursorHeightPercentage; // required height of cursor (as a percentage)
1.567 +
1.568 + TInt iRedrawing; // NONZERO IF BUSY REDRAWING
1.569 +
1.570 + CEikScrollBarFrame* iSBFrame;
1.571 + CEikScrollBarFrame::TScrollBarVisibility iHBarVisibility;
1.572 + CEikScrollBarFrame::TScrollBarVisibility iVBarVisibility;
1.573 + TPoint iLastThumbPos;
1.574 +
1.575 + const CFont *iCurrentFont; // Current font
1.576 + TFontSpec iFontSpec; // Current font spec
1.577 + TFontUnderline iFontUnderline; // Current font spec underline
1.578 + TUint iFontHeight; // Height of current font when not doubleheight/doublewidth
1.579 + TUint iFontIsProportional; // nonzero if font is proportional
1.580 + };
1.581 +
1.582 +
1.583 +
1.584 +#endif