textinput/peninputhwrfscn/inc/peninputhwrfscnwritingbox.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Implementation for chinese peninput full screen hwr
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CPENINPUTHWRFSCNWRITINGBOX_H__
       
    20 #define __CPENINPUTHWRFSCNWRITINGBOX_H__
       
    21 
       
    22 //USER INCLUDES
       
    23 #include "peninputhwrfscnbasepanel.h"
       
    24 #include "peninputlayouthwrwnd.h"
       
    25 
       
    26 /**
       
    27 * Class CPeninputHwrfscnWritingBox
       
    28 *
       
    29 * Inherited from CPeninputHwrfscnBasePanel and wrap a transparent hwr window.
       
    30 * Handle the hwr writing events.
       
    31 *
       
    32 * @lib peninputhwrfscn.lib
       
    33 * @since S60 v5.0
       
    34 */
       
    35 class CPeninputHwrfscnWritingBox : public CPeninputHwrfscnBasePanel
       
    36 	{
       
    37 public:
       
    38     /**
       
    39     * factory function
       
    40     *
       
    41     * @since S60 v5.0
       
    42     * @param aLayout The CPeninputHwrfscnLayout pointer.
       
    43     */
       
    44     static CPeninputHwrfscnWritingBox* NewL(  CPeninputHwrfscnLayout* aLayout );
       
    45     
       
    46     /**
       
    47     * Destructor
       
    48     *
       
    49     * @since S60 v5.0
       
    50     */
       
    51     ~CPeninputHwrfscnWritingBox();
       
    52    
       
    53 public:	
       
    54 	/**
       
    55 	* Make visible
       
    56 	*
       
    57 	* @since S60 v5.0
       
    58 	* @param aVisible ETrue will make it visible or EFalse otherwise
       
    59 	*/
       
    60 	void Show( TBool aVisible );
       
    61 	
       
    62 	/**
       
    63 	* Draw control
       
    64 	*
       
    65 	* @since S60 v5.0
       
    66 	*/
       
    67 	virtual void Draw();
       
    68 	
       
    69 	/**
       
    70 	* Inherited from MEventObserver
       
    71 	* 
       
    72 	* @since S60 v5.0
       
    73     * @param aEventType The event type
       
    74     * @param aCtrl The control who sends the event
       
    75     * @param aEventData The event data 		
       
    76 	*
       
    77 	*/
       
    78 	virtual void HandleControlEvent( TInt aEventType, CFepUiBaseCtrl* aCtrl, 
       
    79 	     const TDesC& aEventData );
       
    80     
       
    81     /**
       
    82     * from CPeninputHwrfscnBasePanel
       
    83     *
       
    84     * @since S60 v5.0
       
    85     * @param aCmd Command Id
       
    86     * @param aData Data for command
       
    87     */
       
    88     virtual void HandleCommand( TInt aCommand, TUint8* aData );
       
    89     
       
    90     /**
       
    91     * from MPeninputHwrfscnPropertySubscriber
       
    92     * Check if the property could be changed before changing it.
       
    93     
       
    94     * @since S60 v5.0
       
    95     * @param aProperty One of @see TPeninputHwrfscnProperty changed
       
    96     * @return TBool ETrue if the property needed to be changed, EFalse otherwise
       
    97     */
       
    98     virtual TBool BeforePropertyChangedL(               
       
    99         MPeninputHwrfscnPropertySubscriber::TPeninputHwrfscnProperty aProptery );
       
   100     
       
   101     /**
       
   102     * from MPeninputHwrfscnPropertySubscriber
       
   103     * Notify the property subscriber the property changed
       
   104     *
       
   105     * @since S60 v5.0
       
   106     * @param aProperty One of @see TPeninputHwrfscnProperty changed
       
   107     */
       
   108     virtual void PropertyChangedL( 
       
   109         MPeninputHwrfscnPropertySubscriber::TPeninputHwrfscnProperty aProptery );
       
   110 
       
   111     /**
       
   112     * Size changed
       
   113     *
       
   114     * @since S60 v5.0
       
   115     */
       
   116     void SizeChanged();
       
   117     
       
   118     /**
       
   119     * Laf changed
       
   120     *
       
   121     * @since S60 v5.0
       
   122     */
       
   123     void LafChanged();		
       
   124     
       
   125     /**
       
   126     * Cancel the writing. It will stops the timer and clear all strokes
       
   127     *
       
   128     * @since S60 v5.0
       
   129     */
       
   130     void CancelCharWriting();
       
   131     
       
   132 private:
       
   133     /**
       
   134     * The constructor.
       
   135     * 
       
   136     * @since S60 v5.0
       
   137     * @param aLayout The CPeninputHwrfscnLayout pointer.
       
   138     */
       
   139     CPeninputHwrfscnWritingBox( CPeninputHwrfscnLayout* aLayout );
       
   140     
       
   141     /**
       
   142     * 2nd constructor.
       
   143     *
       
   144     * @since S60 v5.0
       
   145     */
       
   146     void ConstructL();
       
   147     	
       
   148 private:
       
   149     /**
       
   150     * Handle hwr writng timer out event
       
   151     *
       
   152     * @since S60 v5.0
       
   153     */
       
   154     void OnStrokeCharacterTimerOut();
       
   155     
       
   156     /**
       
   157     * Handle hwr string writing event
       
   158     *
       
   159     * @since S60 v5.0
       
   160     */
       
   161     void OnStrokeStarted();
       
   162     
       
   163     /**
       
   164     * Handle hwr storke finished event
       
   165     *
       
   166     * @since S60 v5.0
       
   167     */
       
   168     void OnStrokeFinished();
       
   169     
       
   170     /**
       
   171      * Set FSHWR writting speed.
       
   172      *
       
   173      * @since S60 v5.0
       
   174      * @param aCharDelay The submit character timer in micro seconds
       
   175      * @return None
       
   176      */
       
   177     void SetWritingSpeed( const TTimeIntervalMicroSeconds32& aCharDelay );
       
   178     
       
   179     /**
       
   180      * Set FSHWR trail drawing pen size.
       
   181      *
       
   182      * @since S60 v5.0
       
   183      * @param aSize New pen size
       
   184      * @return None
       
   185      */
       
   186     void SetPenSize( const TSize aSize );
       
   187     
       
   188     /**
       
   189      * Set FSHWR trail drawing pen color.
       
   190      *
       
   191      * @since S60 v5.0
       
   192      * @param aCol New pen color
       
   193      * @return None
       
   194      */
       
   195     void SetPenColor( const TRgb aCol );
       
   196     
       
   197 private:
       
   198     /**
       
   199     * The hwr window
       
   200     *
       
   201     */
       
   202     CTransparentHwrWnd* iHwrWnd;
       
   203     
       
   204     /**
       
   205     * The stored stroke list each time storke finished
       
   206     *
       
   207     */
       
   208     RArray<TPoint> iStrokeList;
       
   209     };
       
   210 	
       
   211 #endif	//__CPENINPUTHWRFSCNWRITINGBOX_H__