textinput/peninputvkbcn/ctrlinc/peninputvkbclientarea.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:  Implementation of the vkb client area
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CAKNFEPVKBCLIENTAREA_H
       
    20 #define C_CAKNFEPVKBCLIENTAREA_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <peninputlayoutctrlgroup.h>
       
    24 #include <peninputvkbctrlext.h>
       
    25 
       
    26 #include "peninputvkb.hrh"
       
    27 #include "peninputvkbwindow.h"
       
    28 #include "peninputvkbcnlafdatamgr.h"
       
    29 /** class forward decalaration */
       
    30 class CFepUiLayout;
       
    31 class CAknFepVkbCtrlPool;
       
    32 class CAknFepLayoutPool;
       
    33 class CAknFepVkbImLayout;
       
    34 class CPeninputVkbLayoutInfo;
       
    35 class MAknFepVkbDataProvider;
       
    36 class CPeninputVkbCtrlExt;
       
    37 class CAknFepVkbCompositionField;
       
    38 class CFepCtrlDropdownList;
       
    39 class CAknFepCtrlRangeBar;
       
    40 class CAknFepCtrlEventButton;
       
    41 class CFepLayoutEditAreaBase;
       
    42 class CAknFepVkbNumericKepMappingMgr;
       
    43 class CAknFepCtrlVkbLayout;
       
    44 class CPeninputCnGenericVkbLafMgr;
       
    45 
       
    46 // class declarations
       
    47 /**
       
    48  *  client area class
       
    49  *
       
    50  *  @lib peninputvkbcn.lib
       
    51  *  @since S60 v3.2
       
    52  */    
       
    53 class CAknFepVkbClientArea : public CControlGroup
       
    54     {    
       
    55 public:
       
    56 
       
    57     /**
       
    58      * Create one CAknFepVkbClientArea object
       
    59      *
       
    60      * @since S60 v3.2
       
    61      * @param aUiLayout The layout plugin
       
    62      * @param aControlId This control ID
       
    63      * @param aDataProvider The interface of data provider
       
    64      * @return The CFepCtrlDropdownList object.
       
    65      */  
       
    66     static CAknFepVkbClientArea* NewL(CFepUiLayout* aUiLayout, 
       
    67                                       TInt aControlId,
       
    68                                       MAknFepVkbDataProvider* aDataProvider,
       
    69                                       CPeninputCnGenericVkbLafMgr* aLafMgr);
       
    70 
       
    71     /**
       
    72      * Create one CAknFepVkbClientArea object
       
    73      *
       
    74      * @since S60 v3.2
       
    75      * @param aUiLayout The layout plugin
       
    76      * @param aControlId This control ID
       
    77      * @param aDataProvider The interface of data provider
       
    78      * @return The CFepCtrlDropdownList object.
       
    79      */      
       
    80     static CAknFepVkbClientArea* NewLC(CFepUiLayout* aUiLayout, 
       
    81                                        TInt aControlId,
       
    82                                        MAknFepVkbDataProvider* aDataProvider,
       
    83                                        CPeninputCnGenericVkbLafMgr* aLafMgr);
       
    84 
       
    85     /**
       
    86      * Destructor
       
    87      *
       
    88      * @since S60 v3.2
       
    89      * @return None.
       
    90      */   
       
    91     virtual ~CAknFepVkbClientArea();  
       
    92     
       
    93     /**
       
    94      * Size change function
       
    95      *
       
    96      * @since S60 v3.2
       
    97      * @return None.
       
    98      */       
       
    99     void SizeChanged();
       
   100 
       
   101     /**
       
   102      * Handle event 
       
   103      * @since Series 60 3.2
       
   104      * @param aEventType The event type
       
   105      * @param aCtrl The control who sends the event
       
   106      * @param aEventData The event data
       
   107      * @return None
       
   108      */
       
   109     void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData);
       
   110     
       
   111     /**
       
   112      * Change input method layout
       
   113      *
       
   114      * @since S60 v3.2
       
   115      * @param aRange The range defined in TAknFepVkbIMLayout
       
   116      * @param aChangeVkb The flag of changing vkb or not     
       
   117      * @return None.
       
   118      */
       
   119     void ChangeImLayout(TInt aImLayout, TBool aChangeVkb = ETrue);
       
   120     
       
   121     /**
       
   122      * Change vkb layout
       
   123      *
       
   124      * @since S60 v3.2
       
   125      * @param aVkbLayout The new vkb layout
       
   126      * @return None.
       
   127      */ 
       
   128     void ChangeVkbLayout(TInt aVkbLayoutId = -1);
       
   129 
       
   130     /**
       
   131      * Loop vkb layout
       
   132      *
       
   133      * @since S60 v3.2
       
   134      * @param aType The flag showing shift down or capslock down
       
   135      * @return None.
       
   136      */ 
       
   137     void LoopVkbLayout(TVkbShiftType aType, TBool aNotify = EFalse);
       
   138 
       
   139     /**
       
   140      * Get the string length in composition field
       
   141      *
       
   142      * @since S60 v3.2
       
   143      * @return The string length in composition field.
       
   144      */     
       
   145     TInt CompositionFieldStringLength();
       
   146 
       
   147     /**
       
   148      * Set rect of parent, top parent, layout
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @param aRect The rect of client rect
       
   152      * @return None.
       
   153      */     
       
   154     void SetWholeWindowRect(const TRect& aRect);
       
   155 
       
   156     /**
       
   157      * Set top parent
       
   158      *
       
   159      * @since S60 v3.2
       
   160      * @param aParent The vkb window
       
   161      * @return None.
       
   162      */      
       
   163     void SetTopParent(CFepUiBaseCtrl* aParent);
       
   164 
       
   165     /**
       
   166      * Reorganize controls
       
   167      *
       
   168      * @since S60 v3.2
       
   169      * @param aImLayout The input method layout
       
   170      * @param aImLayoutChanged To indicate whether Im Layout changed
       
   171      * @return None.
       
   172      */        
       
   173     void ReorganizeControls(CAknFepVkbImLayout* aImLayout, TBool aImLayoutChanged);
       
   174     
       
   175     /**
       
   176      * Get composition field
       
   177      *
       
   178      * @since S60 v3.2
       
   179      * @return The composition field.
       
   180      */       
       
   181     CFepLayoutEditAreaBase* CompositionField();
       
   182 
       
   183     /**
       
   184      * Add controls into client area
       
   185      *
       
   186      * @since S60 v3.2
       
   187      * @param aControl The control which will be added into client area
       
   188      * @return The composition field.
       
   189      */       
       
   190     void AddControlL(CFepUiBaseCtrl* aControl); 
       
   191     
       
   192     /**
       
   193      * Is there need to create new word
       
   194      *
       
   195      * @since S60 v3.2
       
   196      * @return ETrue if need to create new word, otherwise EFalse
       
   197      */       
       
   198     TBool NeedCreateWord();
       
   199  
       
   200     /**
       
   201      * Get layout ID
       
   202      *
       
   203      * @since S60 v3.2
       
   204      * @param aRange The current range
       
   205      * @return The composition field.
       
   206      */   
       
   207     TAknFepVkbLayout ShiftCapsSingleVkbLayoutId( TInt aRange );
       
   208     
       
   209     /**
       
   210      * Is next candidate after last page exist?
       
   211      *
       
   212      * @since S60 v3.2
       
   213      * @return ETrue if candidate eixst, otherwise EFalse
       
   214      */       
       
   215     void SetNextCandidateExistFlag(TBool aFlag);
       
   216     
       
   217     /**
       
   218      * Set if enable switch to hwr
       
   219      *
       
   220      * @since S60 v3.2
       
   221      * @param aEnable The enable flag
       
   222      * @return None
       
   223      */ 
       
   224     void SetEnableSwitchToHwr(TBool aEnable);
       
   225     
       
   226     /**
       
   227      * Active current range
       
   228      *
       
   229      * @since S60 v3.2
       
   230      * @return None
       
   231      */ 
       
   232     void ActiveCurrentRange();
       
   233     
       
   234     /**
       
   235      * Return the spell for new created words.
       
   236      *
       
   237      * @since S60 v3.2
       
   238      * 
       
   239      * @return The buffer for the gernated spell.
       
   240      */ 
       
   241     TPtrC GetCreatedWordSpell();
       
   242 
       
   243     void SetVkbLayoutSize(TInt aVkbLayoutId = -1);
       
   244     
       
   245     /**
       
   246      * Change Shift and CapsLock merged button status
       
   247      *
       
   248      * @since Series 60 3.2
       
   249      * @param aIsShiftCase The Shift case
       
   250      * @param aIsCapslockCase The CpasLock case
       
   251      * @return None
       
   252      */  
       
   253     void ChangeMergedButtonStatus( const TInt aIsShiftCase, 
       
   254     							   const TInt aIsCapslockCase ); 
       
   255     							   
       
   256     void ShowBubble(TBool aShow);
       
   257     
       
   258     void ReorganizeZhuYinControls( TBool aShowArrowKey );
       
   259     
       
   260     /**
       
   261      * Dim arrow keys when the editor type is
       
   262      * find pane or secret editor
       
   263      *
       
   264      * @since S60 v3.2
       
   265      * @param aIsSecret The flag
       
   266      * @return None
       
   267      */          
       
   268     void DimArrowKeys( TBool aDimArrow );
       
   269        
       
   270 protected:
       
   271 
       
   272     /**
       
   273      * Constructor function
       
   274      *
       
   275      * @since S60 v3.2
       
   276      * @param aUiLayout The layout plugin
       
   277      * @param aControlId This control ID
       
   278      * @param aDataProvider The interface of data provider
       
   279      * @return None.
       
   280      */ 
       
   281     CAknFepVkbClientArea(CFepUiLayout* aUiLayout, 
       
   282                          TInt aControlId,
       
   283                          MAknFepVkbDataProvider* aDataProvider,
       
   284                          CPeninputCnGenericVkbLafMgr* aLafMgr);
       
   285                          
       
   286     /**
       
   287      * 2nd construct function
       
   288      *
       
   289      * @since Series 60 3.2
       
   290      * @return None
       
   291      */
       
   292     void ConstructL();
       
   293     
       
   294     /**
       
   295      * Get default vkb layout according to range
       
   296      *
       
   297      * @since Series 60 3.2
       
   298      * @param aRange the current range
       
   299      * @return The default vkb layout.
       
   300      */    
       
   301     TAknFepVkbLayout GetDefaultVkbLayout(const TInt aRange);      
       
   302 
       
   303     /**
       
   304      * Add drop down list into client area
       
   305      *
       
   306      * @since Series 60 3.2
       
   307      * @return None
       
   308      */
       
   309     void AddDropdownListL();
       
   310 
       
   311     /**
       
   312      * Add button into client area
       
   313      *
       
   314      * @since Series 60 3.2
       
   315      * @param aControlId The button ID
       
   316      * @param aEventId The event id
       
   317      * @param aResId The resource id
       
   318      * @param aUnicode The unicode
       
   319      * @param aIsRepeat The flag showing whether it is repeat button
       
   320      * @
       
   321      */
       
   322     CAknFepCtrlEventButton* AddButtonL(const TInt aControlId,
       
   323                                        const TInt aEventId,
       
   324                                        const TInt aResId,
       
   325                                        const TInt aUnicode = 0,
       
   326                                        const TBool aIsRepeat = EFalse);
       
   327 
       
   328     /**
       
   329      * Add range bar into client area
       
   330      *
       
   331      * @since Series 60 3.2
       
   332      * @return None
       
   333      */    
       
   334     void AddRangeBarL();
       
   335 
       
   336 
       
   337 
       
   338     /**
       
   339      * Reset some data in client area
       
   340      *
       
   341      * @since Series 60 3.2
       
   342      * @param aImLayoutChanged To indicate whether Im Layout changed
       
   343      * @return None
       
   344      */      
       
   345     void Reset(TBool aImLayoutChanged);
       
   346 
       
   347     /**
       
   348      * Dim keys in vkb controls
       
   349      *
       
   350      * @since Series 60 3.2
       
   351      * @return None
       
   352      */  
       
   353     void DimKeys();
       
   354     
       
   355     /**
       
   356      * Clear all candidates
       
   357      *
       
   358      * @since Series 60 3.2
       
   359      * @return None
       
   360      */      
       
   361     void ClearCandidatesInList();
       
   362 
       
   363     /**
       
   364      * Calculate postion function
       
   365      *
       
   366      * @since S60 v3.2
       
   367      * @return None.
       
   368      */    
       
   369     void CalculatePosition( TInt aJustifyMode );
       
   370 
       
   371     /**
       
   372      * Change window position
       
   373      *
       
   374      * @since S60 v3.2
       
   375      * @return None.
       
   376      */    
       
   377     void TopLeftJustify();
       
   378 
       
   379     /**
       
   380      * Change window position
       
   381      *
       
   382      * @since S60 v3.2
       
   383      * @return None.
       
   384      */    
       
   385     void BottomRightJustify();
       
   386 
       
   387     /**
       
   388      * Change window position
       
   389      *
       
   390      * @since S60 v3.2
       
   391      * @return None.
       
   392      */    
       
   393     void DataQueryJustify();   
       
   394         
       
   395     /**
       
   396      * read from resource function
       
   397      *
       
   398      * @since Series 60 3.2
       
   399      * @return None
       
   400      */     
       
   401     void ConstructFromResourceL();
       
   402     
       
   403     /**
       
   404      * Set control's text property, e.g. font,
       
   405      * font color
       
   406      *
       
   407      * @since Series 60 3.2
       
   408      * @return None
       
   409      */     
       
   410     void SetTextProperty();
       
   411     
       
   412 private:
       
   413 
       
   414     TInt FepCaseByCaseId( TInt aCaseId );
       
   415 
       
   416     TInt CaseByShiftCapslockStatus();
       
   417       
       
   418     TPeninputCnCellType GetCellType(TInt aColumns);
       
   419     
       
   420     void DimKeysL();
       
   421     void HandleStandby2CompositionEventL();
       
   422            
       
   423 private:// data
       
   424 
       
   425     /**
       
   426      * The top parent
       
   427      * Not own
       
   428      */  
       
   429     CFepUiBaseCtrl* iTopParent;
       
   430 
       
   431 
       
   432     /**
       
   433      * The control pooling
       
   434      * Own
       
   435      */ 
       
   436     CAknFepVkbCtrlPool* iCtrlPool;
       
   437     
       
   438     /**
       
   439      * The layout pooling
       
   440      * Own
       
   441      */ 
       
   442     CAknFepLayoutPool* iLayoutPool;
       
   443 
       
   444     /**
       
   445      * The current im layout
       
   446      * Not own
       
   447      */ 
       
   448     CAknFepVkbImLayout* iCurrentImLayout;
       
   449     
       
   450     /**
       
   451      * The current vkb layout
       
   452      * Not own
       
   453      */ 
       
   454     CPeninputVkbLayoutInfo* iCurrentVkbLayout;
       
   455     
       
   456     /**
       
   457      * The data provider
       
   458      * Not own
       
   459      */
       
   460     MAknFepVkbDataProvider* iDataProvider;
       
   461     
       
   462     /**
       
   463      * The vkb ctrl
       
   464      * Not own
       
   465      */
       
   466     CPeninputVkbCtrlExt* iVkbCtrl;
       
   467             
       
   468     /**
       
   469      * Vkb layout
       
   470      * Own
       
   471      */ 
       
   472     CAknFepCtrlVkbLayout* iVkbLayout;
       
   473     
       
   474     /**
       
   475      * The composition field
       
   476      * Not own
       
   477      */
       
   478     CAknFepVkbCompositionField* iCompositionField;
       
   479     
       
   480     /**
       
   481      * The drop down list
       
   482      * Not own
       
   483      */
       
   484     CFepCtrlDropdownList* iDropdownList;
       
   485     
       
   486     /**
       
   487      * The range bar
       
   488      * Not own
       
   489      */
       
   490     CAknFepCtrlRangeBar* iRangeBar;
       
   491     
       
   492 
       
   493 
       
   494     
       
   495     /**
       
   496      * The key mapping manager
       
   497      * Own
       
   498      */    
       
   499     CAknFepVkbNumericKepMappingMgr* iKeyMappingMgr;
       
   500     
       
   501     /**
       
   502      * Indicate whether control's text property have 
       
   503      * been set, e.g. font, font color
       
   504      */    
       
   505     TBool iTextPropertySet;
       
   506     
       
   507     /**
       
   508      * Indicate whether drop down list's text property
       
   509      * and unit size etc. have been set
       
   510      */    
       
   511     TBool iDropdownPropertySet;
       
   512     
       
   513     CPeninputCnGenericVkbLafMgr* iLafMgr;
       
   514     
       
   515     CAknFepVkbWindow* iVkbCnWindow;
       
   516 
       
   517     TInt iCharWidth;
       
   518     TInt iCharHeight;
       
   519 
       
   520     TPoint iCharLeftTop;   
       
   521     
       
   522     TInt iBtnWidth;
       
   523     TInt iBtnHeight;
       
   524         
       
   525     TPoint iVkbBoardLeftTop;
       
   526     /**
       
   527      * Keep the current layout id
       
   528      */     
       
   529     TInt iVkbLayoutId;
       
   530     /**
       
   531      * Keep the control ID in ctrl pool not added to the control group
       
   532      */    
       
   533     RArray<TInt> iRemainedPoolControlIDs;
       
   534 public:
       
   535 
       
   536     TInt iCellAidGap;
       
   537     };  
       
   538 
       
   539 #endif // C_CAKNFEPVKBCLIENTAREA_H
       
   540 
       
   541 // End Of File