textinput/peninputhwrfscn/inc/peninputhwrfscncontrolbar.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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 for chinese peninput full screen hwr
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PENINPUTHWRFSCNCONTROLBAR_H__
       
    20 #define __PENINPUTHWRFSCNCONTROLBAR_H__
       
    21 
       
    22 #include <aknfeppeninputenums.h>
       
    23 
       
    24 
       
    25 #include "peninputhwrfscnbasepanel.h"
       
    26 #include "peninputbutton.h"
       
    27 #include "peninputrepeatbutton.h"
       
    28 #include "peninputmultiimagebutton.h"
       
    29 #include "peninputlayoutlatchbutton.h"
       
    30 #include "peninputhwrfscnfunctionpanel.h"
       
    31 #include "peninputlayoutctrlgroup.h"
       
    32 
       
    33 class CPeninputLayoutInputmodelChoice;
       
    34 class CAknFepCtrlCommonButton;
       
    35 /**
       
    36 * Class CPeninputHwrfscnControlBar
       
    37 *
       
    38 * Define the control bar panel and contain controlbar buttongroup and function panel
       
    39 *
       
    40 * @lib peninputhwrfscn.lib
       
    41 * @since S60 v5.0
       
    42 */
       
    43 class CPeninputHwrfscnControlBar : public CPeninputHwrfscnBasePanel
       
    44 	{
       
    45 public:
       
    46     /**
       
    47     * The factory function
       
    48     *
       
    49     * @since Series 60 5.0
       
    50     * @param aLayout The Full screen layout
       
    51     * @return Pointer to created CPeninputHwrfscnControlBar object
       
    52     */
       
    53 	static CPeninputHwrfscnControlBar* NewL( CPeninputHwrfscnLayout* aLayout );
       
    54 
       
    55     /**
       
    56     * The destructor function
       
    57     *
       
    58     * @since Series 60 5.0
       
    59     */
       
    60     ~CPeninputHwrfscnControlBar();
       
    61 
       
    62 public:// From base class
       
    63 
       
    64     /**
       
    65     * From CPeninputHwrfscnBasePanel
       
    66     * Show controls
       
    67     *
       
    68     * @since Series 60 5.0
       
    69     * @param aVisible Show or hide
       
    70     */
       
    71 	void Show( TBool aVisible );
       
    72 
       
    73     /**
       
    74     * From CPeninputHwrfscnBasePanel
       
    75     * Draw
       
    76     *
       
    77     * @since Series 60 5.0
       
    78     */
       
    79 	virtual void Draw();
       
    80 
       
    81     /**
       
    82     * Handle control's event
       
    83     *
       
    84     * @since Series 60 5.0
       
    85     * @param aEventType Event type
       
    86     * @param aCtrl Event source
       
    87     * @param aEventData event data
       
    88     */
       
    89 	virtual void HandleControlEvent( TInt aEventType, 
       
    90 	    CFepUiBaseCtrl* aCtrl, 
       
    91 	    const TDesC& aEventData );
       
    92 
       
    93     /**
       
    94     * Handle layout command
       
    95     *
       
    96     * @since Series 60 5.0
       
    97     * @param aCommand command type
       
    98     * @param aData Event data
       
    99     */
       
   100 	virtual void HandleCommand( TInt aCommand, TUint8* aData );
       
   101 
       
   102     /**
       
   103     * From CPeninputHwrfscnBasePanel
       
   104     * Check if the property could be changed before changing it.
       
   105     *
       
   106     * @since S60 v5.0
       
   107     * @param aProperty One of @see TPeninputHwrfscnProperty changed
       
   108     * @return TBool ETrue if the property needed to be changed, EFalse otherwise
       
   109     */
       
   110     virtual TBool BeforePropertyChangedL( 
       
   111         MPeninputHwrfscnPropertySubscriber::TPeninputHwrfscnProperty aProptery);
       
   112 
       
   113 	/**
       
   114     * From CPeninputHwrfscnBasePanel
       
   115 	* Notify the property subscriber the property changed.
       
   116 	*
       
   117 	* @since S60 v5.0
       
   118 	* @param aProperty One of @see TPeninputHwrfscnProperty changed
       
   119 	*/
       
   120     virtual void PropertyChangedL(
       
   121         MPeninputHwrfscnPropertySubscriber::TPeninputHwrfscnProperty aProptery);
       
   122 
       
   123 
       
   124     /**
       
   125     * From CPeninputHwrfscnBasePanel
       
   126     * Handle size changed.
       
   127     *
       
   128     * @since S60 v5.0
       
   129     */
       
   130     void SizeChanged();
       
   131     
       
   132     /**
       
   133     * 
       
   134     * Handle skin changed.
       
   135     *
       
   136     * @since S60 v5.0
       
   137     */    
       
   138     void HandleSkinChanged();
       
   139     
       
   140     /**
       
   141     * 
       
   142     * Set enable setting button.
       
   143     *
       
   144     * @since S60 v5.0
       
   145     * @param aEnable
       
   146     */    
       
   147     void SetEnableSettingBtn(TBool aEnable);
       
   148 
       
   149 private:
       
   150     /**
       
   151     * The latch picture index
       
   152     */
       
   153     enum TLatchPicIndex
       
   154         {
       
   155         ELatchPicError = -1,
       
   156         ELatchPicMoreFunc = 0,
       
   157         ELatchPicChineseButton,
       
   158         ELatchPicEnglishButton,
       
   159         ELatchPicNumberButton,
       
   160         ELatchPicCount        
       
   161         };
       
   162     
       
   163     /**
       
   164     * Save the latched and unlatche pictures pointers
       
   165     */
       
   166     struct TLatchedPic
       
   167         {
       
   168         CFbsBitmap* iSvgLatchedBMP;
       
   169         CFbsBitmap* iSvgUnLatchedBMP;
       
   170         };
       
   171                 
       
   172 private:
       
   173    /**
       
   174     * The constructor
       
   175     *
       
   176     * @since Series 60 5.0
       
   177     * @param aLayout The layout pointer.
       
   178     */
       
   179     CPeninputHwrfscnControlBar( CPeninputHwrfscnLayout* aLayout );
       
   180 
       
   181     /**
       
   182     * 2nd phase constructor
       
   183     *
       
   184     * @since Series 60 5.0
       
   185     */
       
   186 	void ConstructL();
       
   187 
       
   188     /**
       
   189     * From CPeninputHwrfscnBasePanel
       
   190     * Handle laf (Look and feel) changed
       
   191     *
       
   192     * @since S60 v5.0
       
   193     */
       
   194     void LafChanged();
       
   195 
       
   196     /**
       
   197     * Handle control's button up event
       
   198     *
       
   199     * @since Series 60 5.0
       
   200     * @param aEventType Event type
       
   201     * @param aCtrl Event source
       
   202     * @param aEventData event data
       
   203     */
       
   204     void OnControlEvent_ButtonUp(
       
   205         TInt aEventType, 
       
   206         CFepUiBaseCtrl* aCtrl, 
       
   207 	    const TDesC& aEventData );
       
   208 
       
   209     /**
       
   210     * Handle control's button down event
       
   211     *
       
   212     * @since Series 60 5.0
       
   213     * @param aEventType Event type
       
   214     * @param aCtrl Event source
       
   215     * @param aEventData event data
       
   216     */
       
   217     void OnControlEvent_ButtonDown(
       
   218         TInt aEventType, 
       
   219         CFepUiBaseCtrl* aCtrl, 
       
   220         const TDesC& aEventData );
       
   221 
       
   222     /**
       
   223     * Create close button group
       
   224     *
       
   225     * @since Series 60 5.0
       
   226     */
       
   227     void CreateCloseBtnL( );
       
   228 
       
   229     /**
       
   230     * Create option button group
       
   231     *
       
   232     * @since Series 60 5.0
       
   233     */
       
   234     void CreateOptionBtnL( );
       
   235     
       
   236     /**
       
   237     * Create vkb switcher button group
       
   238     *
       
   239     * @since Series 60 5.0
       
   240     */
       
   241     void CreateVkbSwitcherBtnL( );
       
   242     
       
   243     /**
       
   244     * Create Range switch button group
       
   245     *
       
   246     * @since Series 60 5.0
       
   247     */
       
   248     void CreateRangeSwitchBtnGroupL();
       
   249 
       
   250     /**
       
   251     * Create Range switch cover button group
       
   252     *
       
   253     * @since Series 60 5.0
       
   254     */
       
   255     void CreateRangeSwitchCoverBtnGroupL();
       
   256 
       
   257     /**
       
   258     * Create more function button
       
   259     *
       
   260     * @since Series 60 5.0
       
   261     */
       
   262     void CreateMoreFuncBtnL();
       
   263 
       
   264     /**
       
   265     * Create more function panel
       
   266     *
       
   267     * @since Series 60 5.0
       
   268     */
       
   269     void CreateMoreFuncPanelL();
       
   270 
       
   271     /**
       
   272     * Create backspace function button
       
   273     *
       
   274     * @since Series 60 5.0
       
   275     */
       
   276     void CreateBackSpaceBtnL();
       
   277 
       
   278     /**
       
   279     * Create latched button
       
   280     *
       
   281     * @since Series 60 5.0
       
   282     * @param aRect button rectangle
       
   283     * @param aCtrlId control ID
       
   284     * @param aLatchedPicID latched picture ID
       
   285     * @param aUnLatchedID unlatched picture ID
       
   286     * @return newly created button
       
   287     */
       
   288     CAknFepCtrlCommonButton* CreateLatchedBtnLC( const TRect aRect,
       
   289         TInt aCtrlId,
       
   290         TInt aLatchedPicID,
       
   291         TInt aUnLatchedID );
       
   292 
       
   293     /**
       
   294     * Create latched button
       
   295     *
       
   296     * @since Series 60 5.0
       
   297     * @param aRect button rectangle
       
   298     * @param aCtrlId control ID
       
   299     * @param aResID resource ID
       
   300     * @return newly created button
       
   301     */
       
   302     CAknFepCtrlCommonButton* CreateNormalBtnLC( const TRect aRect, 
       
   303         TInt aCtrlId, 
       
   304         TInt aResID );
       
   305 
       
   306     /**
       
   307     * Close Range switch list
       
   308     *
       
   309     * @since Series 60 5.0
       
   310     */
       
   311     void CloseRangeSwitchList();
       
   312    
       
   313    /**
       
   314     * Hide cover range swith buttons
       
   315     *
       
   316     * @since Series 60 5.0
       
   317     */
       
   318     void HideCoverRangeSwitchBtns();
       
   319     
       
   320     /**
       
   321     * Hide range swith buttons
       
   322     *
       
   323     * @since Series 60 5.0
       
   324     */
       
   325     void HideRangeSwitchBtns( TBool aHide );
       
   326     
       
   327     /**
       
   328     * Set active cover range button
       
   329     *
       
   330     * @since Series 60 5.0
       
   331     */
       
   332     void SetActiveCoverRangeBtn();
       
   333     
       
   334     /**
       
   335     * Remove all buttons on range and cover range list
       
   336     *
       
   337     * @since Series 60 5.0
       
   338     */
       
   339     void RemoveAllSwitchBtns();
       
   340     
       
   341     /**
       
   342     * Set the range switch buttons to be latched
       
   343     *
       
   344     * @since Series 60 5.0
       
   345     */
       
   346     void ShowRangeSwitchBtnsLatched();
       
   347     
       
   348     /**
       
   349     * Open Range switch list
       
   350     *
       
   351     * @since Series 60 5.0
       
   352     */
       
   353     void OpenRangeSwitchList();
       
   354 
       
   355     /**
       
   356     * Switch more function list
       
   357     * 
       
   358     * @since Series 60 5.0
       
   359     * @param aShowNow ETrue if the function panel need be shown or EFalse otherwise
       
   360     */
       
   361     void ShowMoreFuncList( TBool aShowNow );
       
   362 
       
   363     /**
       
   364     * Click is in the Range switch group
       
   365     *
       
   366     * @since Series 60 5.0
       
   367     * @param aCtrl event source control
       
   368     */
       
   369     TBool ClickIsInRangeSwitchGrp( CFepUiBaseCtrl* aCtrl );
       
   370 
       
   371     /**
       
   372     * Update Range swtich list
       
   373     *
       
   374     * @since Series 60 5.0
       
   375     */
       
   376     void UpdateRangeSwitchL();
       
   377 
       
   378     /**
       
   379     * Update convered Range swtich list
       
   380     *
       
   381     * @since Series 60 5.0
       
   382     */
       
   383     void UpdateCoverRangeSwitchL();
       
   384     
       
   385     /**
       
   386     * Update convered Range swtich without mark picture
       
   387     *
       
   388     * @since Series 60 5.0
       
   389     */
       
   390     void UpdateWithoutMarkL();
       
   391     
       
   392     /**
       
   393     * Update convered Range swtich with mark picture
       
   394     *
       
   395     * @since Series 60 5.0
       
   396     */
       
   397     void UpdateWithMarkL();
       
   398     
       
   399     /**
       
   400     * Get current active Range
       
   401     *
       
   402     * @since Series 60 5.0
       
   403     */
       
   404     TInt ActiveRangeIndex();
       
   405 
       
   406     /**
       
   407     * Update current active Range list
       
   408     *
       
   409     * @since Series 60 5.0
       
   410     */
       
   411     void UpdateCurrentActiveRangeList();
       
   412 
       
   413     /**
       
   414     * Update current active Range
       
   415     *
       
   416     * @since Series 60 5.0
       
   417     */
       
   418     void UpdateCurrentActiveRange(); 
       
   419 
       
   420     /**
       
   421     * Get event type by the control ID
       
   422     *
       
   423     * @since Series 60 5.0
       
   424     * @param aCtrlId control ID
       
   425     * @return Event type
       
   426     */
       
   427     TInt EventTypeByCtrlId(TInt aCtrlId);
       
   428 
       
   429 	/**
       
   430 	* Get Latched pic pointer based on the control ID
       
   431 	*
       
   432 	* @since Series 60 5.0
       
   433 	* @param aCtrlId control ID
       
   434 	* @param aIndex The latched picture index
       
   435 	*/
       
   436     void GetLatchedIndexByCtrlID( TInt aCtrlID, TLatchPicIndex& aIndex );
       
   437 
       
   438 	/**
       
   439 	* Read LAF information
       
   440 	*
       
   441 	* @since Series 60 5.0
       
   442 	*/
       
   443     void ReadLAFInfo();
       
   444 
       
   445 	/**
       
   446 	* Reset Cover Range switch button size
       
   447 	*
       
   448 	* @since Series 60 5.0
       
   449 	*/
       
   450 	void ResetCoverRangeSwitchSize();
       
   451 
       
   452 	/**
       
   453 	* Reset Range switch button size
       
   454 	*
       
   455 	* @since Series 60 5.0
       
   456 	*/
       
   457 	void ResetRangeSwitchSize();
       
   458 
       
   459 	/**
       
   460 	* Reset More function button size
       
   461 	*
       
   462 	* @since Series 60 5.0
       
   463 	*/
       
   464 	void ResetMoreFuncBtnSize();
       
   465 
       
   466 	/**
       
   467 	* Reset back space button size
       
   468 	*
       
   469 	* @since Series 60 5.0
       
   470 	*/
       
   471 	void ResetBackSpaceBtnSize();
       
   472 	
       
   473 	/**
       
   474 	* Reset close, option, vkbswitcher button size
       
   475 	*
       
   476 	* @since Series 60 5.0
       
   477 	*/
       
   478 	void ResetControlBarBtnSize( );
       
   479 
       
   480 	/**
       
   481 	* Get more cover Range switch button rectangle
       
   482 	*
       
   483 	* @since Series 60 5.0
       
   484 	* @return cover Range switch button rectangle
       
   485 	*/
       
   486 	TRect CoverRangeSwitchRect();
       
   487 
       
   488 	/**
       
   489 	* Get more Range switch buttons rectangle
       
   490 	*
       
   491 	* @since Series 60 5.0
       
   492 	* @return Range switch buttons rectangle
       
   493 	*/
       
   494 	TRect RangeSwitchBtnRect(TInt aIndex);
       
   495 
       
   496 	/**
       
   497 	* Get more function button rectangle
       
   498 	*
       
   499 	* @since Series 60 5.0
       
   500 	* @return more function button rectangle
       
   501 	*/
       
   502 	TRect MoreFuncBtnRect();
       
   503 
       
   504 	/**
       
   505 	* Get back space button rectangle
       
   506 	*
       
   507 	* @since Series 60 5.0
       
   508 	* @return back space button rectangle
       
   509 	*/
       
   510 	TRect BackSpaceBtnRect();
       
   511 	
       
   512 	/**
       
   513 	* Get back space button rectangle
       
   514 	*
       
   515 	* @since Series 60 5.0
       
   516 	* @return back space button rectangle
       
   517 	*/
       
   518 	TRect ControlBarBtnRect( TInt aIndex );
       
   519 
       
   520 private:
       
   521     enum TPeninputHwrfscnControlBarGrp
       
   522         {
       
   523         //This definition is used for more function btn
       
   524         ECloseBtn = 0,
       
   525         EOptionBtn,
       
   526         EVkbSwitcherBtn,
       
   527         EControlBarBtnCount
       
   528         };
       
   529 
       
   530 
       
   531 private:
       
   532 	/**
       
   533 	* The function panel pointer
       
   534 	* Own
       
   535 	*/
       
   536     CPeninputHwrfscnFunctionPanel* iFunctionPanel;
       
   537 
       
   538 	/**
       
   539 	* Back space button
       
   540 	* Not own
       
   541 	*/
       
   542     CAknFepCtrlRepeatButton* iBackSpaceBtn;
       
   543 
       
   544 	/**
       
   545 	* More function button
       
   546 	* Not own
       
   547 	*/
       
   548     CAknFepCtrlCommonButton* iMoreFuncBtn;
       
   549 
       
   550 	/**
       
   551 	* Range switch button group
       
   552 	* Not own
       
   553 	*/
       
   554     CControlGroup* iRangeSwitchBtnGroup;    
       
   555 
       
   556 	/**
       
   557 	* Cover Range switch button group
       
   558 	* Not own
       
   559 	*/
       
   560     CControlGroup* iCoverRangeSwitchBtnGroup;
       
   561     
       
   562 	/**
       
   563 	* Close button
       
   564 	* Not own
       
   565 	*/
       
   566     CAknFepCtrlEventButton* iCloseBtn;
       
   567     
       
   568 	/**
       
   569 	* Option button
       
   570 	* Not own
       
   571 	*/
       
   572     CAknFepCtrlEventButton* iOptionBtn;
       
   573     
       
   574 	/**
       
   575 	* Vkb switcher button
       
   576 	* Not own
       
   577 	*/
       
   578     CAknFepCtrlEventButton* iVkbSwitcherBtn;   
       
   579 
       
   580 	/**
       
   581 	* Pen input mode switcher (own)
       
   582 	*/
       
   583     CPeninputLayoutInputmodelChoice* iInputModeSwitch;
       
   584 
       
   585 	/**
       
   586 	* Range switch list shown or not
       
   587 	*/
       
   588     TBool iRangeSwitchExpanded;
       
   589 
       
   590 	/**
       
   591 	* Current active Range
       
   592 	*/
       
   593     TAknFepPenInputRange iCurrentActiveRange;
       
   594 
       
   595 	/**
       
   596 	* Current Range list
       
   597 	* Own
       
   598 	*/
       
   599     RArray<TInt> iCurrentRangeList;
       
   600     
       
   601 	/**
       
   602 	* Latch pictures
       
   603 	*/
       
   604     TLatchedPic iLatchedBtnPic[ELatchPicCount];
       
   605     
       
   606 	/**
       
   607 	* Button width
       
   608 	*/
       
   609     TInt iUnitWidth;
       
   610 
       
   611 	/**
       
   612 	* Button height
       
   613 	*/
       
   614     TInt iUnitHeight;
       
   615     
       
   616     /**
       
   617      * background window for close,option,switch button
       
   618      * not own.
       
   619      */
       
   620     CControlGroup* iBkgndWnd1;
       
   621     
       
   622     /**
       
   623      * background window for more,backspace button.
       
   624      * not own.
       
   625      */
       
   626     CControlGroup* iBkgndWnd2;
       
   627 	};
       
   628 
       
   629 #endif //__PENINPUTHWRFSCNCONTROLBAR_H__