textinput/peninputgenerichwr/inc/peninputgenerichwrdatamgr.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  peninput HWR data manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PENINPUTGENERICHWRDATAMGR_H
       
    20 #define C_PENINPUTGENERICHWRDATAMGR_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 #include <peninputdatamgr.h>
       
    26 
       
    27 // Forward decalaration
       
    28 class MPeninputLayoutContext;
       
    29 class CPeninputGenericRecognizer;
       
    30 class CPtiEngine;
       
    31 /**
       
    32  *  Peninput HWR data management class
       
    33  *  This class manager the data of HWR
       
    34  *  
       
    35  *  @lib peninputgenerichwr.lib
       
    36  *  @since S60 v3.2
       
    37  */
       
    38 class CPeninputGenericHwrDataMgr : public CPeninputDataMgr
       
    39     {
       
    40 
       
    41 public:
       
    42   
       
    43     /**
       
    44      * The HWR-pen's data struct
       
    45      */
       
    46     struct THandWritingPenData
       
    47         {
       
    48         TInt iGuideLineOn;
       
    49         TSize iPenSize;
       
    50         TRgb iPenColor;
       
    51         TInt iWritingSpeed;
       
    52         TInt iFadingSpeed;
       
    53         CPeninputGenericRecognizer* iRecognizer; 
       
    54         };
       
    55     
       
    56     /**
       
    57      * Two-phased constructor
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @param aContext The layout context
       
    61      * @return The pointer to CPeninputGenericHwrDataMgr object
       
    62      */
       
    63     static CPeninputGenericHwrDataMgr* NewL( 
       
    64         MPeninputLayoutContext* aContext ,CPtiEngine* aPtiEngine);
       
    65     
       
    66     /**
       
    67      * Two-phased constructor
       
    68      *
       
    69      * @since S60 v3.2
       
    70      * @param aContext The layout context
       
    71      * @return The pointer to CPeninputGenericHwrDataMgr object
       
    72      */
       
    73     static CPeninputGenericHwrDataMgr* NewLC(
       
    74         MPeninputLayoutContext* aContext ,CPtiEngine* aPtiEngine);
       
    75 
       
    76     /**
       
    77      * Destructor
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @return None
       
    81      */
       
    82     virtual ~CPeninputGenericHwrDataMgr();
       
    83 
       
    84 // From base class CPeninputDataMgr
       
    85 
       
    86     /**
       
    87      * From CPeninputDataMgr
       
    88      * Initialize the pen data
       
    89      *
       
    90      * @since S60 v3.2
       
    91      * @return None
       
    92      */
       
    93     void InitMore();
       
    94 
       
    95     /**
       
    96      * From CPeninputDataMgr
       
    97      * Call back function, which is called when some key changed
       
    98      *
       
    99      * @since S60 v3.2
       
   100      * @param aChangedKey The key whose value is changed
       
   101      * @return None
       
   102      */
       
   103     void HandleGSRepositoryChange( TInt aChangedKey );
       
   104 
       
   105     /**
       
   106      * From CPeninputDataMgr
       
   107      * Reset data contained in data manager
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @return None
       
   111      */
       
   112     void Reset();
       
   113     
       
   114     /**
       
   115      * From CPeninputDataMgr
       
   116      * get pen color according to the change of theme
       
   117      *
       
   118      * @since S60 v3.2
       
   119      * @return None
       
   120      */    
       
   121     TRgb GetPenTrailColor();
       
   122   
       
   123 protected:
       
   124 
       
   125     /**
       
   126      * Constructor
       
   127      *
       
   128      * @since S60 v3.2
       
   129      * @param aContext The layout context
       
   130      * @return None
       
   131      */
       
   132     CPeninputGenericHwrDataMgr( MPeninputLayoutContext* aContext );
       
   133     
       
   134     /**
       
   135      * Transfer the pen's writing speed
       
   136      *
       
   137      * @since S60 v3.2
       
   138      * @param aWritingSpeed The value of pen's writing speed
       
   139      * @return TInt value to indicating writing speed
       
   140      */
       
   141     TInt TransferWritingSpeed( TInt aWritingSpeed );
       
   142     
       
   143     /**
       
   144      * Notify HWR's engine to change the setting
       
   145      *
       
   146      * @since S60 v3.2
       
   147      * @param aType The key whose value will be set
       
   148      * @param aData The value will be set
       
   149      * @return None
       
   150      */
       
   151     void NotifyEngine( TPeninputDataType aType, TAny* aData );
       
   152     
       
   153     TAny* RequestData( TPeninputDataType aDataType );
       
   154     
       
   155     void SetData( TPeninputDataType aDataType, TAny* aData );
       
   156     
       
   157 private:
       
   158     
       
   159     /**
       
   160      * The HWR-pen's data
       
   161      */
       
   162     THandWritingPenData iPenData;
       
   163      
       
   164     /**
       
   165      * The pti engine
       
   166      * Ownership is deternimed by iOwnPtiEngine
       
   167      */    
       
   168     CPtiEngine* iPtiEngine;
       
   169     
       
   170     /**
       
   171      * The pti engine ownership flag
       
   172      */    
       
   173     TBool iOwnPtiEngine;
       
   174     
       
   175     TSize    iInputArea;
       
   176     
       
   177     TInt iHelpLine;
       
   178     
       
   179     TInt iBaseLine;
       
   180     };
       
   181 
       
   182 #endif // C_PENINPUTGENERICHWRDATAMGR_H