textinput/peninputgenericvkb/inc/peninputgenericvkblayout.h
changeset 0 eb1f2e154e89
child 12 5e18d8c489d6
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:  generic VKB layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPENINPUTGENERICVKBLAYOUT_H
       
    20 #define C_CPENINPUTGENERICVKBLAYOUT_H
       
    21 
       
    22 // User includes
       
    23 #include <AknFepGlobalEnums.h>
       
    24 #include "peninputcommonlayoutext.h"
       
    25 
       
    26 /**
       
    27  *  Pen input VKB layout class
       
    28  *  This class define the behaviors of VKB layout
       
    29  *
       
    30  *  @lib peninputgenericvkb.lib
       
    31  *  @since S60 v3.2
       
    32  */
       
    33 class CPeninputGenericVkbLayout : public CPeninputCommonLayoutExt
       
    34     {
       
    35     
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Two-phased constructor
       
    40      *
       
    41      * @since S60 v3.2
       
    42      * @param aLafEnv The LAF enviroment
       
    43      * @param aLayoutOwner The owner of layout
       
    44      * @param aInitData Init data of layout
       
    45      * @return The pointer to CPeninputGenericVkbLayout object
       
    46      */
       
    47     static CPeninputGenericVkbLayout* NewL( MLayoutOwner* aLayoutOwner, 
       
    48                                             const TAny* aInitData, TBool aIsFsq
       
    49                                              );
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @return None
       
    56      */
       
    57     virtual ~CPeninputGenericVkbLayout();
       
    58 
       
    59     /**
       
    60      * Check if FSQ is opened and ITI is enabled.
       
    61      *
       
    62      * @return if ETrue: current input method is FSQ and ITI is enabled.
       
    63      */
       
    64     inline TBool IsEnableITIOnFSQ()
       
    65         {
       
    66         return iITIEnabled && iLayoutType == EPluginInputModeFSQ;
       
    67         };
       
    68 
       
    69 // From base class CPeninputCommonLayout
       
    70 
       
    71     /**
       
    72      * From CPeninputCommonLayout
       
    73      * Handle layout command event
       
    74      *
       
    75      * @since S60 v3.2
       
    76      * @param aCmd Command Id
       
    77      * @param aData Data for command
       
    78      * @return Errors when return value smaller than zero    
       
    79      */
       
    80     TInt HandleCommand( TInt aCmd, TUint8* aData );
       
    81 
       
    82     /**
       
    83      * From CPeninputCommonLayout
       
    84      * Handle control event
       
    85      *
       
    86      * @since S60 v3.2
       
    87      * @param aEventType event type
       
    88      * @param aCtrl Controler
       
    89      * @param aEventData The event data
       
    90      * @return None    
       
    91      */
       
    92     void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData );
       
    93 
       
    94     void HandleAppInfoChange(const TDesC& aInfo, TPeninputAppInfo aType); 
       
    95    
       
    96     /* Teleca change begin, 21.05.2009 ssal */
       
    97     static TInt HideByteWarningBubble(TAny* aPointer);
       
    98     void HideByteWarningBubble();
       
    99 	/* Teleca change end, 21.05.2009 ssal */ 
       
   100 protected:
       
   101 
       
   102     /**
       
   103      * Constructor
       
   104      *
       
   105      * @since S60 v3.2
       
   106      * @param aLafEnv The LAF enviroment
       
   107      * @param aLayoutOwner The owner of layout
       
   108      * @return None
       
   109      */
       
   110     CPeninputGenericVkbLayout( MLayoutOwner* aLayoutOwner );
       
   111      
       
   112 // From base class CPeninputCommonLayout
       
   113 
       
   114     /**
       
   115      * From CPeninputCommonLayout
       
   116      * Factory method for creation of layout window. The decision which 
       
   117      * layout window(VKB or HWR) is created will be postboned in subclasses 
       
   118      * of this class
       
   119      *
       
   120      * @since S60 v3.2
       
   121      * @return None
       
   122      */
       
   123     void CreateLayoutWindowL();
       
   124 
       
   125     /**
       
   126      * From CPeninputCommonLayout
       
   127      * Factory method for creation resource config. It is enough at present 
       
   128      * to create and initialize resource config. Any necessary extension 
       
   129      * will be implemented in subclasses
       
   130      * 
       
   131      * @since S60 v3.2
       
   132      * @return None
       
   133      */
       
   134     void CreateDataMgrL( const TAny* aInitData );
       
   135 
       
   136     /**
       
   137      * From CPeninputCommonLayout
       
   138      * Get the layout type, VKB or HWR, child class must rewrite the function
       
   139      * 
       
   140      * @since S60 v3.2
       
   141      * @return The layout type
       
   142      */
       
   143      TInt LayoutType();
       
   144 
       
   145      TInt SizeChanged( const TAny* aData );
       
   146 
       
   147     /**
       
   148      * SemiTransparencyRequired. Tell whether this layout require transparency.
       
   149      * This is to save memory used in mask bitmap. If transparency not deeded,
       
   150      * We use black-white bitmap.
       
   151      *
       
   152      * @since S60 v3.2
       
   153      * @return ETrue if layout require transparency, otherwise EFalse.
       
   154      */
       
   155     TBool SemiTransparencyRequired();
       
   156 protected:
       
   157 
       
   158     /**
       
   159      * Second-phased constructor
       
   160      *
       
   161      * @since S60 v3.2
       
   162      * @param aInitData Init data of layout
       
   163      * @return None
       
   164      */
       
   165      void ConstructL( const TAny *aInitData, TBool aIsFsq );
       
   166      
       
   167 private: 
       
   168     void HandleVirtualKeyUpL(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData);
       
   169 
       
   170     /**
       
   171      * Handle show tooltip command
       
   172      *
       
   173      *     
       
   174      * @aData pointer is sent from FEP, point to a TPtrC
       
   175      * @return None
       
   176      */    
       
   177     void HandleShowTooltipCmdL( TUint8* aData );
       
   178     
       
   179     /**
       
   180      * Handle show candidate list command
       
   181      *
       
   182      *     
       
   183      * @aData pointer is sent from FEP, point to a TPtrC
       
   184      * @return None
       
   185      */    
       
   186     void HandleShowCandidateListCmdL( TUint8* aData );
       
   187     
       
   188     /**
       
   189      * Read text stored in a block of memory into HBufC
       
   190      *
       
   191      *     
       
   192      * @aData aStartPtr the starting address of a block of memory with a string in it
       
   193      * @aLength The length of the string
       
   194      * @return pointer of a HBufC storing the string in it
       
   195      */ 
       
   196     HBufC* ReadTextInfoHBufCL( TUint16* aStartPtr, TInt aLength );
       
   197         
       
   198 private:
       
   199 
       
   200     TInt iLayoutType;     
       
   201     TBool iInEditWordQueryDlg;
       
   202     
       
   203     /*
       
   204     * Indicate if ITI is enabled.
       
   205     */    
       
   206     TBool iITIEnabled;
       
   207     /* Teleca change begin, 21.05.2009 ssal */
       
   208     CPeriodic* iInfoTimer;
       
   209     /* Teleca change end, 21.05.2009 ssal */   
       
   210     };
       
   211 
       
   212 
       
   213 /**
       
   214  *  Pen input VKB layout implementation class
       
   215  *  This class define the implementation interface of VKB layout
       
   216  *
       
   217  *  @lib peninputgenericvkb.lib
       
   218  *  @since S60 v3.2
       
   219  */
       
   220 class CPeninputGenericVkbLayoutImp : public CFepUiLayoutInterface
       
   221     {
       
   222       
       
   223 public:
       
   224 
       
   225     /**
       
   226      * Two-phased constructor
       
   227      *
       
   228      * @since S60 v3.2
       
   229      * @param aInitParams Init data for layout
       
   230      * @return Pointer to created CPeninputGenericVkbLayoutImp object
       
   231      */
       
   232     static CPeninputGenericVkbLayoutImp* NewL( TAny* aInitParams );
       
   233     static CPeninputGenericVkbLayoutImp* NewFsqL( TAny* aInitParams );
       
   234 
       
   235     /**
       
   236      * Destructor
       
   237      *
       
   238      * @since S60 v3.2
       
   239      * @return None
       
   240      */    
       
   241     virtual ~CPeninputGenericVkbLayoutImp();
       
   242 
       
   243 // From base class CFepUiLayoutInterface
       
   244 
       
   245     /**
       
   246      * From CFepUiLayoutInterface
       
   247      * Create fep ui layout
       
   248      *
       
   249      * @since S60 v3.2
       
   250      * @param aLayoutOwner The layout owner
       
   251      * @param aData The data for creating layout
       
   252      * @return Pointer to created CFepUiLayout object
       
   253      */
       
   254     CFepUiLayout* CreateFepUiLayoutL( MLayoutOwner* aLayoutOwner,
       
   255                                       const TAny* aData );
       
   256 
       
   257 private:
       
   258 
       
   259     /**
       
   260      * Constructor
       
   261      *
       
   262      * @since S60 v3.2
       
   263      * @return None
       
   264      */          
       
   265     CPeninputGenericVkbLayoutImp();
       
   266 
       
   267     /**
       
   268      * Second-phased constructor
       
   269      *
       
   270      * @since S60 v3.2
       
   271      * @return None
       
   272      */          
       
   273     void Construct( TBool aIsFsq );
       
   274  
       
   275  private:
       
   276  
       
   277     TBool iIsFsq;   
       
   278     };
       
   279 
       
   280 #endif // C_CPENINPUTGENERICVKBLAYOUT_H