textinput/peninputgenericitut/inc/peninputgenericitutwindow.h
changeset 0 eb1f2e154e89
child 5 a47de9135b21
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:  drop-down list control
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_GENERICITUTWINDOW_H
       
    20 #define C_GENERICITUTWINDOW_H
       
    21 
       
    22 #include <peninputlayout.h>
       
    23 #include <peninputpluginutils.h>
       
    24 #include <peninputlayoutmultilineicf.h>
       
    25 #include <peninputinputcontextfield.h>
       
    26 
       
    27 #include <peninputlayoutvkb.h>
       
    28 
       
    29 #include "peninputgenericitutwindowmanager.h"
       
    30 #include "peninputgenericitutpropertysubscriber.h"
       
    31 #include "peninputgenericitutlayoutcontext.h"
       
    32 
       
    33 class CGenericItutDataMgr;
       
    34 class CFepCtrlDropdownList;
       
    35 class CPeninputLayoutInputmodelChoice;
       
    36 class CFepLayoutScrollableList;
       
    37 class CAknFepCtrlCommonBgCtrl;
       
    38 class CPeninputCommonChoiceList;
       
    39 class CPeninputSyncBitmapRotator;
       
    40 
       
    41 const TInt KUnavailableID = -1;
       
    42 
       
    43 class CGenericItutWindow : public CBase
       
    44     {
       
    45 private:
       
    46 
       
    47     enum TButtonType
       
    48         {
       
    49         ERawKeyButton,
       
    50         ECommonButton,
       
    51         ERepeatButtonEx
       
    52         };
       
    53     
       
    54     enum TIndicatorAlign
       
    55     	{
       
    56     	EIndiAlignLeft,
       
    57     	EIndiAlignCenter,
       
    58     	EIndiAlignRight	
       
    59     	};
       
    60 public:
       
    61     static CGenericItutWindow* NewL(CGenericItutWindowManager* aWindowMgr, 
       
    62                                     CGenericItutUiLayout* aLayoutOwner,
       
    63                                     CGenericItutDataMgr* aDataMgr);
       
    64 
       
    65     ~CGenericItutWindow();
       
    66 
       
    67     TInt OnAppEditorTextComing(const TFepInputContextFieldData& aData);
       
    68 
       
    69     TInt PenInputType(); 
       
    70 
       
    71     // from MITUTPropertySubscriber
       
    72     void SetPropertyL( MItutPropertySubscriber::TItutProperty aPropertyName, 
       
    73                        const TDesC& aPropertyValue);
       
    74 
       
    75     TInt SizeChanged(TBool aIcfOverlap);
       
    76 
       
    77     // from MItutLayoutContext
       
    78     CFepUiBaseCtrl* Control(const TInt aCtrlId);
       
    79     
       
    80     inline TBool IsSecretEdtior();
       
    81 
       
    82     // drop down list
       
    83     // stroke zhuyin spell ctrl
       
    84     void CreateChineseSpecificCtrlsIfNeededL();
       
    85     
       
    86     void EnterMatchSelectionState(TBool aOn);
       
    87 
       
    88 	void CalIndicatorRect(const TRect& aBoundRect,
       
    89 	                          TRect& aRealSize1,
       
    90 	                          TRect& aRealSize2,
       
    91 	                          TIndicatorAlign aAlign = EIndiAlignRight);
       
    92 	void ResetIndicatorL(CFepUiBaseCtrl* aIndicator);
       
    93 	
       
    94 	void DisplayInputmodeSwitchL();
       
    95 	
       
    96 	inline CFepLayoutMultiLineIcf* Icf();
       
    97 	inline CPeninputLayoutInputmodelChoice* InputModeSwitch();
       
    98 	inline CFepLayoutScrollableList* MatchSelection();
       
    99     inline CVirtualKeyboard* ItutKeypad();
       
   100     void SetPromptTextL(TUint8* aData);
       
   101     
       
   102     
       
   103     void ConstructItutKeypadFromResourceL(TInt aResId);  
       
   104     
       
   105     void ConstructIcfFromResourceL();
       
   106     void OnSkinChange();  
       
   107     void ApplyVariantLafDataL(TBool aResolutionChange = EFalse);
       
   108     
       
   109     void SetIndicatorImageL(CFepUiBaseCtrl* aIndicator,
       
   110                             const TInt aImgID1,
       
   111                             const TInt aMaskID1,
       
   112                             const TInt aImgID2,
       
   113                             const TInt aMaskID2); 
       
   114                             
       
   115     void ConstructSpellCtrlFromResourceL();
       
   116     
       
   117     void UpdateIndicatorL(TUint8* aData);
       
   118     
       
   119     inline CPeninputCommonChoiceList* EditorMenu();   
       
   120     
       
   121     void ShowEditorMenuL(TInt* aData);
       
   122     
       
   123     void SetHardKeyOneSymbol(TUint8* aData);
       
   124     void SetHardKeyOneSymbolL(TUint8* aData);
       
   125     
       
   126     void HandleButtonResOnLangDirChange( TInt aControlId );
       
   127     void HandleButtonResOnLangDirChangeL( TInt aControlId );
       
   128 private:
       
   129     CGenericItutWindow(CGenericItutWindowManager* aWindowMgr, 
       
   130                        CGenericItutUiLayout* aLayoutOwner,
       
   131                        CGenericItutDataMgr* aDataMgr);
       
   132 
       
   133     void ConstructL(); 
       
   134 
       
   135     // called when first time construct itut keypad
       
   136     void CreateItutKeypadL();
       
   137 
       
   138     void CreateLayoutIconL(TInt aMajorSkinId,
       
   139                            TInt aMinorSkinId,
       
   140                            const TDesC& aBmpFileName,
       
   141                            TInt aBmpId,
       
   142                            TInt aMaskBmpId,
       
   143                            CFbsBitmap*& aBmp,
       
   144                            CFbsBitmap*& aMaskBmp,
       
   145                            TSize aSize);
       
   146                            
       
   147     void CreateMatchSelectionCtrlL();
       
   148 
       
   149     // aLeftTopPos: the offset of top most and left most key relative to keypad
       
   150     CVirtualKey* CreateKeyL(TResourceReader& aReader,
       
   151                             TRect aKeyRect);
       
   152 
       
   153     void ChangeVirtualKeyInfoL(TResourceReader& aReader,
       
   154                               CVirtualKey* aKey);
       
   155 
       
   156 
       
   157 
       
   158 
       
   159     void CreateAllButtonL();
       
   160     
       
   161     void CreateBackGroundControlL();
       
   162 
       
   163     void CreateICFL();
       
   164 
       
   165     void CreateDropdownListL();
       
   166 
       
   167 
       
   168 
       
   169     void SetCtrlRect(CFepUiBaseCtrl* aCtrl, TInt aRectIdx);
       
   170     
       
   171     void ResizeCandidateList(CFepCtrlDropdownList* aList, TInt aLTPosIdx, TBool aExpandable);
       
   172     
       
   173 	void CalculateFrameRects(const TRect aRect,
       
   174 							 TRect& aOuterRect, 
       
   175 						     TRect& aInnerRect);
       
   176 						     
       
   177 
       
   178     
       
   179     TRgb GetMatchListTextColor();
       
   180     
       
   181 
       
   182     
       
   183     
       
   184     CAknFepCtrlCommonButton* CreateRawKeyButtonL(const TInt aControlId,
       
   185                                         const TInt aCommand);
       
   186                                         
       
   187     CAknFepCtrlCommonButton* CommonButtonControl(const TInt aControlId);
       
   188     
       
   189     CAknFepCtrlCommonButton* CreateRepeatButtonL(const TInt aControlId,
       
   190                                         const TInt aCommand);
       
   191                                         
       
   192     CAknFepCtrlCommonButton* CreateCommonButtonL(const TInt aControlId);
       
   193                                         
       
   194     
       
   195     CFepUiBaseCtrl* CreateButtonL(TButtonType aType,
       
   196                                   const TInt aControlId,
       
   197                                   const TInt aRectId,
       
   198                                   const TInt aInnerRectId,
       
   199                                   const TInt aResourceId,
       
   200                                   const TInt aCommand = KUnavailableID);
       
   201                                   
       
   202     TBool ControlSizeChanged(const TInt aControlId, 
       
   203                             const TInt aRect, 
       
   204                             const TInt aInnerRect, 
       
   205                             TBool aIsReloadImages);
       
   206                                         
       
   207     void AddControlL(CFepUiBaseCtrl* aControl);
       
   208     
       
   209     void AddEditorMenuL();
       
   210 
       
   211     TBool IsChineseMode();
       
   212     void ConstructKeyImageFromResourceL( TInt aKeyImageResID );
       
   213     
       
   214     void SetUnicodesForHardKey1(CVirtualKey* aKey, const TDesC& aMapData);
       
   215     void SetUnicodesForHardKey1L(CVirtualKey* aKey, const TDesC& aMapData);
       
   216 private:
       
   217     CVirtualKeyboard* iStandardItutKp;
       
   218     CFepLayoutMultiLineIcf* iICF;
       
   219 
       
   220     CFepCtrlDropdownList* iSpellCandsList;
       
   221     CFepCtrlDropdownList* iCandsList;
       
   222     CFepCtrlDropdownList* iPuncCandsList;
       
   223 
       
   224     CFepLayoutScrollableList* iMatchSelection;
       
   225 
       
   226     CGenericItutDataMgr* iDataMgr;
       
   227 
       
   228     TBool iPenDownOnNaviPane;
       
   229 
       
   230     TBool iChnCtrlInited;
       
   231     
       
   232 
       
   233     CPeninputLayoutInputmodelChoice* iInputModeSwitch;
       
   234 
       
   235     CPeninputCommonChoiceList* iEditorMenu;    
       
   236  
       
   237     TBool iIsSecret;
       
   238     TSize iIndicatorSize;
       
   239     TSize iIndicatorTextSize;
       
   240     TBool iImDimensionSet;
       
   241     
       
   242     TInt iLastRawKeyDown;
       
   243     TBool iRawKeyDown;
       
   244     TBool iLastIsChinese;
       
   245     
       
   246     TAknWindowLineLayout iBubbleSize;
       
   247     TAknTextLineLayout iBubbleTextLayout;
       
   248     CGenericItutUiLayout* iLayoutOwner;
       
   249     CGenericItutWindowManager* iWindowMgr;
       
   250     CAknFepCtrlCommonBgCtrl* iBackgroundCtrl;
       
   251     CFepInputContextField* iSpell;
       
   252 	CPeninputSyncBitmapRotator* iBmpRotator;    
       
   253     TFepSymbolOfHardwareOne iSymbolData;
       
   254     };
       
   255 
       
   256 inline CFepLayoutMultiLineIcf* CGenericItutWindow::Icf()
       
   257     {
       
   258     return iICF;   
       
   259     }
       
   260     
       
   261 inline CPeninputLayoutInputmodelChoice* CGenericItutWindow::InputModeSwitch()
       
   262     {
       
   263     return iInputModeSwitch;  
       
   264     }
       
   265     
       
   266 inline CFepLayoutScrollableList* CGenericItutWindow::MatchSelection() 
       
   267     {
       
   268     return iMatchSelection;   
       
   269     }
       
   270     
       
   271 inline CVirtualKeyboard* CGenericItutWindow::ItutKeypad()
       
   272     {
       
   273     return iStandardItutKp;    
       
   274     }
       
   275     
       
   276 inline CPeninputCommonChoiceList* CGenericItutWindow::EditorMenu()
       
   277     {
       
   278     return iEditorMenu;    
       
   279     }
       
   280     
       
   281 #endif //C_GENERICITUTWINDOW_H