classicui_pub/misc_controls_api/inc/EIKCONSO.H
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #if !defined(__EIKCONSO_H__)
       
    20 #define __EIKCONSO_H__
       
    21 													   
       
    22 #if !defined(__E32CONS_H__)
       
    23 #include <e32cons.h>
       
    24 #endif
       
    25 
       
    26 #if !defined(__EIKSBOBS_H__)
       
    27 #include <eiksbobs.h>
       
    28 #endif
       
    29 
       
    30 #if !defined(__EIKSBFRM_H__)
       
    31 #include <eiksbfrm.h>
       
    32 #endif
       
    33 
       
    34 #include <AknControl.h>
       
    35 
       
    36 #define ATT_DOUBLEWIDTH					0x60
       
    37 #define ATT_DOUBLETOP	   			0x20	
       
    38 #define ATT_DOUBLEBOTTOM				0x40	
       
    39 ////////////////////////////////////////////
       
    40 #define ATT_ITALIC						0x08	
       
    41 #define ATT_INVERSE 					0x04
       
    42 #define ATT_UNDERLINE					0x02
       
    43 #define ATT_BOLD						0x01
       
    44 ////////////////////////////////////////////
       
    45 #define ATT_COLORMASK					0x80	// &x!=0 : color
       
    46 #define ATT_DOUBLEMASK					0x60 	// &x : only the bits relevant for doublewidth/doubleheight
       
    47 #define ATT_RIGHTMASK					0x10	// |x to set RIGHT indicator
       
    48 #define ATT_IGNORE_RIGHTLEFT			0xEF	// &x to clear the RIGHT/LEFT flag
       
    49 #define ATT_IGNORE_INVERSE				0xFB	// &x to clear the INVERSE flag
       
    50 ////////////////////////////////////////////
       
    51 #define ATT_MAXVALUE					0xFF	// all flags set (maximum value of attribute byte)
       
    52 #define ATT_NORMAL						0		// the default character attribute
       
    53 
       
    54 enum TEikConsWinUnits
       
    55 	{
       
    56 	EEikConsWinInPixels,
       
    57 	EEikConsWinInChars
       
    58 	};
       
    59 
       
    60 
       
    61 	/** CEikConsoleScreen()
       
    62 	
       
    63 	@param aBuffer         String that needs to be clipped. will be modified by this call
       
    64 	@param aFont           Font used in the code
       
    65 	@param aMaxWidthInPixels Maximum length of text that will not be clipped.
       
    66 	@param aDir            Where is the text clipped from. EDoNotClip, EClipFromEnd, EClipFromBeginning.
       
    67 	@param aClipWidth      The length of the text after clipping. KDefaultClipWidth will make it use aMaxWidthInPixels.
       
    68 	@param aClipString     The representation of three dots. (not really used anywhere - use the default value always or "")
       
    69        
       
    70 	returns true if the text was clipped and 3 dots were added. 
       
    71     */
       
    72 class CEikConsoleControl;
       
    73 class CEikConsoleScreen : public CConsoleBase
       
    74 	{
       
    75 public:
       
    76 	enum TEikConsoleFlags
       
    77 		{
       
    78 		EUseBackedUpWindow	=0x1,
       
    79 		ENoInitialCursor	=0x2
       
    80 		};
       
    81 public:
       
    82 	/** 
       
    83      * CEikConsoleScreen() constructor 
       
    84      */
       
    85 	IMPORT_C CEikConsoleScreen();
       
    86 	/** 
       
    87      * CEikConsoleScreen() destructor
       
    88      */
       
    89 	IMPORT_C ~CEikConsoleScreen();
       
    90 
       
    91 	/** Create() Creates a console and sets title and size
       
    92 	 *
       
    93 	 * @param aTitle          Title of the console
       
    94 	 * @param aSize           Size of the console in pixels
       
    95      *  
       
    96 	 * returns error code
       
    97      */
       
    98 	IMPORT_C TInt Create(const TDesC& aTitle,TSize aSize);
       
    99     /** Read()
       
   100      * Not implemented
       
   101      */
       
   102 	IMPORT_C void Read(TRequestStatus& aStatus);
       
   103     /** ReadCancel()
       
   104      * Not implemented
       
   105      */
       
   106 	IMPORT_C void ReadCancel();
       
   107     /** KeyCode()
       
   108      * Not implemented
       
   109      */
       
   110 	IMPORT_C TKeyCode KeyCode() const;
       
   111     /** KeyModifiers()
       
   112      * Not implemented
       
   113      */
       
   114 	IMPORT_C TUint KeyModifiers() const;
       
   115 	/** ConstructL() Constructs a console and sets title
       
   116 	 *
       
   117 	 * @param aTitle          Title of the console
       
   118 	 * @param aFlags          Flags, for example EUseBackedUpWindow or ENoInitialCursor
       
   119      */
       
   120 	IMPORT_C void ConstructL(const TDesC &aTitle,TInt aFlags);// use full screen 
       
   121 	/** ConstructL() Constructs a console and sets title and size
       
   122 	 *
       
   123 	 * @param aTitle          Title of the console
       
   124      * @param aSize           Size of the console in pixels
       
   125 	 * @param aFlags          Flags, for example EUseBackedUpWindow or ENoInitialCursor
       
   126 	 * @param aUnit           Unit of the console
       
   127      */
       
   128 	IMPORT_C void ConstructL(const TDesC &aTitle,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars); // place the screen at TPoint(0,0)
       
   129 	/** ConstructL() Constructs a console and sets title and position and size
       
   130 	 *
       
   131 	 * @param aTitle          Title of the console
       
   132      * @param aTopLeft        TopLeft corner of the console window
       
   133      * @param aSize           Size of the console in pixels
       
   134 	 * @param aFlags          Flags, for example EUseBackedUpWindow or ENoInitialCursor
       
   135 	 * @param aUnit           Unit of the console
       
   136      */
       
   137 	IMPORT_C void ConstructL(const TDesC &aTitle,TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit=EEikConsWinInChars); 
       
   138 	/** SetConsWin() Sets console window
       
   139 	 *
       
   140 	 * @param aConsWin          Console control
       
   141      */
       
   142 	IMPORT_C void SetConsWin(CEikConsoleControl *aConsWin); // use if you don't want WHOLE screen
       
   143 	/** ConsoleControl() fetching console control
       
   144 	 *
       
   145 	 * Returns console control
       
   146      */
       
   147 	inline CEikConsoleControl* ConsoleControl() const {return iConsoleControl;};
       
   148 
       
   149 	/** SetTitle() Set title of the console
       
   150 	 *
       
   151 	 * @param aTitle          Title of the console
       
   152      */
       
   153 	IMPORT_C void SetTitle(const TDesC &aTitle);
       
   154 	/** SetTitle() Set title of the console
       
   155 	 *
       
   156 	 * @param aTitle          Title of the console
       
   157      */
       
   158 	IMPORT_C void SetTitleL(const TDesC &aTitle);
       
   159 	/** Title() Gets title of the console
       
   160 	 *
       
   161 	 * returns Title of the console
       
   162      */
       
   163 	inline HBufC *Title() const {return iConsoleTitle;};
       
   164 	
       
   165 	/** ScreenSize() Gets size of the screen
       
   166 	 *
       
   167 	 * returns Size of the screen in pixels
       
   168      */
       
   169 	IMPORT_C TSize ScreenSize() const;
       
   170 	/** FlushChars() Updates the character buffers
       
   171 	 */
       
   172 	IMPORT_C void FlushChars(); //new
       
   173 	/** CursorPos() Cursor position getter
       
   174      *  returns cursor position
       
   175 	 */
       
   176 	IMPORT_C TPoint CursorPos() const;
       
   177 	/** SetCursorPosAbs Moving cursor to absolute position
       
   178      *
       
   179      * @param aPoint Position in absolute coordinates
       
   180 	 */
       
   181 	IMPORT_C void SetCursorPosAbs(const TPoint &aPoint);		
       
   182 	/** SetCursorPosRel Moving cursor to relative position
       
   183      *
       
   184      * @param aPoint Position in relative coordinates
       
   185 	 */
       
   186 	IMPORT_C void SetCursorPosRel(const TPoint &aPoint);		
       
   187 	/** SetCursorHeight changes cursor height
       
   188      *
       
   189      * @param aPercentage Cursor height relative to character height
       
   190 	 */
       
   191 	IMPORT_C void SetCursorHeight(TInt aPercentage);		
       
   192 	/** Write() Writes text to the console
       
   193      *
       
   194      * @param aDes Text to be written to the console
       
   195 	 */
       
   196 	IMPORT_C void Write(const TDesC &aDes);				   		
       
   197 	/** ClearScreen() Clears the console screen
       
   198 	 * 
       
   199 	 */
       
   200 	IMPORT_C void ClearScreen();				
       
   201 	/** ClearToEndOfLine() Clears from cursor position to end of the line
       
   202 	 * 
       
   203 	 */
       
   204 	IMPORT_C void ClearToEndOfLine();		
       
   205 	/** ClearChars() Clears characters within rectangle matching attributes
       
   206      *
       
   207      * @param aRect Rectangle in pixels
       
   208      * @param aCharacterAttributes Matching character attributes
       
   209 	 */
       
   210 	IMPORT_C void ClearChars(const TRect &aRect,TUint aCharacterAttributes);	
       
   211 	/** HideCursor() Hides cursor
       
   212 	 *
       
   213 	 * @return nonzero if cursor was not visible
       
   214 	 */
       
   215 	IMPORT_C TInt HideCursor(); // returns nonzero if cursor wasn't visible
       
   216 	/** DrawCursor() Draws cursor
       
   217 	 */
       
   218 	IMPORT_C void DrawCursor(); 
       
   219 	/** DrawInSight Moves topleft corner
       
   220 	 *
       
   221 	 * @param aPosition New position for insight
       
   222 	 */
       
   223 	IMPORT_C void DrawInSight(TPoint aPosition);
       
   224 	/** DrawCursorInSight() Draws cursor and insight
       
   225 	 */
       
   226 	IMPORT_C void DrawCursorInSight();
       
   227 
       
   228 	/** Move cursor up
       
   229 	 * @param aCount Number of steps to move
       
   230 	 */	
       
   231 	IMPORT_C void Up(TUint aCount=1);		
       
   232 	/** Move cursor down
       
   233 	 * @param aCount Number of steps to move
       
   234 	 */	
       
   235 	IMPORT_C void Down(TUint aCount=1);	
       
   236 	/** Move cursor right
       
   237 	 * @param aCount Number of steps to move
       
   238 	 */	
       
   239 	IMPORT_C void Right(TUint aCount=1);	
       
   240 	/** Move cursor left
       
   241 	 * @param aCount Number of steps to move
       
   242 	 */	
       
   243 	IMPORT_C void Left(TUint aCount=1);	
       
   244 	/** Insert a CR
       
   245 	 */
       
   246 	IMPORT_C void Cr();							
       
   247 	/** Insert a linefeed
       
   248 	 */
       
   249 	IMPORT_C void Lf();							
       
   250 	/** Scroll characters
       
   251 	 * @param anArea Area to scroll
       
   252 	 * @param aVector How much to scroll
       
   253 	 */
       
   254 	IMPORT_C void ScrollChars(const TRect &anArea,const TPoint &aVector);
       
   255 
       
   256     /** Redraw a rectangle
       
   257 	 * @param aRect Rectangle to redraw
       
   258      */
       
   259 	IMPORT_C void Redraw(const TRect &aRect);	// called by CEikConsoleControl
       
   260     /** Moves topleft
       
   261      * @param aVector new position of topleft
       
   262      */
       
   263 	IMPORT_C void MoveTopLeft(TPoint aVector);	// called by CEikConsoleControl
       
   264 
       
   265     /** Size of the history
       
   266      * @return lines stored for history buffer
       
   267      */
       
   268 	inline TUint HistorySize() const {return iNoChrExtra;}; // lines ACTUALLY stored				
       
   269     /** Set history buffer size
       
   270      * @param aMaxChrExtra lines allocated for history
       
   271      * @param aMaxAttExtra attributed lines allocated for history
       
   272      */
       
   273 	IMPORT_C void SetHistorySizeL(TUint aMaxChrExtra,TUint aMaxAttExtra);  // lines of back-scroll history resp. lines of ATTRIBUTED backscroll history (aMaxAttExtra<=aMaxChrExtra)
       
   274 		
       
   275     /** Att() Attributes
       
   276      * @returns attributes
       
   277      */
       
   278 	inline TUint Att() const {return iAtt;};
       
   279 	
       
   280 	/** Set attributes
       
   281      * @param aCharacterAttributes Attributes for characters
       
   282 	 */
       
   283 	IMPORT_C void SetAtt(TUint aCharacterAttributes);		
       
   284 	/** Set attributes
       
   285      * @param aForegroundGray16 Grey16 attributes for foreground
       
   286      * @param aBackgroundGray16 Grey16 attribuets for background
       
   287 	 */
       
   288 	IMPORT_C void SetAtt(TUint aForegroundGray16,TUint aBackgroundGray16); 
       
   289 
       
   290     /** SetFontL() Sets the font for console
       
   291      * @param aFontDesc font specification
       
   292      */
       
   293 	IMPORT_C void SetFontL(const TFontSpec &aFontDesc);	
       
   294 	/** Font() Gets the used font
       
   295 	 * @returns font specification
       
   296 	 */
       
   297 	IMPORT_C const TFontSpec& Font() const;
       
   298 
       
   299 	/** SetSelection() Sets the selection position
       
   300      * @param aRange range of the selection
       
   301 	 */
       
   302 	IMPORT_C void SetSelection(const TRect &aRange); 
       
   303     /** SelectCursor() Sets empty selection starting and ending at cursor position
       
   304      */
       
   305 	IMPORT_C void SelectCursor(); // empty selection starting and ending at cursor position
       
   306     /** Selection() Get selection position
       
   307      * @return selection position
       
   308      */
       
   309 	IMPORT_C TRect Selection();
       
   310     /** RetrieveL() returns selected text
       
   311      * @param aRange selection
       
   312      * @return text in descriptor
       
   313      */
       
   314 	IMPORT_C HBufC *RetrieveL(const TRect &aRange);	// returns selection in newly allocated buffer
       
   315 	
       
   316 	/** SetPureCRLF() sets pure flag
       
   317      * @param aFlag flags
       
   318 	 */
       
   319 	IMPORT_C void SetPureCRLF(TUint aFlag);
       
   320 	/** SetAllPrintable() sets all printable flag
       
   321      * @param aFlag flags
       
   322 	 */
       
   323 	IMPORT_C void SetAllPrintable(TUint aFlag);
       
   324 	/** SetScrollLock() sets scroll lock flag
       
   325      * @param aFlag flags
       
   326 	 */
       
   327 	IMPORT_C void SetScrollLock(TUint aFlag);
       
   328 	/** SetKeepCursorInSight() sets cursor in sight flag
       
   329      * @param aFlag flags
       
   330 	 */
       
   331 	IMPORT_C void SetKeepCursorInSight(TUint aFlag);
       
   332 	/** SetScrollBarVisibilityL() sets scrollbar visibility
       
   333      * @param aHBarVisibility horizontal scrollbar visibility
       
   334      * @param aVBarVisibility vertical scrollbar visibility
       
   335 	 */
       
   336 	IMPORT_C void SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility);
       
   337 	/** UpdateScrollBars() updates scrollbars
       
   338 	 * 
       
   339 	 */
       
   340 	IMPORT_C TBool UpdateScrollBars();
       
   341 
       
   342 private:
       
   343 	// high-level history manipulation
       
   344 	void MemScrPut(const TDesC &aString,TPoint aPos,TUint8 aCharacterAttributes);
       
   345 	void MemScrClr(const TRect &aRect,TUint8 aCharacterAttributes);
       
   346 	void MemScrScrollUp(TUint aLines=1);
       
   347 	void MemScrMove(TPoint anOldPt,TPoint aNewPt,TUint aLen);
       
   348 	void MemScrScroll(const TRect &aRect,TPoint aVector);
       
   349 	// low-level history access
       
   350 	TPtr	MemChrPtr(TPoint aPos,TUint aLen);
       
   351 	TPtr8	MemAttPtr(TPoint aPos,TUint aLen);
       
   352 	// console screen-to-visible window conversion
       
   353 	TPoint 	ScrToVis(TPoint aPoint);
       
   354 	TRect 	ScrToVis(const TRect &aRect);
       
   355 	// recalculates iVisSize and iVisWin
       
   356 	TBool RecalculateSize();	
       
   357 	// calculate a TopLeft that would put aPosition in-sight
       
   358 	TPoint GetAnInSightPosition(TPoint aPosition) const;
       
   359 	// draw cursor or draw cursor in sight, depending on iKeepCursorInSight
       
   360 	void DrawCursorWhereNeeded();
       
   361 	// smart cursor-clipping: clips cursor to within screen, but allows it to be past the last character
       
   362 	void ClipCursor();
       
   363 	// redraw characters with doublewidth LEFT/RIGHT flag set depending on odd/even columns
       
   364 	void RedrawChars(TInt anX,TInt anY,TInt aLength,TUint aCharacterAttributes);
       
   365 	// routines needed for selection
       
   366 	void InvertOverlap(TPoint aStart,TPoint aEnd,TPoint bStart,TPoint bEnd);
       
   367 	void InvertRange(const TRect &aRect);
       
   368 
       
   369 private:
       
   370 	CEikConsoleControl *iConsoleControl;// console window (handles redraw events)
       
   371 	TSize iConsoleSize; 		// size of console in characters (e.g. 80x24)	
       
   372 	HBufC *iConsoleTitle;		// console title
       
   373 	TRect iSelection; 			// current selection
       
   374 	TPoint iCursor;				// current cursor position
       
   375 	TUint iAtt;					// current character attribute
       
   376 
       
   377 	TInt iWriteNow;				// if FALSE, Write()-calls can be buffered
       
   378 	TBuf<256> iWriteBuffer;		// the Write() buffer
       
   379 
       
   380 	TInt	iMaxChrExtra;		// max nr of extra lines of characters stored
       
   381 	TInt	iNoChrExtra;		// actual nr of extra lines of characters stored
       
   382 	TInt	iMaxAttExtra;		// max nr of extra lines of character attributes stored
       
   383 	TText	*iChrBuf;			// character history
       
   384 	TUint8	*iAttBuf;			// attribute history
       
   385 
       
   386 	TPoint	iTopLeft;			// coordinates of top left corner of visual display
       
   387 	TRect iVisWin;				// RECT visible window
       
   388 	TSize iVisSize;				// SIZE visible window
       
   389 
       
   390 	// settings
       
   391 	TUint iPureCRLF;			// FALSE by default. If TRUE, CR and LF are "pure"
       
   392 	TUint iAllPrintable;		// FALSE by default. If TRUE, even chars 0-31 are printed
       
   393 	TUint iScrollLock;			// FALSE by default. If TRUE, will not scroll at bottom line
       
   394 	TUint iKeepCursorInSight;	// TRUE by default. If FALSE, cursor may be offscreen after a Write()
       
   395 	TUint iCursorBlinking; 		// TRUE if cursor should be visible (i.e. user WANTS it to be visible)
       
   396 
       
   397 	TInt iConsFlags;
       
   398 	};
       
   399 
       
   400 class CEikConsoleControl : public CAknControl, public MEikScrollBarObserver
       
   401 	{
       
   402 public:	
       
   403 	// constructors, destructors, initialization
       
   404     /** Constructor
       
   405      */
       
   406 	IMPORT_C CEikConsoleControl();
       
   407 	/** Destructor
       
   408 	 */
       
   409 	IMPORT_C ~CEikConsoleControl();
       
   410     /* ConstructL()
       
   411      */
       
   412 	IMPORT_C void	ConstructL(TInt aFlags);
       
   413     /* ConstructL()
       
   414      */
       
   415 	IMPORT_C void	ConstructL(TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit);
       
   416     /** SetRedrawer
       
   417      * @param aConsole console screen
       
   418      */
       
   419 	IMPORT_C void 	SetRedrawer(CEikConsoleScreen *aConsole);
       
   420 
       
   421 	// font stuff
       
   422 	/** SetFontL() sets the console font
       
   423 	 * @param aFontSpec font specification
       
   424 	 * @param aFont font instance
       
   425 	 */
       
   426 	IMPORT_C void	SetFontL(const TFontSpec &aFontSpec,const CFbsFont* aFont);		// change to font aFontSpec
       
   427 	/** Font() gets font specification
       
   428 	 */
       
   429 	inline const TFontSpec& Font() const {return iFontSpec;};	// returns current fontspec
       
   430 
       
   431 	/** CharSize() gets character size
       
   432 	 */
       
   433 	inline const TSize& CharSize() const {return iCharSize;};	
       
   434     /** VisibibleSize() gets visible size
       
   435      *
       
   436      */
       
   437 	IMPORT_C TSize	VisibleSize() const;						// returns maximal visible nr of visible characters
       
   438 
       
   439 	// cursor stuff
       
   440 	/** SetCursorHeight() Sets cursor height
       
   441      * @param aPercentage value 0..100%
       
   442 	 */
       
   443 	IMPORT_C void	SetCursorHeight(TUint aPercentage);	// set cursor height (0-100%)
       
   444     /** DrawCursor Draws cursor at position
       
   445      * @param aPosition position
       
   446      */
       
   447 	IMPORT_C void	DrawCursor(TPoint aPosition);		// draw cursor at character position
       
   448     /** HideCursor hides cursor
       
   449      */
       
   450 	IMPORT_C void	HideCursor();						// hide cursor
       
   451 
       
   452 	// basic graphic functions
       
   453 	/** DrawChars() draws characters
       
   454      * @param aString string to be drawn
       
   455      * @param aPosition position of the string
       
   456      * @param aCharacterAttributes attributes of the drawn string
       
   457 	 */
       
   458 	IMPORT_C void	DrawChars(const TDesC &aString,const TPoint &aPosition,TUint aCharacterAttributes);	// draw aString at character position aPosition using
       
   459     /** ClearChars() clears characters
       
   460      * @param anArea area to be cleared
       
   461      * @param aCharacterAttributes attributes of cleared characters
       
   462      */
       
   463 	IMPORT_C void	ClearChars(const TRect &anArea,TUint aCharacterAttributes);	// clear the character area
       
   464     /** InsertChars() inserts character area
       
   465      * @param anArea area to be inserted
       
   466      */
       
   467 	IMPORT_C void	InvertChars(const TRect &anArea);	// invert the character area
       
   468     /** ScrollChars scrolls character area
       
   469      * @param anArea area to be scrolled
       
   470      * @param aVector direction to be scrolled
       
   471      */
       
   472 	IMPORT_C void	ScrollChars(const TRect &anArea,const TPoint &aVector);	// scroll characters inside anArea by the given vector
       
   473 
       
   474 	// scrollbar stuff
       
   475     /** sets scrollbar visibility
       
   476      * @param aHBarVisibility horizontal scrollbar visibility
       
   477      * @param aVBarVisibility vertical scrollbar visibility
       
   478      */    
       
   479 	IMPORT_C TInt	SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility);
       
   480     /** Updates scrollbar
       
   481      * @param aDataSize size of the data
       
   482      * @param aVisibleSize how much of the data is visible on the console
       
   483      * @param aPos position of the visible area relative to whole data
       
   484      * @return ETrue if as a result, the visible window has changed
       
   485      */
       
   486 	IMPORT_C TBool	UpdateScrollbarsL(const TSize &aDataSize,const TSize& aVisibleSize,TPoint aPos);
       
   487     /** Handles scroll event
       
   488      * @param aScrollBar scrollbar to be used for the event
       
   489      * @param aEventType type of the event that happened
       
   490      */
       
   491 	IMPORT_C void	HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType);
       
   492     /** Updates an area
       
   493      */
       
   494 	IMPORT_C void	UpdateArea();
       
   495 
       
   496 public:	// from CCoeControl
       
   497 	/** GetColorUseListL provides color use list for the control
       
   498 	 */
       
   499 	IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
       
   500     /** HandleResourceChange handles several kinds of resource change events
       
   501      */
       
   502 	IMPORT_C virtual void HandleResourceChange(TInt aType);			// not available before Release 005u
       
   503     /** HandlePointerEventL handles touch pointer events
       
   504      */
       
   505     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   506 
       
   507 protected:	// virtual
       
   508 	// window stuff
       
   509     /** Draws the control
       
   510      */
       
   511 	IMPORT_C void	Draw(const TRect& aRect) const;	
       
   512     /** Size has changed
       
   513      */
       
   514 	IMPORT_C void	SizeChanged();
       
   515     /** Focus has changed
       
   516      */
       
   517 	IMPORT_C void FocusChanged(TDrawNow aDrawNow);
       
   518     /** Component controls count
       
   519      */
       
   520 	IMPORT_C virtual TInt CountComponentControls() const;
       
   521     /** Component controls
       
   522      */
       
   523 	IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
       
   524     /** Writes internal state
       
   525      */
       
   526 	IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
   527 
       
   528 private:  // virtual - Reserved from CCoeControl
       
   529 	IMPORT_C virtual void Reserved_2();
       
   530 
       
   531 private:
       
   532     /**
       
   533     * From CAknControl
       
   534     */
       
   535     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   536 
       
   537 private:
       
   538 	TPoint	CharsToPixels(TPoint aPoint);
       
   539 	TRect	CharsToPixels(const TRect &aRect);
       
   540 	TRect	PixelsToChars(const TRect &aRect);
       
   541 	void	ClearPixels(const TRect &anArea,TRgb aColor) const;
       
   542 
       
   543 	void 	NextFontL(); 			
       
   544 	void	InterpretAttribute(TUint AnAtt);
       
   545 	void	InterpretColorBits(TUint aCharacterAttributes);
       
   546 	inline 	CEikConsoleControl &M() const {return((CEikConsoleControl&)(*this));}
       
   547  	void CreateScrollBarFrameLayout(TEikScrollBarFrameLayout& aLayout) const;
       
   548 	void	InitFontSpecL();
       
   549 
       
   550 private:
       
   551 	CEikConsoleScreen *iConsole;	// the console that owns this window
       
   552 	TRgb iBackGray16;				// current background color 
       
   553 	TRgb iPenGray16;				// current pen color for characters
       
   554 	TUint iLastAtt;					// last attribute, to see if we need to change the gc
       
   555 	TUint iLastFontFlags;			// last attribute, to see if we need to load another font
       
   556 
       
   557 	TSize iCharSize;				// size of a single character (in pixels)
       
   558 	TSize iViewInPixels;			// size of area available for characters (in pixels)
       
   559 	TSize iViewInChars;				// size of area available for characters (in characters)
       
   560 
       
   561 	TTextCursor iTextCursor;		// cursor to use
       
   562 	TUint iCursorHeightPercentage;	// required height of cursor (as a percentage)
       
   563 
       
   564 	TInt iRedrawing;				// NONZERO IF BUSY REDRAWING
       
   565 	
       
   566 	CEikScrollBarFrame* iSBFrame;
       
   567 	CEikScrollBarFrame::TScrollBarVisibility	iHBarVisibility;
       
   568 	CEikScrollBarFrame::TScrollBarVisibility	iVBarVisibility;
       
   569 	TPoint	iLastThumbPos;
       
   570 
       
   571 	const CFont *iCurrentFont;		// Current font
       
   572 	TFontSpec iFontSpec;			// Current font spec
       
   573 	TFontUnderline iFontUnderline;	// Current font spec underline
       
   574 	TUint iFontHeight;				// Height of current font when not doubleheight/doublewidth
       
   575 	TUint iFontIsProportional; 		// nonzero if font is proportional
       
   576 	};
       
   577 
       
   578 
       
   579 
       
   580 #endif