textinput/peninputgenericvkb/inc/peninputgenericvkblayout.h
branchRCL_3
changeset 44 ecbabf52600f
child 50 5a1685599b76
equal deleted inserted replaced
43:ebd48d2de13c 44:ecbabf52600f
       
     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     TBool TranslateMirrorUnicode( TUint16 aInputCode, TUint16& aOutputCode );
       
   199         
       
   200 private:
       
   201 
       
   202     TInt iLayoutType;     
       
   203     TBool iInEditWordQueryDlg;
       
   204     
       
   205     /*
       
   206     * Indicate if ITI is enabled.
       
   207     */    
       
   208     TBool iITIEnabled;
       
   209     /* Teleca change begin, 21.05.2009 ssal */
       
   210     CPeriodic* iInfoTimer;
       
   211     /* Teleca change end, 21.05.2009 ssal */   
       
   212     };
       
   213 
       
   214 
       
   215 /**
       
   216  *  Pen input VKB layout implementation class
       
   217  *  This class define the implementation interface of VKB layout
       
   218  *
       
   219  *  @lib peninputgenericvkb.lib
       
   220  *  @since S60 v3.2
       
   221  */
       
   222 class CPeninputGenericVkbLayoutImp : public CFepUiLayoutInterface
       
   223     {
       
   224       
       
   225 public:
       
   226 
       
   227     /**
       
   228      * Two-phased constructor
       
   229      *
       
   230      * @since S60 v3.2
       
   231      * @param aInitParams Init data for layout
       
   232      * @return Pointer to created CPeninputGenericVkbLayoutImp object
       
   233      */
       
   234     static CPeninputGenericVkbLayoutImp* NewL( TAny* aInitParams );
       
   235     static CPeninputGenericVkbLayoutImp* NewFsqL( TAny* aInitParams );
       
   236     static CPeninputGenericVkbLayoutImp* NewPrtFsqL( TAny* aInitParams );
       
   237 
       
   238     /**
       
   239      * Destructor
       
   240      *
       
   241      * @since S60 v3.2
       
   242      * @return None
       
   243      */    
       
   244     virtual ~CPeninputGenericVkbLayoutImp();
       
   245 
       
   246 // From base class CFepUiLayoutInterface
       
   247 
       
   248     /**
       
   249      * From CFepUiLayoutInterface
       
   250      * Create fep ui layout
       
   251      *
       
   252      * @since S60 v3.2
       
   253      * @param aLayoutOwner The layout owner
       
   254      * @param aData The data for creating layout
       
   255      * @return Pointer to created CFepUiLayout object
       
   256      */
       
   257     CFepUiLayout* CreateFepUiLayoutL( MLayoutOwner* aLayoutOwner,
       
   258                                       const TAny* aData );
       
   259 
       
   260 private:
       
   261 
       
   262     /**
       
   263      * Constructor
       
   264      *
       
   265      * @since S60 v3.2
       
   266      * @return None
       
   267      */          
       
   268     CPeninputGenericVkbLayoutImp();
       
   269 
       
   270     /**
       
   271      * Second-phased constructor
       
   272      *
       
   273      * @since S60 v3.2
       
   274      * @return None
       
   275      */          
       
   276     void Construct( TBool aIsFsq );
       
   277  
       
   278  private:
       
   279  
       
   280     TBool iIsFsq;   
       
   281     };
       
   282 
       
   283 #endif // C_CPENINPUTGENERICVKBLAYOUT_H