textinput/peninputsplititut/inc/peninputsplititutwindow.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_SPLITITUTWINDOW_H
       
    20 #define C_SPLITITUTWINDOW_H
       
    21 
       
    22 #include <peninputlayout.h>
       
    23 #include <peninputpluginutils.h>
       
    24 #include <peninputinputcontextfield.h>
       
    25 #include <peninputlayoutvkb.h>
       
    26 
       
    27 #include "peninputsplititutwindowmanager.h"
       
    28 #include "peninputsplititutpropertysubscriber.h"
       
    29 #include "peninputsplititutlayoutcontext.h"
       
    30 
       
    31 class CSplitItutDataMgr;
       
    32 class CFepCtrlDropdownList;
       
    33 class CAknFepCtrlCommonBgCtrl;
       
    34 class CPeninputSyncBitmapRotator;
       
    35 
       
    36 const TInt KUnavailableID = -1;
       
    37 
       
    38 /**
       
    39  *  class CSplitItutWindow.
       
    40  *
       
    41  *  Split itu-t window class.
       
    42  *
       
    43  *  @lib peninputsplititut.lib
       
    44  *  @since S60 v5.0
       
    45  */
       
    46 class CSplitItutWindow : public CBase
       
    47     {
       
    48 private:
       
    49 
       
    50     enum TButtonType
       
    51         {
       
    52         ERawKeyButton,
       
    53         ECommonButton,
       
    54         ERepeatButtonEx
       
    55         };
       
    56     
       
    57     enum TIndicatorAlign
       
    58     	{
       
    59     	EIndiAlignLeft,
       
    60     	EIndiAlignCenter,
       
    61     	EIndiAlignRight	
       
    62     	};
       
    63 public:
       
    64     /** 
       
    65      * Symbian constructor.
       
    66      *
       
    67      * @since S60 5.0
       
    68      * 
       
    69      * @param aWindowMgr
       
    70      * @param aLayoutOwner
       
    71      * @param aDataMgr
       
    72      * @return Pointer to created CSplitItutWindow object
       
    73      */
       
    74     static CSplitItutWindow* NewL(CSplitItutWindowManager* aWindowMgr, 
       
    75                                     CSplitItutUiLayout* aLayoutOwner,
       
    76                                     CSplitItutDataMgr* aDataMgr);
       
    77 
       
    78     /** 
       
    79      * tandard c++ destructor.
       
    80      *
       
    81      * @since S60 5.0
       
    82      * @return None
       
    83      */
       
    84     ~CSplitItutWindow();
       
    85 
       
    86     /** 
       
    87      * get pen input type
       
    88      *
       
    89      * @since S60 5.0
       
    90      * @return peninput type
       
    91      */
       
    92     TInt PenInputType(); 
       
    93 
       
    94     /** 
       
    95      * set property
       
    96      *
       
    97      * @since S60 5.0
       
    98      * @param aPropertyName
       
    99      * @param aPropertyValue
       
   100      * @return peninput type
       
   101      */
       
   102     void SetPropertyL( MItutPropertySubscriber::TItutProperty aPropertyName, 
       
   103                        const TDesC& aPropertyValue);
       
   104 
       
   105     /** 
       
   106      * handle size change
       
   107      *
       
   108      * @since S60 5.0
       
   109      * @return TInt
       
   110      */
       
   111     TInt SizeChanged();
       
   112 
       
   113     /** 
       
   114      * get control
       
   115      *
       
   116      * @since S60 5.0
       
   117      * @param aCtrlId
       
   118      * @return return control pointer
       
   119      */
       
   120     CFepUiBaseCtrl* Control(const TInt aCtrlId);
       
   121 
       
   122     /** 
       
   123      * create chinese spec controls
       
   124      *
       
   125      * @since S60 5.0
       
   126      * @return None
       
   127      */
       
   128     void CreateChineseSpecificCtrlsIfNeededL();
       
   129     
       
   130     /** 
       
   131      * get itut keypad
       
   132      *
       
   133      * @since S60 5.0
       
   134      * @return return itut keypad
       
   135      */
       
   136     inline CVirtualKeyboard* ItutKeypad();
       
   137     
       
   138     /** 
       
   139      * construct itut keypad
       
   140      *
       
   141      * @since S60 5.0
       
   142      * @param aResId
       
   143      * @return None
       
   144      */
       
   145     void ConstructItutKeypadFromResourceL(TInt aResId);  
       
   146     
       
   147     /** 
       
   148      * handle skin change
       
   149      *
       
   150      * @since S60 5.0
       
   151      * @return None
       
   152      */
       
   153     void OnSkinChange(); 
       
   154     
       
   155     /** 
       
   156      * apply variant laf data
       
   157      *
       
   158      * @since S60 5.0
       
   159      * @param aResolutionChange
       
   160      * @return None
       
   161      */
       
   162     void ApplyVariantLafDataL(TBool aResolutionChange = EFalse);
       
   163                         
       
   164     /** 
       
   165      * construct spell control
       
   166      *
       
   167      * @since S60 5.0
       
   168      * @return None
       
   169      */
       
   170     void ConstructSpellCtrlFromResourceL();
       
   171     
       
   172     /** 
       
   173      * set hard key
       
   174      *
       
   175      * @since S60 5.0
       
   176      * @param aData
       
   177      * @return None
       
   178      */
       
   179     void SetHardKeyOneSymbol(TUint8* aData);
       
   180     
       
   181     /** 
       
   182      * set hard key
       
   183      *
       
   184      * @since S60 5.0
       
   185      * @param aData
       
   186      * @return None
       
   187      */
       
   188     void SetHardKeyOneSymbolL(TUint8* aData);
       
   189     
       
   190     /** 
       
   191      * handle button res
       
   192      *
       
   193      * @since S60 5.0
       
   194      * @param aControlId
       
   195      * @return None
       
   196      */
       
   197     void HandleButtonResOnLangDirChange( TInt aControlId );
       
   198     
       
   199     /** 
       
   200      * handle button res
       
   201      *
       
   202      * @since S60 5.0
       
   203      * @param aControlId
       
   204      * @return None
       
   205      */
       
   206     void HandleButtonResOnLangDirChangeL( TInt aControlId );
       
   207     
       
   208 private:
       
   209     /**
       
   210      * C++ constructor
       
   211      *
       
   212      * @since S60 5.0
       
   213      * @param aWindowMgr
       
   214      * @param aLayoutOwner
       
   215      * @param aDataMgr
       
   216      * @return none
       
   217      */
       
   218     CSplitItutWindow(CSplitItutWindowManager* aWindowMgr, 
       
   219                        CSplitItutUiLayout* aLayoutOwner,
       
   220                        CSplitItutDataMgr* aDataMgr);
       
   221                        
       
   222     /**
       
   223      * Symbian second-phase constructor
       
   224      *
       
   225      * @since S60 5.0
       
   226      * @return none
       
   227      */
       
   228     void ConstructL(); 
       
   229 
       
   230     /**
       
   231      * create itut keypad
       
   232      *
       
   233      * @since S60 5.0
       
   234      * @return none
       
   235      */
       
   236     void CreateItutKeypadL();
       
   237 
       
   238     /**
       
   239      * create layout icons
       
   240      *
       
   241      * @since S60 5.0
       
   242      * @param aMajorSkinId
       
   243      * @param aMinorSkinId
       
   244      * @param aBmpFileName
       
   245      * @param aBmpId
       
   246      * @param aMaskBmpId
       
   247      * @param aBmp
       
   248      * @param aMaskBmp
       
   249      * @param aSize
       
   250      * @return none
       
   251      */
       
   252     void CreateLayoutIconL(TInt aMajorSkinId,
       
   253                            TInt aMinorSkinId,
       
   254                            const TDesC& aBmpFileName,
       
   255                            TInt aBmpId,
       
   256                            TInt aMaskBmpId,
       
   257                            CFbsBitmap*& aBmp,
       
   258                            CFbsBitmap*& aMaskBmp,
       
   259                            TSize aSize);
       
   260                            
       
   261 
       
   262     /**
       
   263      * create virtual keys
       
   264      *
       
   265      * @since S60 5.0
       
   266      * @param aReader
       
   267      * @param aKeyRect
       
   268      * @return return virtual key
       
   269      */
       
   270     CVirtualKey* CreateKeyL(TResourceReader& aReader,
       
   271                             TRect aKeyRect);
       
   272 
       
   273     /**
       
   274      * create virtual keys
       
   275      *
       
   276      * @since S60 5.0
       
   277      * @param aReader
       
   278      * @param aKeyRect
       
   279      * @return None
       
   280      */
       
   281     void ChangeVirtualKeyInfoL(TResourceReader& aReader,
       
   282                               CVirtualKey* aKey);
       
   283 
       
   284     /**
       
   285      * create all buttons
       
   286      *
       
   287      * @since S60 5.0
       
   288      * @return None
       
   289      */
       
   290     void CreateAllButtonL();
       
   291     
       
   292     /**
       
   293      * create back ground control
       
   294      *
       
   295      * @since S60 5.0
       
   296      * @param aReader
       
   297      * @param aKeyRect
       
   298      * @return None
       
   299      */
       
   300     void CreateBackGroundControlL();
       
   301 
       
   302     /**
       
   303      * create dropdown list
       
   304      *
       
   305      * @since S60 5.0
       
   306      * @param aReader
       
   307      * @param aKeyRect
       
   308      * @return None
       
   309      */
       
   310     void CreateDropdownListL();
       
   311 
       
   312     /**
       
   313      * create virtual keys
       
   314      *
       
   315      * @since S60 5.0
       
   316      * @param aCtrl
       
   317      * @param aRectIdx
       
   318      * @return None
       
   319      */
       
   320     void SetCtrlRect(CFepUiBaseCtrl* aCtrl, TInt aRectIdx);
       
   321     
       
   322     /**
       
   323      * resize candidate list
       
   324      *
       
   325      * @since S60 5.0
       
   326      * @param aList
       
   327      * @param aLTPosIdx
       
   328      * @param aExpandable
       
   329      * @return None
       
   330      */
       
   331     void ResizeCandidateList( CFepCtrlDropdownList* aList, 
       
   332                               TInt aLTPosIdx, 
       
   333                               TBool aExpandable);
       
   334     
       
   335     /**
       
   336      * Calculate frame rects
       
   337      *
       
   338      * @since S60 5.0
       
   339      * @param aRect
       
   340      * @param aOuterRect
       
   341      * @param aInnerRect
       
   342      * @return None
       
   343      */
       
   344 	void CalculateFrameRects(const TRect aRect,
       
   345 							 TRect& aOuterRect, 
       
   346 						     TRect& aInnerRect);
       
   347 						     
       
   348     /**
       
   349      * create rawkey buttons
       
   350      *
       
   351      * @since S60 5.0
       
   352      * @param aControlId
       
   353      * @param aCommand
       
   354      * @return raw key button
       
   355      */
       
   356     CAknFepCtrlCommonButton* CreateRawKeyButtonL( const TInt aControlId,
       
   357                                                   const TInt aCommand);
       
   358 
       
   359     /**
       
   360      * get common button control
       
   361      *
       
   362      * @since S60 5.0
       
   363      * @param aControlId
       
   364      * @return common button control
       
   365      */
       
   366     CAknFepCtrlCommonButton* CommonButtonControl(const TInt aControlId);
       
   367 
       
   368     /**
       
   369      * create repeat buttons
       
   370      *
       
   371      * @since S60 5.0
       
   372      * @param aControlId
       
   373      * @param aCommand
       
   374      * @return repeat button
       
   375      */
       
   376     CAknFepCtrlCommonButton* CreateRepeatButtonL( const TInt aControlId,
       
   377                                                   const TInt aCommand);
       
   378                                         
       
   379     /**
       
   380      * create common buttons
       
   381      *
       
   382      * @since S60 5.0
       
   383      * @param aControlId
       
   384      * @return common button
       
   385      */
       
   386     CAknFepCtrlCommonButton* CreateCommonButtonL(const TInt aControlId);
       
   387                                         
       
   388     /**
       
   389      * create buttons
       
   390      *
       
   391      * @since S60 5.0
       
   392      * @param aType
       
   393      * @param aControlId
       
   394      * @param aRectId
       
   395      * @param aInnerRectId
       
   396      * @param aResourceId
       
   397      * @param aCommand
       
   398      * @return button
       
   399      */
       
   400     CFepUiBaseCtrl* CreateButtonL(TButtonType aType,
       
   401                                   const TInt aControlId,
       
   402                                   const TInt aRectId,
       
   403                                   const TInt aInnerRectId,
       
   404                                   const TInt aResourceId,
       
   405                                   const TInt aCommand = KUnavailableID);
       
   406   
       
   407     /**
       
   408      * Check control size change
       
   409      *
       
   410      * @since S60 5.0
       
   411      * @param aRect
       
   412      * @param aControlId
       
   413      * @param aInnerRect
       
   414      * @param aIsReloadImages
       
   415      * @return TBool
       
   416      */
       
   417     TBool ControlSizeChanged(const TInt aControlId, 
       
   418                             const TInt aRect, 
       
   419                             const TInt aInnerRect, 
       
   420                             TBool aIsReloadImages);
       
   421                                         
       
   422     /**
       
   423      * add control
       
   424      *
       
   425      * @since S60 5.0
       
   426      * @param aControl
       
   427      * @return None
       
   428      */
       
   429     void AddControlL(CFepUiBaseCtrl* aControl);
       
   430     
       
   431     /**
       
   432      * is chinese mode
       
   433      *
       
   434      * @since S60 5.0
       
   435      * @return TBool
       
   436      */
       
   437     TBool IsChineseMode();
       
   438     
       
   439     /**
       
   440      * construct key image
       
   441      *
       
   442      * @since S60 5.0
       
   443      * @param aKeyImageResID
       
   444      * @return None
       
   445      */
       
   446     void ConstructKeyImageFromResourceL( TInt aKeyImageResID );
       
   447   
       
   448     /**
       
   449      * construct key image
       
   450      *
       
   451      * @since S60 5.0
       
   452      * @param aKey
       
   453      * @param aMapData
       
   454      * @return None
       
   455      */
       
   456     void SetUnicodesForHardKey1(CVirtualKey* aKey, const TDesC& aMapData);
       
   457     
       
   458     /**
       
   459      * construct key image
       
   460      *
       
   461      * @since S60 5.0
       
   462      * @param aKeyImageResID
       
   463      * @return None
       
   464      */
       
   465     void SetUnicodesForHardKey1L(CVirtualKey* aKey, const TDesC& aMapData);
       
   466 private:
       
   467     /**
       
   468      * ITUT keypad.
       
   469      * own
       
   470      */
       
   471     CVirtualKeyboard* iStandardItutKp;
       
   472 
       
   473     /**
       
   474      * spell candidate list.
       
   475      * own
       
   476      */
       
   477     CFepCtrlDropdownList* iSpellCandsList;
       
   478     
       
   479     /**
       
   480      * candidate list.
       
   481      * own
       
   482      */
       
   483     CFepCtrlDropdownList* iCandsList;
       
   484     
       
   485     /**
       
   486      * Punc candidate list.
       
   487      * own
       
   488      */
       
   489     CFepCtrlDropdownList* iPuncCandsList;
       
   490 
       
   491     /**
       
   492      * data manager.
       
   493      * not own
       
   494      */
       
   495     CSplitItutDataMgr* iDataMgr;
       
   496 
       
   497     /**
       
   498      * init chinese control flag.
       
   499      */
       
   500     TBool iChnCtrlInited;   
       
   501  
       
   502     /**
       
   503      * layout owner.
       
   504      * not own
       
   505      */
       
   506     CSplitItutUiLayout* iLayoutOwner;
       
   507     
       
   508     /**
       
   509      * window manager
       
   510      * not own
       
   511      */
       
   512     CSplitItutWindowManager* iWindowMgr;
       
   513     
       
   514     /**
       
   515      * Background control
       
   516      * Own
       
   517      */
       
   518     CAknFepCtrlCommonBgCtrl* iBackgroundCtrl;
       
   519     
       
   520     /**
       
   521      * Spell candidate list
       
   522      * Own
       
   523      */
       
   524     CFepInputContextField* iSpell;
       
   525     
       
   526     /**
       
   527      * bitmap rotator
       
   528      * Own
       
   529      */
       
   530 	CPeninputSyncBitmapRotator* iBmpRotator;
       
   531 	
       
   532     /**
       
   533      * symbol data for chinese
       
   534      */
       
   535     TFepSymbolOfHardwareOne iSymbolData;
       
   536     };
       
   537    
       
   538 // ---------------------------------------------------------------------------
       
   539 // CSplitItutWindow::ItutKeypad
       
   540 // ---------------------------------------------------------------------------
       
   541 //
       
   542 inline CVirtualKeyboard* CSplitItutWindow::ItutKeypad()
       
   543     {
       
   544     return iStandardItutKp;    
       
   545     }
       
   546     
       
   547 #endif //C_SPLITITUTWINDOW_H