textinput/peninputarc/inc/peninputlayoutcontrolinc/peninputlayouthwrwnd.h
changeset 0 eb1f2e154e89
child 10 6defe5d1bd39
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  header file of HWR window base and transparent window control
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_CHWRWNDBASE_H
       
    19 #define C_CHWRWNDBASE_H
       
    20 
       
    21 #include <peninputlayoutbasecontrol.h>
       
    22 #include <centralrepository.h>
       
    23 
       
    24 class CPeninputPenTraceDecorator;
       
    25 
       
    26 /**
       
    27  *  CHwrWndBase
       
    28  *
       
    29  *  Base control for all hwr window.
       
    30  *
       
    31  *  @lib feplayoutcontrol.lib
       
    32  *  @since S60 V4.0
       
    33  */
       
    34 
       
    35 class CHwrWndBase : public CFepUiBaseCtrl, public MTimerHandler
       
    36                     //public MEventObserver
       
    37     {
       
    38 public:    
       
    39 
       
    40     /**
       
    41      * Destructor.        
       
    42      *
       
    43      * @since S60 V4.0        
       
    44      */           
       
    45     IMPORT_C virtual ~CHwrWndBase();
       
    46 
       
    47     /**
       
    48      * Clear all strokes
       
    49      *
       
    50      * @since S60 V4.0
       
    51      */                               
       
    52     IMPORT_C virtual void ClearStroke(); 
       
    53    
       
    54     /**
       
    55      * Add guiding line
       
    56      *
       
    57      * @since S60 V4.0
       
    58      * @param aStart The start point of the guiding line
       
    59      * @param aEnd The end point of the guilding line
       
    60      */                                               
       
    61     IMPORT_C void AddGuidingLine(const TPoint& aStart, const TPoint& aEnd);                
       
    62 
       
    63     /**
       
    64      * A callback function. Called when finishing one stroke (pen up).
       
    65      *
       
    66      * @since S60 V4.0
       
    67      * @param aCharacterTimerFlag Flag indicates whether needs to set character timer        
       
    68      *                            Default value is ETrue, set the character timer   
       
    69      */                               
       
    70     virtual void EndStrokeL(TBool aCharacterTimerFlag);        
       
    71 
       
    72     /**
       
    73      * A callback function. Called when character timer out.
       
    74      * @since S60 V4.0
       
    75      */                                       
       
    76     virtual void EndStrokeAndClearL();            
       
    77 
       
    78     /**
       
    79      * Set stroke end mark. A stroke end mark indicates end of a stroke
       
    80      *
       
    81      * @since S60 V4.0
       
    82      * @param aPt The stroke end point        
       
    83      */                       
       
    84     inline void SetStrokeEndMark(const TPoint& aPt);
       
    85 
       
    86     /**
       
    87      * Set character timer. A character timer defines the maximum writing period.
       
    88      * Only those traces within the writing period, are considered belonging 
       
    89      * to the same character
       
    90      *
       
    91      * @since S60 V4.0
       
    92      * @param aCharDelay The character timer in micro seconds.
       
    93      */                                               
       
    94     inline void SetCharacterDelay(TTimeIntervalMicroSeconds32 aCharDelay);
       
    95 
       
    96     /**
       
    97      * Get the stroke list.
       
    98      *
       
    99      * @since S60 V4.0
       
   100      * @return The stroke list
       
   101      */                                                       
       
   102     inline const RArray<TPoint>& StrokeList();
       
   103     
       
   104     /**
       
   105      * Set stroke delay. A stroke delay defines the time when to start doing 
       
   106      * the recognition before next stroke starts.
       
   107      *
       
   108      * @since S60 V4.0
       
   109      * @param aStrokeDelay
       
   110      * @return The stroke list
       
   111      */       
       
   112     inline void SetStrokeDelay(TTimeIntervalMicroSeconds32 aStrokeDelay);    
       
   113             
       
   114     //maskcol       
       
   115     /**
       
   116      * get stroke end mark
       
   117      *
       
   118      * @since S60 V4.0        
       
   119      * @return The stroke end mark
       
   120      */        
       
   121     inline const TPoint& StrokeEndMark();
       
   122         
       
   123     /**
       
   124      * Do we have new trace
       
   125      *
       
   126      * @since S60 V4.0        
       
   127      * @return New trace flag
       
   128      */    
       
   129     inline TBool HasNewTrace();        
       
   130         
       
   131     /**
       
   132      * Get frame color
       
   133      *
       
   134      * Obsolete. Use BorderColor() instead.
       
   135      * @since S60 V4.0        
       
   136      * @return current frame color
       
   137      */        
       
   138     inline const TRgb& FrameCol();
       
   139 
       
   140     /**
       
   141      * Set frame color
       
   142      * Obsolete. Use SetBorderColor instead.
       
   143      *
       
   144      * @since S60 V4.0        
       
   145      * @param The new frame color
       
   146      */        
       
   147     inline void SetFrameCol(const TRgb& aCol);        
       
   148 
       
   149     /**
       
   150      * Cancel the writing. It will stops the timer and clear all strokes
       
   151      *
       
   152      * @since S60 V4.0        
       
   153      */
       
   154     IMPORT_C virtual void CancelCharWriting();        
       
   155      
       
   156     //from CFepUiBaseCtrl
       
   157 
       
   158     /**
       
   159      * From CFepUiBaseCtrl
       
   160      * Draw control
       
   161      *
       
   162      * @since S60 V4.0
       
   163      */                       
       
   164     IMPORT_C virtual void Draw();
       
   165 
       
   166   
       
   167     /**
       
   168      * From CFepUiBaseCtrl
       
   169      * Cancel pointer down event.
       
   170      * This will be called when a control has pointer down but pointer up 
       
   171      * event happens in other ways.
       
   172      *
       
   173      * @since S60 V4.0
       
   174      * @param aFocusedFlag ETrue if got focused, otherwise EFalse
       
   175      */                                
       
   176     virtual void CancelPointerDownL();
       
   177 
       
   178     
       
   179     //From base class MTimerHandler
       
   180     /**
       
   181      * From MTimerHandler
       
   182      * HandleTimerOut. Handling time out event
       
   183      *
       
   184      * @since S60 V4.0
       
   185      * @param aTimeType The timer type
       
   186      */                    
       
   187     IMPORT_C void HandleTimerOut(TInt aTimeType);           
       
   188     
       
   189     /**
       
   190      * Update the region where other control made dirty.
       
   191      *
       
   192      * @since S60 V4.0        
       
   193      * @return Current dirty rect
       
   194      */        
       
   195     IMPORT_C void UpdateRegion(CFepUiBaseCtrl* aCtrl);    
       
   196     
       
   197     /**
       
   198      * From CFepUiBaseCtrl
       
   199      * OnDeActivate. Called when the layout is going to be hidden
       
   200      *
       
   201      * @since S60 v4.0
       
   202      */        
       
   203     IMPORT_C void OnDeActivate();   
       
   204 
       
   205     /**
       
   206      * From CFepUiBaseCtrl
       
   207      * Call back function when layout starts dragging
       
   208      *
       
   209      * @since S60 V4.0
       
   210      */
       
   211     IMPORT_C void OnLayoutDraggingStart();
       
   212 
       
   213     /**
       
   214      * From CFepUiBaseCtrl    
       
   215      * Call back function when layout ends dragging
       
   216      *
       
   217      * @since S60 V4.0
       
   218      */
       
   219     IMPORT_C void OnLayoutDraggingEnd();
       
   220    
       
   221 protected:
       
   222     /**
       
   223      * Constructor
       
   224      *
       
   225      * @since S60 V4.0
       
   226      * @param aRect The rectangle area for this control
       
   227      * @param aUiLayout Ui layout who contains this control.Ownership not transferred
       
   228      * @param aControlId control Id
       
   229      */       
       
   230     IMPORT_C CHwrWndBase(const TRect& aRect,CFepUiLayout* aUiLayout,TInt aControlId);    
       
   231 
       
   232     /**
       
   233      * Second phrase constructor.
       
   234      *
       
   235      * @since S60 V4.0
       
   236      */
       
   237     IMPORT_C void ConstructL();
       
   238 
       
   239     /**
       
   240      * Get dirty rect
       
   241      *
       
   242      * @since S60 V4.0        
       
   243      * @return Current dirty rect
       
   244      */        
       
   245     inline TRect& DirtyRect();   
       
   246 
       
   247     /**
       
   248      * From CFepUiBaseCtrl    
       
   249      * Handle pointer down event
       
   250      *
       
   251      * @since S60 V4.0
       
   252      * @param aPoint The point position relative the layout
       
   253      * @return The control which handles the event.     
       
   254      */                                        
       
   255     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint);
       
   256     
       
   257     /**
       
   258      * From CFepUiBaseCtrl    
       
   259      * Handle pointer move event
       
   260      *
       
   261      * @since S60 V4.0
       
   262      * @param aPoint The point position relative the layout
       
   263      * @return The control which handles the event.     
       
   264      */                  
       
   265     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint);
       
   266     
       
   267     /**
       
   268      * From CFepUiBaseCtrl
       
   269      * Handle pointer up event
       
   270      *
       
   271      * @since S60 V4.0
       
   272      * @param aPoint The point position relative the layout
       
   273      * @return The control which handles the event.     
       
   274      */                  
       
   275     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint);
       
   276 
       
   277 private:
       
   278 
       
   279     /**
       
   280      * From CHwrWndBase
       
   281      * Draw point
       
   282      *
       
   283      * @since S60 V4.0
       
   284      * @param aPoint The point to be drawn
       
   285      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   286      * @return The affected rect
       
   287      */        
       
   288     virtual TRect DrawPoint(const TPoint& aPoint,TBool aDrawFlag) =0;
       
   289     
       
   290     /**
       
   291      * From CHwrWndBase
       
   292      * Draw line
       
   293      *
       
   294      * @since S60 V4.0
       
   295      * @param aPt1 The start point
       
   296      * @param aPt2 The end point
       
   297      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   298      * @return The affected rect
       
   299      */        
       
   300     virtual TRect DrawLine(const TPoint& aPt1,const TPoint& aPt2,TBool aDrawFlag ) =0;
       
   301 
       
   302     /**
       
   303      * Draw or erace current stroke
       
   304      * @param aDrawFlag ETrue if drawing, otherwise erase the trace
       
   305      * @return The minimum rect which current drawing/erasing affects
       
   306      */       
       
   307     IMPORT_C virtual TRect DrawStroke(TBool aDrawFlag);    
       
   308 
       
   309 private:   
       
   310     /**
       
   311      * stoke end mark
       
   312      */
       
   313     TPoint iStrokeEndMark;
       
   314     
       
   315     /**
       
   316      * Previous point drawed
       
   317      */
       
   318     TPoint iPtPrev;
       
   319     
       
   320     /**
       
   321      * Character delay for character timer
       
   322      */
       
   323     TTimeIntervalMicroSeconds32 iCharDelay;
       
   324     
       
   325     /**
       
   326      * stroke delay for stroke timer.
       
   327      */
       
   328     TTimeIntervalMicroSeconds32 iStrokeDelay;            
       
   329 
       
   330     /**
       
   331      * Indicates whether we have new pen trace
       
   332      */
       
   333     TBool iHasNewTrace;
       
   334     
       
   335     TBool iSubmitted;
       
   336 
       
   337     /**
       
   338      * The rect which confines the trace.Due to pen size, the dirty rect would
       
   339      * sometimes bigger than iRect even trace can't be draw outside of the window. 
       
   340      */
       
   341     TRect iDirtyRect;
       
   342 
       
   343     /**
       
   344      * Frame color
       
   345      */
       
   346      //TRgb iFrameCol;
       
   347      
       
   348     /**
       
   349      * The trace data -- pointer list
       
   350      */
       
   351     RArray<TPoint> iListOfPoints;
       
   352 
       
   353     /**
       
   354      * stroke timer. Recognition stargs after timer out
       
   355      * Own.
       
   356      */
       
   357     CLayoutTimer* iStrokeTimer;
       
   358     
       
   359     /**
       
   360      * character time. Character writing finished after timer out.
       
   361      * Own.
       
   362      */
       
   363     CLayoutTimer* iCharacterTimer;
       
   364     
       
   365     /**
       
   366      * Reserved item1
       
   367      */
       
   368      TInt iReserved1;
       
   369      
       
   370     /**
       
   371      * Reserved item2
       
   372      */
       
   373      TInt iReserved2;    
       
   374     };
       
   375 //end  of class CHwrWndBase
       
   376 
       
   377 /**
       
   378  *  CTransparentHwrWnd
       
   379  *
       
   380  *  Transparent hwr window. This could be used for full-screen or non full screen hwr
       
   381  *
       
   382  *  @lib feplayoutcontrol.lib  
       
   383  *  @since S60 V4.0
       
   384  */
       
   385 class CTransparentHwrWnd : public CHwrWndBase
       
   386     {
       
   387 public:
       
   388 
       
   389     /**
       
   390      * Factory function.        
       
   391      *
       
   392      * @since S60 V4.0        
       
   393      * @param aRect The rectangle area for this control
       
   394      * @param aUiLayout Ui layout who contains this control.Ownership not transferred
       
   395      * @param aControlId control Id
       
   396      * @param aFullScreenFlag Fullscreen window flag. 
       
   397      *          ETrue if it's fullscreen window.
       
   398      * @return An instance of CTransparentHwrWnd class        
       
   399      */                           
       
   400     IMPORT_C static CTransparentHwrWnd* NewL(const TRect& aRect,CFepUiLayout* aUiLayout,
       
   401                             TInt aControlId,TBool aFullScreenFlag=EFalse);
       
   402 
       
   403     /**
       
   404      * Enable or disable whether trace can be outside of the writing window.
       
   405      *
       
   406      * @since S60 V4.0
       
   407      * @param aFlag ETrue if trace could be outside of window. Otherwise EFalse
       
   408      */       
       
   409     IMPORT_C void EnableTraceOutsideWindow(TBool aFlag);
       
   410 
       
   411     /**
       
   412      * Destructor.        
       
   413      *
       
   414      * @since S60 V4.0        
       
   415      */                                   
       
   416     IMPORT_C virtual ~CTransparentHwrWnd();
       
   417     
       
   418     /**
       
   419      * Set transpanrency grade
       
   420      *
       
   421      * @since S60 V4.0        
       
   422      * @param The transparancy factor. Opaque if 0, full transparency if 255    
       
   423      */
       
   424     IMPORT_C void SetWndTransparencyFactor(TUint8 aFactor);
       
   425 
       
   426     //from base class CFepUiBaseCtrl   
       
   427     /**
       
   428      * From CFepUiBaseCtrl
       
   429      * Draw control.
       
   430      *
       
   431      * @since S60 V4.0
       
   432      */               
       
   433     IMPORT_C virtual void Draw();
       
   434 
       
   435     /**
       
   436      * From CFepUiBaseCtrl
       
   437      * Update control's region when other control change its displaying status
       
   438      *
       
   439      * @since S60 V4.0
       
   440      * @param aCtrl The control whose hiding status changed. If NULL, recalulate the region.
       
   441      * @param bFlag tells control is removed or not. 
       
   442      */        
       
   443     IMPORT_C virtual void UpdateValidRegion(CFepUiBaseCtrl* aCtrl,TBool bRemoveFlag);
       
   444 
       
   445     /**
       
   446      * From CHwrWndBase
       
   447      * Clear all strokes
       
   448      *
       
   449      * @since S60 v5.0
       
   450      * @return none.
       
   451      */     
       
   452     IMPORT_C virtual void ClearStroke();
       
   453 
       
   454     /**
       
   455      * Install a new pen trace decorator.
       
   456      * 
       
   457      * @since S60 v5.0
       
   458      * @param aDecoratorName Specifies the name of new decorator
       
   459      * @param aEnable Specifies whether to enable the new decorator after install
       
   460      * @return ETrue if success.
       
   461      */
       
   462     IMPORT_C TBool InstallPenTraceDecoratorL(const TDesC& aDecoratorName, TBool aEnable = ETrue );
       
   463 
       
   464     /**
       
   465      * Test whether this window support pen trace decoration.
       
   466      * 
       
   467      * @since S60 v5.0
       
   468      * @return ETrue if support.
       
   469      */
       
   470     IMPORT_C TBool SupportPenTraceDecoration();
       
   471 
       
   472     /**
       
   473      * Test whether pen trace decoration is activated.
       
   474      * 
       
   475      * @since S60 v5.0
       
   476      * @return ETrue if support.
       
   477      */
       
   478     IMPORT_C TBool PenTraceDecorationActivated();
       
   479 
       
   480     /**
       
   481      * Activate/Deactivate pen trace decoration.
       
   482      * 
       
   483      * @since S60 v5.0
       
   484      * @param aActive Specifies whether to activate or deactivate
       
   485      * @param aReleaseBuffer Specifies whether to release buffer when deactivate
       
   486      * @return none
       
   487      */
       
   488     IMPORT_C void ActivatePenTraceDecoration(TBool aActive,TBool aReleaseBuffer=EFalse );
       
   489     
       
   490 protected:
       
   491     /**
       
   492      * Default constructor.        
       
   493      *
       
   494      * @since S60 V4.0        
       
   495      * @param aRect The rectangle area for this control
       
   496      * @param aUiLayout Ui layout who contains this control.Ownership not transferred
       
   497      * @param aControlId control Id
       
   498      * @param aFullScreenFlag Fullscreen window flag. ETrue if it's fullscreen window.
       
   499      * @return An instance of CTransparentHwrWnd class        
       
   500      */                               
       
   501     IMPORT_C CTransparentHwrWnd(const TRect& aRect,CFepUiLayout* aUiLayout,
       
   502                                 TInt aControlId,TBool aFullScreenFlag);        
       
   503 
       
   504     /**
       
   505      * From CFepUiBaseCtrl
       
   506      * Handle pointer down event
       
   507      *
       
   508      * @since S60 V4.0
       
   509      * @param aPoint The point position relative the layout
       
   510      * @return The control which handles the event.     
       
   511      */                                        
       
   512     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint);
       
   513         
       
   514     /**
       
   515      * From CFepUiBaseCtrl
       
   516      * Handle pointer up event
       
   517      *
       
   518      * @since S60 V4.0
       
   519      * @param aPoint The point position relative the layout
       
   520      * @return The control which handles the event.     
       
   521      */                  
       
   522     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint);
       
   523     
       
   524     /**
       
   525      * From CFepUiBaseCtrl
       
   526      * Handle pointer move event
       
   527      *
       
   528      * @since S60 V4.0
       
   529      * @param aPoint The point position relative the layout
       
   530      * @return The control which handles the event.     
       
   531      */                  
       
   532     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint);
       
   533 
       
   534     /**
       
   535      * Get transparency factor
       
   536      *
       
   537      * @since S60 V4.0
       
   538      * @return The transparency factor    
       
   539      */ 
       
   540     inline TUint8 TransparencyFactor();
       
   541 
       
   542 private:
       
   543     /**
       
   544      * Set the clip region for drawing. If the region is set, drawing will only happens
       
   545      * inside the hwr window.
       
   546      *
       
   547      * @since S60 V5.0
       
   548      */ 
       
   549     inline void SetClipRegion();
       
   550     
       
   551     /**
       
   552      * Cancel clip region for drawing. If clip region is not set, some stroke may be drawn
       
   553      * outside of hwr window due to the pen size.
       
   554      *
       
   555      * @since S60 V5.0
       
   556      */     
       
   557     inline void CancelClipRegion();
       
   558 
       
   559     
       
   560     //from class CHwrWndBase
       
   561     /**
       
   562      * From CHwrWndBase
       
   563      * Draw point
       
   564      *
       
   565      * @since S60 V4.0
       
   566      * @param aPoint The point to be drawn
       
   567      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   568      * @return The affected rect
       
   569      */        
       
   570     virtual TRect DrawPoint(const TPoint& aPoint,TBool aDrawFlag = ETrue);
       
   571     
       
   572     /**
       
   573      * From CHwrWndBase
       
   574      * Draw line
       
   575      *
       
   576      * @since S60 V4.0
       
   577      * @param aPt1 The start point
       
   578      * @param aPt2 The end point
       
   579      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   580      * @return The affected rect
       
   581      */        
       
   582     virtual TRect DrawLine(const TPoint& aPt1,const TPoint& aPt2,TBool aDrawFlag);
       
   583 
       
   584     //from base class CHwrWndBase
       
   585     /**
       
   586      * From CHwrWndBase
       
   587      * Draw stroke
       
   588      *
       
   589      * @since S60 V4.0
       
   590      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   591      * @return The affected rect
       
   592      */
       
   593     virtual IMPORT_C TRect DrawStroke(TBool aDrawFlag);
       
   594 	
       
   595     /**      
       
   596      * Draw frame
       
   597      *
       
   598      * @since S60 V4.0
       
   599      * @param aFrameRect frame rect
       
   600      * @return None
       
   601      */	
       
   602 	virtual void DrawFrame( const TRect& aFrameRect );
       
   603 private:
       
   604     /**
       
   605      * mask pen color
       
   606      */
       
   607     TRgb iMaskPenColor;
       
   608 
       
   609     /**
       
   610      * a Flag to show whether we use full screen. 
       
   611      * In fullscreen mode, we don't draw backgroud
       
   612      */
       
   613     TBool iIsFullScreen;
       
   614 
       
   615     /** 
       
   616      * A flag to indicate whether the trace could be draw outside of the hwr window.
       
   617      */
       
   618     TBool iTraceOutsideWindowFlag;
       
   619     
       
   620     /**
       
   621      * The transparency factor. 255 stands for full transparent and 0 for opaque
       
   622      */
       
   623     TUint8 iTransparencyFactor;
       
   624 
       
   625     /**
       
   626      * Pen trace decorator.
       
   627      * Own.
       
   628      */
       
   629     CPeninputPenTraceDecorator* iPenTraceDecorator;
       
   630     };
       
   631 //end of class CTransparentHwrWnd
       
   632 
       
   633 /**
       
   634  *  This is the class definition for the transparent window with guide line
       
   635  *
       
   636  *  @lib peninputcommonctrls.lib
       
   637  *  @since S60 v3.2
       
   638  */
       
   639 class CTransparentHwrWndExt : public CTransparentHwrWnd
       
   640     {
       
   641     
       
   642 public:
       
   643     /**
       
   644      * Pen input guide line style
       
   645      */
       
   646     enum TGuideLineStyle
       
   647         {
       
   648         EGuideLineNone               = 0,
       
   649         EGuideLineTop                = 1,
       
   650         EGuideLineBottom             = 2,
       
   651         EGuideLineBoth               = 3
       
   652         };
       
   653         
       
   654     /**
       
   655      * Factory function.        
       
   656      *
       
   657      * @since S60 V4.0        
       
   658      * @param aRect The rectangle area for this control
       
   659      * @param aUiLayout Ui layout who contains this control.Ownership not transferred
       
   660      * @param aControlId control Id
       
   661      * @param aFullScreenFlag Fullscreen window flag. 
       
   662      *          ETrue if it's fullscreen window.
       
   663      * @param aShowGuideLine Show guide line or not
       
   664      * @return An instance of CTransparentHwrWndExt class        
       
   665      */                           
       
   666     IMPORT_C static CTransparentHwrWndExt* NewL( const TRect& aRect,
       
   667                                                  CFepUiLayout* aUiLayout,
       
   668                                                  TInt aControlId,
       
   669                                                  TBool aFullScreenFlag=EFalse, 
       
   670                                                  TBool aShowGuideLine=ETrue );
       
   671 
       
   672 
       
   673     /**
       
   674      * Destructor.
       
   675      *
       
   676      * @since S60 V4.0
       
   677      */
       
   678     IMPORT_C virtual ~CTransparentHwrWndExt();
       
   679 
       
   680         
       
   681     //from class CHwrWndBase
       
   682     /**
       
   683      * From MPenUiLayoutBase       
       
   684      * OnDeActivate. Called by owner when the layout is going to be hidden
       
   685      *
       
   686      * @since S60 v4.0
       
   687      */ 
       
   688     IMPORT_C void OnDeActivate();
       
   689     
       
   690     /**
       
   691      * Hide or show guide line
       
   692      *
       
   693      * @since S60 v3.2
       
   694      * @param aHideFlag The hide/show flag of guide line 
       
   695      * @return None
       
   696      */    
       
   697     IMPORT_C void HideGuideLine( TBool aHideFlag );
       
   698     
       
   699     /**
       
   700      * Set guide line style
       
   701      *
       
   702      * @since S60 v3.2
       
   703      * @param aGuideLineStyle The guide line style
       
   704      * @return None
       
   705      */
       
   706     IMPORT_C void SetGuideLineStyle( TInt aGuideLineStyle );
       
   707     
       
   708     /**
       
   709      * Set top guide line position
       
   710      *
       
   711      * @since S60 v3.2
       
   712      * @param aLeftTop The Left Top position of top line
       
   713      * @param aRightBottom The Right Bottom position of top line
       
   714      * @return None
       
   715      */    
       
   716     IMPORT_C void SetTopGuideLinePosition(const TPoint& aLeftTop, const TPoint& aRightBottom);
       
   717 
       
   718     /**
       
   719      * Set bottom guide line position
       
   720      *
       
   721      * @since S60 v3.2
       
   722      * @param aLeftTop The Left Top position of bottom line
       
   723      * @param aRightBottom The Right Bottom position of bottom line
       
   724      * @return None
       
   725      */    
       
   726     IMPORT_C void SetBottomGuideLinePosition(const TPoint& aLeftTop, const TPoint& aRightBottom);
       
   727 
       
   728     /**
       
   729      * Refresh the curent control aera
       
   730      *
       
   731      * @since S60 v3.2
       
   732      * @return None
       
   733      */
       
   734     IMPORT_C void RefreshUI();
       
   735 
       
   736     /**
       
   737      * Set guide line color
       
   738      *
       
   739      * @since S60 v3.2
       
   740      * @param aColor The new color of guide line
       
   741      * @return None
       
   742      */
       
   743     IMPORT_C void SetGuideLineColor( const TRgb& aColor );
       
   744 
       
   745     /**
       
   746      * Set guide line width
       
   747      *
       
   748      * @since S60 v3.2
       
   749      * @param aWidth The new width of guide line
       
   750      * @return None
       
   751      */
       
   752     IMPORT_C void SetGuideLineWidth( TInt aWidth );
       
   753         
       
   754     //from base class CFepUiBaseCtrl   
       
   755     /**
       
   756      * From CFepUiBaseCtrl
       
   757      * Draw control.
       
   758      *
       
   759      * @since S60 V4.0
       
   760      */               
       
   761     IMPORT_C virtual void Draw();
       
   762  
       
   763     /**
       
   764      * From CFepUiBaseCtrl
       
   765      * Call back function when layout starts dragging
       
   766      *
       
   767      * @since S60 V4.0
       
   768      */
       
   769     IMPORT_C void OnLayoutDraggingStart();
       
   770     
       
   771     /**
       
   772      * Called when character timer out, or write text from the begining again.
       
   773      * @since S60 V4.0
       
   774      */                                       
       
   775     virtual void EndStrokeAndClearL(); 
       
   776     
       
   777     /**
       
   778      * From CFepUiBaseCtrl
       
   779      * Cancel pointer down event.
       
   780      * This will be called when a control has pointer down but pointer up 
       
   781      * event happens in other ways.
       
   782      *
       
   783      * @since S60 V4.0
       
   784      * @param aFocusedFlag ETrue if got focused, otherwise EFalse
       
   785      */                                
       
   786     virtual void CancelPointerDownL();
       
   787     
       
   788     /**
       
   789      * Enable/Disable fade
       
   790      * @since S60 V4.0
       
   791      */
       
   792     inline void SetEnableFade( TBool aEnable );
       
   793     inline void SetFadingSpeed(TInt aFadingSpeed);
       
   794     
       
   795     IMPORT_C virtual void CancelCharWriting();
       
   796 protected:
       
   797     /**
       
   798      * Default constructor.
       
   799      *
       
   800      * @since S60 V4.0
       
   801      * @param aRect The rectangle area for this control
       
   802      * @param aUiLayout Ui layout who contains this control.Ownership not transferred
       
   803      * @param aControlId control Id
       
   804      * @param aFullScreenFlag Fullscreen window flag. ETrue if it's fullscreen window.
       
   805      * @param aShowGuideLine Show guide line or not     
       
   806      * @return An instance of CTransparentHwrWnd class        
       
   807      */                               
       
   808     IMPORT_C CTransparentHwrWndExt( const TRect& aRect, 
       
   809                                     CFepUiLayout* aUiLayout,
       
   810                                     TInt aControlId, 
       
   811                                     TBool aFullScreenFlag, 
       
   812                                     TBool aShowGuideLine );
       
   813 
       
   814     /**
       
   815      * Second phrase constructor.
       
   816      *
       
   817      * @since S60 V4.0
       
   818      */
       
   819     IMPORT_C void ConstructL();                                    
       
   820     
       
   821     /**
       
   822      * From CFepUiBaseCtrl
       
   823      * Handle pointer down event
       
   824      *
       
   825      * @since S60 V4.0
       
   826      * @param aPoint The point position relative the layout
       
   827      * @return The control which handles the event.     
       
   828      */                                        
       
   829     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint);
       
   830         
       
   831     /**
       
   832      * From CFepUiBaseCtrl
       
   833      * Handle pointer up event
       
   834      *
       
   835      * @since S60 V4.0
       
   836      * @param aPoint The point position relative the layout
       
   837      * @return The control which handles the event.     
       
   838      */                  
       
   839     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint);
       
   840     
       
   841     /**
       
   842      * From CFepUiBaseCtrl
       
   843      * Handle pointer move event
       
   844      *
       
   845      * @since S60 V4.0
       
   846      * @param aPoint The point position relative the layout
       
   847      * @return The control which handles the event.     
       
   848      */                  
       
   849     IMPORT_C virtual CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint);
       
   850     
       
   851 private: 
       
   852 
       
   853     //from class CHwrWndBase
       
   854     /**
       
   855      * From CHwrWndBase
       
   856      * Draw point
       
   857      *
       
   858      * @since S60 V4.0
       
   859      * @param aPoint The point to be drawn
       
   860      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   861      * @return The affected rect
       
   862      */        
       
   863     virtual TRect DrawPoint(const TPoint& aPoint,TBool aDrawFlag);
       
   864     
       
   865     /**
       
   866      * From CHwrWndBase
       
   867      * Draw line
       
   868      *
       
   869      * @since S60 V4.0
       
   870      * @param aPt1 The start point
       
   871      * @param aPt2 The end point
       
   872      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   873      * @return The affected rect
       
   874      */        
       
   875     virtual TRect DrawLine(const TPoint& aPt1,const TPoint& aPt2,TBool aDrawFlag = ETrue);
       
   876 
       
   877     //from base class CHwrWndBase
       
   878     /**
       
   879      * From CHwrWndBase
       
   880      * Draw stroke
       
   881      *
       
   882      * @since S60 V4.0
       
   883      * @param aDrawFlag Flag to tell whether to draw or erase stroke
       
   884      * @return The affected rect
       
   885      */
       
   886     IMPORT_C virtual TRect DrawStroke(TBool aDrawFlag);
       
   887     
       
   888     /**
       
   889      * Update hwr window
       
   890      *
       
   891      * @since S60 V4.0
       
   892      * @param aAny The pointer the hwr window
       
   893      * @return The error code
       
   894      */
       
   895     static TInt UpdateShownArea( TAny* aAny );
       
   896     
       
   897     /**
       
   898      * Update hwr window
       
   899      *
       
   900      * @since S60 V4.0
       
   901      * @return None
       
   902      */
       
   903     void DoUpdateShownArea();
       
   904 
       
   905     void DrawGuidingLine();
       
   906 private:
       
   907     /**
       
   908      * Show guide line or hide
       
   909      */
       
   910     TBool iShowGuideLine;
       
   911 
       
   912     /**
       
   913      * The guide line style
       
   914      */    
       
   915     TInt iGuideLineStyle;    
       
   916 
       
   917     /**
       
   918      * The top left of top guide line
       
   919      */
       
   920     TPoint iTlOfTopGuideLine;
       
   921 
       
   922     /**
       
   923      * The bottom right of top guide line
       
   924      */
       
   925     TPoint iBrOfTopGuideLine;
       
   926 
       
   927     /**
       
   928      * The top left of top guide line
       
   929      */
       
   930     TPoint iTlOfBottomGuideLine;
       
   931 
       
   932     /**
       
   933      * The bottom right of top guide line
       
   934      */
       
   935     TPoint iBrOfBottomGuideLine;
       
   936     
       
   937     /**
       
   938      * The guide line color
       
   939      */    
       
   940     TRgb iGuideLineColor;
       
   941 
       
   942     /**
       
   943      * The guide line withd
       
   944      */    
       
   945     TInt iGuideLineWidth;
       
   946     
       
   947     /**
       
   948      * Stoke end mark
       
   949      */
       
   950     TPoint iStrokeEndMark;
       
   951     
       
   952     /**
       
   953      * Fade timer
       
   954      * Own.
       
   955      */
       
   956     CPeriodic* iFadeTimer;
       
   957     
       
   958     /**
       
   959      * The global setttings repository
       
   960      * Own
       
   961      */
       
   962     CRepository* iGSRepository;
       
   963     
       
   964     /**
       
   965      * The begin time of fade
       
   966      */
       
   967     TInt iFadeBeginTime;
       
   968     
       
   969     /**
       
   970      * The interval time of fade
       
   971      */
       
   972     TInt iFadeIntervalTime;
       
   973     
       
   974     /**
       
   975      * The shown trace data
       
   976      */
       
   977     RArray<TPoint> iListOfShownPoints;
       
   978     
       
   979     /**
       
   980      * The begin position of fade
       
   981      */ 
       
   982     TInt iFadeBeginPos;
       
   983 	
       
   984     /**
       
   985      * The end position of fade
       
   986      */   
       
   987 	TInt iFadeEndPos;
       
   988 	
       
   989     /**
       
   990      * The max position of fade
       
   991      */ 
       
   992 	TInt iFadeMaxPos;
       
   993 	
       
   994     /**
       
   995      * The flag of fade enable
       
   996      */ 
       
   997 	TBool iEnableFade;
       
   998 	
       
   999     /**
       
  1000      * Reserved item1
       
  1001      */
       
  1002      TInt iReserved1;
       
  1003      
       
  1004     /**
       
  1005      * Reserved item2
       
  1006      */
       
  1007      TInt iReserved2;	
       
  1008     };
       
  1009 //end of class CTransparentHwrWndExt
       
  1010   
       
  1011 #include <peninputlayouthwrwnd.inl>
       
  1012 #endif //C_CHWRWNDBASE_H