textinput/peninputvkbcn/ctrlinc/peninputvkbwindow.h
changeset 0 eb1f2e154e89
child 9 e6a39382bb9c
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:  Interface of vkb ui state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CAKNFEPVKBWINDOW_H
       
    20 #define C_CAKNFEPVKBWINDOW_H
       
    21 
       
    22 // system includes
       
    23 #include <peninputbasewindowext.h>
       
    24 
       
    25 /** class forward decalaration */
       
    26 class CFepUiLayout;
       
    27 class CPeninputCommonChoiceList;
       
    28 class CAknFepVkbClientArea;
       
    29 class MAknFepVkbDataProvider;
       
    30 class CAknFepVkbUiStateMgr;
       
    31 class CAknFepCtrlEventButton;
       
    32 class CFepLayoutMultiLineIcf;
       
    33 class CPeninputLayoutInputmodelChoice;
       
    34 class CPeninputVkbCtrlExt;
       
    35 class CAknFepCtrlVkbLayout;
       
    36 class CPeninputCnGenericVkbLafMgr;
       
    37 class CAknFepCtrlRepeatButton;
       
    38 class CFepLayoutScrollableList;
       
    39 
       
    40 // class declarations
       
    41 /**
       
    42  *  vkb window class
       
    43  *
       
    44  *  @lib peninputvkbcn.lib
       
    45  *  @since S60 v3.2
       
    46  */
       
    47 class CAknFepVkbWindow : public CAknFepCtrlBaseWindowExt
       
    48     {       
       
    49 public:
       
    50 
       
    51     /**
       
    52      * Create one CAknFepVkbWindow object
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @param aUiLayout The layout plugin
       
    56      * @param aControlId This control ID
       
    57      * @param aDataProvider The interface of data provider
       
    58      * @return The CFepCtrlDropdownList object.
       
    59      */        
       
    60     static CAknFepVkbWindow* NewL(CFepUiLayout* aUiLayout, 
       
    61                                   TInt aControlId, 
       
    62                                   MAknFepVkbDataProvider* aDataProvider,
       
    63                                   CAknFepVkbUiStateMgr* aUiStateMgr);
       
    64 
       
    65     /**
       
    66      * Create one CAknFepVkbWindow object
       
    67      *
       
    68      * @since S60 v3.2
       
    69      * @param aUiLayout The layout plugin
       
    70      * @param aControlId This control ID
       
    71      * @param aDataProvider The interface of data provider
       
    72      * @return The CFepCtrlDropdownList object.
       
    73      */                                        
       
    74     static CAknFepVkbWindow* NewLC(CFepUiLayout* aUiLayout, 
       
    75                                    TInt aControlId, 
       
    76                                    MAknFepVkbDataProvider* aDataProvider,
       
    77                                    CAknFepVkbUiStateMgr* aUiStateMgr);
       
    78 
       
    79     /**
       
    80      * Destructor
       
    81      *
       
    82      * @since S60 v3.2
       
    83      * @return None.
       
    84      */                                    
       
    85     virtual ~CAknFepVkbWindow();
       
    86 
       
    87     /**
       
    88      * Size change function
       
    89      *
       
    90      * @since S60 v3.2
       
    91      * @param aLandscapeStyle Landscape or portrait
       
    92      * @return None.
       
    93      */       
       
    94     void SizeChanged(TBool aLandscapeStyle);
       
    95 
       
    96     /**
       
    97      * Handle event 
       
    98      * @since Series 60 3.2
       
    99      * @param aEventType The event type
       
   100      * @param aCtrl The control who sends the event
       
   101      * @param aEventData The event data
       
   102      * @return None
       
   103      */     
       
   104     void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData);       
       
   105     
       
   106     /**
       
   107      * Get client area control
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @return The client area control.
       
   111      */        
       
   112     CAknFepVkbClientArea* ClientArea();
       
   113     
       
   114     /**
       
   115      * Get input context field
       
   116      *
       
   117      * @since S60 v3.2
       
   118      * @return The input context field
       
   119      */     
       
   120     CFepLayoutMultiLineIcf* InputContextField();
       
   121 
       
   122     /**
       
   123      * Change input method layout
       
   124      *
       
   125      * @since S60 v3.2
       
   126      * @param aRange The range defined in TAknFepVkbIMLayout
       
   127      * @param aChangeVkb The flag of changing vkb or not     
       
   128      * @return None.
       
   129      */ 
       
   130     void ChangeImLayout(TInt aRange, TBool aChangeVkb = ETrue);
       
   131     
       
   132     /**
       
   133      * Loop vkb layout
       
   134      *
       
   135      * @since S60 v3.2
       
   136      * @param aType The flag showing shift down or capslock down
       
   137      * @return None.
       
   138      */ 
       
   139     void LoopVkbLayout(TVkbShiftType aType, TBool aNotify = EFalse);
       
   140     
       
   141     /**
       
   142      * Change vkb layout
       
   143      *
       
   144      * @since S60 v3.2
       
   145      * @param aVkbLayout The destination layout
       
   146      * @return None.
       
   147      */     
       
   148     void ChangeVkbLayout(TInt aVkbLayoutId);    
       
   149     
       
   150     /**
       
   151      * Get the string length in composition field
       
   152      *
       
   153      * @since S60 v3.2
       
   154      * @return The string length in composition field.
       
   155      */     
       
   156     TInt CompositionFieldStringLength();
       
   157     
       
   158     /**
       
   159      * Popup accent window
       
   160      *
       
   161      * @since S60 v3.2
       
   162      * @return None.
       
   163      */ 
       
   164     void PopupAccentWindow();
       
   165     
       
   166     
       
   167     void PopupSwitchWindow();
       
   168     
       
   169     /**
       
   170      * Reset the status accent button
       
   171      *
       
   172      * @since S60 v3.2
       
   173      * @return None.
       
   174      */ 
       
   175     void ResetAccentButton();
       
   176     
       
   177     /**
       
   178      * Set the input context field text
       
   179      *
       
   180      * @since S60 v3.2
       
   181      * @param aTotalTextLen The total text length in editor
       
   182      * @param aStartPos The position of aText in whole editor
       
   183      * @param aCursorSel Current cursor selection
       
   184      * @param aText The text to be set 
       
   185      * @return None
       
   186      */          
       
   187     void SetEditorTextL(const TFepInputContextFieldData& aData);
       
   188 
       
   189     /**
       
   190      * Set if the input context field text is secret
       
   191      *
       
   192      * @since S60 v3.2
       
   193      * @param aIsSecret The flag
       
   194      * @return None
       
   195      */          
       
   196     void SetTextIsSecret( TBool aIsSecret );
       
   197     
       
   198     /**
       
   199      * Dim arrow keys when the editor type is
       
   200      * find pane or secret editor
       
   201      *
       
   202      * @since S60 v3.2
       
   203      * @param aIsSecret The flag
       
   204      * @return None
       
   205      */          
       
   206     void DimArrowKeys( TBool aDimArrow );
       
   207     /**
       
   208      * Get current control who has focus
       
   209      *
       
   210      * @since S60 v3.2
       
   211      * @return None.
       
   212      */                         
       
   213     TInt FocusedControlID();
       
   214     
       
   215     /**
       
   216      * Draw window and shadow
       
   217      *
       
   218      * @since S60 v3.2
       
   219      * @return None
       
   220      */          
       
   221     void Draw();
       
   222     
       
   223     /**
       
   224 
       
   225     /**
       
   226      * Set layout's rectangle
       
   227      *
       
   228      * @since S60 V3.2
       
   229      * @param aRect The new control area
       
   230      * @return None
       
   231      */                                       
       
   232     void SetRect(const TRect& aRect);
       
   233     
       
   234     /**
       
   235      * Is there need to create new word
       
   236      *
       
   237      * @since S60 v3.2
       
   238      * @return ETrue if need to create new word, otherwise EFalse
       
   239      */       
       
   240     TBool NeedCreateWord();
       
   241     
       
   242     /**
       
   243      * Close Accent window
       
   244      *
       
   245      * @since S60 V3.2
       
   246      * @return None
       
   247      */                                       
       
   248     void CloseAccentWindow();
       
   249     
       
   250     static TInt BackgroundTaskL(TAny* aPtr);
       
   251         
       
   252     /**
       
   253      * Set if enable option button and language switch button
       
   254      *
       
   255      * @since S60 v3.2
       
   256      * @param aEnable The enable flag
       
   257      * @return None
       
   258      */ 
       
   259     void SetEnableSettingBtn(TBool aEnable);
       
   260     
       
   261     /**
       
   262      * Return the spell for new created words.
       
   263      *
       
   264      * @since S60 v3.2
       
   265      * @return The buffer for the gernated spell.
       
   266      */ 
       
   267     TPtrC GetCreatedWordSpell();
       
   268     
       
   269     void SetSwitchlistLanguage(TInt aLang);
       
   270     
       
   271     void SetSwitchlistSecretFlag(TBool aSecret);
       
   272     
       
   273     /**
       
   274      * Set prompt text in FSQ mode.
       
   275      *
       
   276      * @since S60 v3.2
       
   277      * @param Prompt text data
       
   278      * @return None.
       
   279      */ 
       
   280     void SetPromptTextL(TUint8* aData);
       
   281     
       
   282     void ChangeMergedButtonStatus( const TInt aIsShiftCase, 
       
   283     							   const TInt aIsCapslockCase );
       
   284     							   
       
   285     void ShowBubble(TInt aShow);
       
   286     
       
   287     void SetTextAlignmentL( TInt aAlignment );  
       
   288     void UpdateICFTextL();							   
       
   289     
       
   290     /**
       
   291      * Show tooltip of ICF
       
   292      * 
       
   293      * @since S60 v5.0
       
   294      * @param aText The text to be displayed in ICF
       
   295      * @return None
       
   296      */
       
   297     void ShowTooltipOnFSQL( const TDesC& aText );
       
   298     
       
   299     /**
       
   300      * Hide tooltip of ICF
       
   301      * 
       
   302      * @since S60 v5.0
       
   303      * @return None
       
   304      */    
       
   305     void HideTooltipOnFSQ();
       
   306     
       
   307     /**
       
   308      * Hide candidate list
       
   309      * 
       
   310      * @since S60 v5.0
       
   311      * @return None
       
   312      */        
       
   313     void HideCandidateListOnFSQ();
       
   314     
       
   315     /**
       
   316      * Show candidate list
       
   317      * 
       
   318      * @param aItemArray, the contents to be shown
       
   319      * @param aActiveIndex, the default index     
       
   320      * @return None
       
   321      */	
       
   322     void ShowCandidateListOnFSQL( const CDesCArray* aItemArray,
       
   323                             TInt aActiveIndex );    
       
   324     
       
   325     /**
       
   326      * Handle candidate list selected events
       
   327      * 
       
   328      * @param aCtrl, pointer of the candidate list on which events occur.
       
   329      * @param aEventData event data
       
   330      * @return None
       
   331      */	
       
   332     void HandleCandidateListSelectedOnFSQL( CFepUiBaseCtrl* aCtrl, 
       
   333                                        const TDesC& aEventData );        
       
   334        
       
   335 protected:
       
   336 
       
   337     /**
       
   338      * Construct function
       
   339      *
       
   340      * @since S60 v3.2
       
   341      * @param aUiLayout The layout plugin
       
   342      * @param aControlId This control ID
       
   343      * @param aDataProvider The interface of data provider
       
   344      * @return None.
       
   345      */ 
       
   346     CAknFepVkbWindow(CFepUiLayout* aUiLayout, 
       
   347                      TInt aControlId, 
       
   348                      MAknFepVkbDataProvider* aDataProvider,
       
   349                      CAknFepVkbUiStateMgr* aUiStateMgr);
       
   350 
       
   351     /**
       
   352      * 2nd construct function
       
   353      *
       
   354      * @since Series 60 3.2
       
   355      * @return None
       
   356      */ 
       
   357     void ConstructL();
       
   358         
       
   359     /**
       
   360      * Close window
       
   361      *
       
   362      * @since Series 60 3.2
       
   363      * @return None
       
   364      */ 
       
   365     TBool DoClose();
       
   366     
       
   367     /**
       
   368      * read from resource function
       
   369      *
       
   370      * @since Series 60 3.2
       
   371      * @return None
       
   372      */     
       
   373     void ConstructFromResourceL();
       
   374     
       
   375     virtual void AddCustomControlGroupL(CFepUiBaseCtrl* aCtrl);
       
   376     
       
   377     virtual TBool CreateCustomControlL( TInt16 aControlId, TInt32 aImageId );
       
   378     
       
   379 private:
       
   380 
       
   381     /**
       
   382      * Add context field into the vkb window
       
   383      *
       
   384      * @since Series 60 3.2
       
   385      * @return None
       
   386      */
       
   387     void AddContextFieldL();
       
   388     
       
   389     /**
       
   390      * Add popup window into the vkb window
       
   391      *
       
   392      * @since Series 60 3.2
       
   393      * @return None
       
   394      */
       
   395     void AddPopupWindowL();        
       
   396     
       
   397     /**
       
   398      * Add touch input into the vkb window
       
   399      *
       
   400      * @since Series 60 3.2
       
   401      * @return None
       
   402      */
       
   403     void AddTouchInputButtonL();   
       
   404         
       
   405     /**
       
   406      * get resource info of accented chars popup window
       
   407      *
       
   408      * @since S60 v3.2
       
   409      * @param aReader Resource reader
       
   410      * @return None
       
   411      */
       
   412     void GetPopupWndInfoFromRes( TResourceReader aReader);
       
   413     
       
   414     /**
       
   415      * Construct popup window
       
   416      *
       
   417      * @since S60 v3.2
       
   418      * @return None
       
   419      */
       
   420     void DoIdleConstructL();
       
   421     
       
   422     /**
       
   423      * Set item rect, position, font, text color etc to 
       
   424      * popup window
       
   425      *
       
   426      * @since S60 v3.2
       
   427      * @return None
       
   428      */
       
   429     void SetPopupProperty();
       
   430     
       
   431     TInt GetWindowResId();
       
   432     
       
   433     void SimulateRawEvent(TInt aScanCode, TRawEvent::TType aType);
       
   434     
       
   435     void SizeChangedForTitle();
       
   436    
       
   437     /*
       
   438      * Create a candidate list control
       
   439      * 
       
   440      * @since S60 v5.0
       
   441      * @return None
       
   442      */   
       
   443     void CreateCandidateListOnFSQL();       
       
   444     
       
   445     /*
       
   446      * Retrieve text color from skin for candidiate list
       
   447      * 
       
   448      * @since S60 v5.0
       
   449      * @return None
       
   450      */   
       
   451     const TRgb CandidateListTextColorOnFSQ();
       
   452     
       
   453     /*
       
   454      * Retrieve text color from skin for autocompletion part
       
   455      * 
       
   456      * @since S60 v5.0
       
   457      * @return None
       
   458      */   
       
   459     const TRgb AutoCompletionPartColorOnFSQ();
       
   460 
       
   461     /*
       
   462      * Set item rect, position, font, text color etc to tooltip
       
   463      * and candidate list
       
   464      * 
       
   465      * @since S60 v5.0
       
   466      * @return None
       
   467      */   
       
   468     void SetITILayoutOnFSQ();
       
   469     
       
   470 public:
       
   471     CPeninputCnGenericVkbLafMgr* iLafMgr;
       
   472 
       
   473 private: // data
       
   474 
       
   475     /**
       
   476      * The client area control
       
   477      * Own
       
   478      */
       
   479     CAknFepVkbClientArea* iClientArea;
       
   480 
       
   481     /**
       
   482      * The input context field
       
   483      * Own
       
   484      */    
       
   485     CFepLayoutMultiLineIcf* iInputContextField;
       
   486 
       
   487 
       
   488     /**
       
   489      * The popup window
       
   490      * Own
       
   491      */    
       
   492     CPeninputCommonChoiceList* iPopupWnd;
       
   493     
       
   494     /**
       
   495      * The data provider
       
   496      * Not own
       
   497      */     
       
   498     MAknFepVkbDataProvider* iDataProvider;
       
   499 public:    
       
   500     /**
       
   501      * The UI state manager
       
   502      * Not own
       
   503      */ 
       
   504     CAknFepVkbUiStateMgr* iUiStateMgr;
       
   505 private:    
       
   506     /**
       
   507      * The background bitmap of popup window
       
   508      * Not own
       
   509      */      
       
   510     CFbsBitmap* iPopupWndBgImg;
       
   511     
       
   512     /**
       
   513      * The background mask bitmap of popup window
       
   514      * Not own
       
   515      */      
       
   516     CFbsBitmap* iPopupWndBgMaskImg;  
       
   517     
       
   518 
       
   519     /**
       
   520      * The focus bitmap of popup window
       
   521      * Not own
       
   522      */  
       
   523     CFbsBitmap* iPopupWndFocusImg;
       
   524     
       
   525     /**
       
   526      * The focus mask bitmap of popup window
       
   527      * Not own
       
   528      */      
       
   529     CFbsBitmap* iPopupWndFocusMaskImg;
       
   530     
       
   531     /**
       
   532      * The rect of whole vkb window
       
   533      */
       
   534     TRect iWndRect;
       
   535     
       
   536     /**
       
   537      * Accent popuo window open state
       
   538      */
       
   539     TBool iAccentPopup;
       
   540     
       
   541     /**
       
   542      * First time construct flag
       
   543      */
       
   544     TBool iFirstTimeConstruct;
       
   545     
       
   546     CIdle* iIdle;
       
   547     TBool iPopupInited;
       
   548     
       
   549     /**
       
   550      * Flag to indicate whether popup window's property
       
   551      * have been set
       
   552      */
       
   553     TBool iPopupSet;
       
   554     
       
   555     /**
       
   556      * Popup window item size
       
   557      */
       
   558     TSize iPopupItemSize;
       
   559     
       
   560     CPeninputLayoutInputmodelChoice* iInputModeSwitch;
       
   561     CAknFepCtrlRepeatButton* iArrowLeftButton;
       
   562     
       
   563     CAknFepCtrlRepeatButton* iArrowRightButton;
       
   564     
       
   565     CAknFepCtrlDragButton* iMoveButton;
       
   566     
       
   567     /**
       
   568      * Vkb layout
       
   569      * Own
       
   570      */ 
       
   571     CAknFepCtrlVkbLayout* iVkbLayout; 
       
   572     TAknWindowLineLayout iBubbleSize;
       
   573     TAknTextLineLayout iBubbleTextLayout; 
       
   574 
       
   575     CFepLayoutScrollableList* iCandidateList;
       
   576     
       
   577     };  
       
   578 
       
   579 #endif // C_CAKNFEPVKBWINDOW_H
       
   580 
       
   581 // End Of File