fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUIAvkonCtrlCandidatePane.h
branchRCL_3
changeset 50 5a1685599b76
parent 44 ecbabf52600f
child 56 8152b1f1763a
equal deleted inserted replaced
46:bd83ceabce89 50:5a1685599b76
    34 #include <coecntrl.h>
    34 #include <coecntrl.h>
    35 
    35 
    36 #include "AknFepUICtrlCandidatePane.h"
    36 #include "AknFepUICtrlCandidatePane.h"
    37 #include "AknFepUIAvkonCtrlContainerChinese.h"
    37 #include "AknFepUIAvkonCtrlContainerChinese.h"
    38 
    38 
    39 class CAknFepUICtrlCandidateSelected;
    39 class CAknFepUICtrlCandidateCharacter;
       
    40 class MAknFepUIEventObserver;
       
    41 
       
    42 /**
       
    43  * Pane which displays the preview character.
       
    44  */
       
    45 NONSHARABLE_CLASS(CAknFepPreview) : public CCoeControl
       
    46 	{
       
    47 public:
       
    48 	/**
       
    49 	 * first phase construction
       
    50 	 */
       
    51 	static CAknFepPreview* NewL( RWindowTreeNode& aParent );
       
    52 	
       
    53 	/**
       
    54 	 * Destruction function
       
    55 	 *
       
    56 	 */
       
    57 	~CAknFepPreview();	
       
    58 		
       
    59 	/**
       
    60 	 * draw
       
    61 	 *
       
    62 	 * @param aRect rectangle
       
    63 	 */
       
    64 	virtual void Draw( const TRect& aRect ) const;
       
    65 	
       
    66 	/**
       
    67 	 * size changed
       
    68 	 */
       
    69 	virtual void SizeChanged();
       
    70 	
       
    71 	/**
       
    72 	 * Show preview lable
       
    73 	 * @param aRect rectangle
       
    74 	 * @param aCharacter preview text
       
    75 	 */
       
    76 	void ShowL( TRect& aRect, const TDesC& aCharacter );
       
    77 	
       
    78 	/**
       
    79 	 * Hide preview lable
       
    80 	 */
       
    81 	void HideL();
       
    82 	
       
    83 	/**
       
    84 	 * count component controls
       
    85 	 *
       
    86 	 * @return number of contained controls
       
    87 	 */
       
    88 	TInt CountComponentControls() const;
       
    89 
       
    90 	/**
       
    91 	 * Component control
       
    92 	 *
       
    93 	 * @param aIndex the control to return, must be between 0 and the number of controls
       
    94 	 * @return pointer to contained control, ownership is not passed
       
    95 	 */
       
    96 	CCoeControl* ComponentControl(TInt aIndex) const;
       
    97 	
       
    98 protected:
       
    99 	/**
       
   100 	 * Construction function
       
   101 	 *
       
   102 	 */
       
   103 	CAknFepPreview();
       
   104 	
       
   105 	/**
       
   106 	 * second phase construction
       
   107 	 */
       
   108 	void ConstructL( RWindowTreeNode& aParent );
       
   109 	
       
   110 	/**
       
   111 	 * layout the background frames
       
   112 	 *
       
   113 	 * @param aOuterRect filled with outer rect coords
       
   114 	 * @param aInnerRect filled with inner rect coords
       
   115 	 *
       
   116 	 */
       
   117     void CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const;
       
   118 
       
   119 private:
       
   120     // Preview lable
       
   121 	CEikLabel* iPreviewLabel;
       
   122 	};
       
   123 
       
   124 /**
       
   125  * Pane which displays the Up arrow & Down arrow & close.
       
   126  */
       
   127 NONSHARABLE_CLASS(CAknFepUICtrlCandidateScroll) : public CCoeControl
       
   128 	{
       
   129 public:
       
   130 	/**
       
   131 	 * first phase construction
       
   132 	 */
       
   133 	static CAknFepUICtrlCandidateScroll* NewL( RWindowTreeNode& aParent, 
       
   134 		                                       MAknFepUIEventObserver* aObserver );
       
   135 
       
   136 	/**
       
   137 	 * destructor
       
   138 	 */
       
   139 	~CAknFepUICtrlCandidateScroll();
       
   140 
       
   141 	/**
       
   142 	 * size changed
       
   143 	 */
       
   144 	virtual void SizeChanged();	
       
   145 
       
   146 	/**
       
   147 	 * draw
       
   148 	 *
       
   149 	 * @param aRect rectangle
       
   150 	 */
       
   151 	virtual void Draw( const TRect& aRect ) const;	
       
   152 	
       
   153     /**
       
   154      * Handle pointer event
       
   155      * @param aPointerEvent pointer event
       
   156      */
       
   157     void HandlePointerEventL( const TPointerEvent & aPointerEvent );
       
   158     
       
   159     /**
       
   160      * enable/disable the rendering of the Up Scroll Arrows. 
       
   161      *
       
   162      * @param aValue if ETrue, enable the arrows
       
   163      *  if EFalse, disable the arrrows
       
   164      */
       
   165 	void ShowUpScrollArrows( TBool aValue );
       
   166 	
       
   167     /**
       
   168      * enable/disable the rendering of the down Scroll Arrows. 
       
   169      *
       
   170      * @param aValue if ETrue, enable the arrows
       
   171      *  if EFalse, disable the arrrows
       
   172      */
       
   173 	void ShowDownScrollArrows( TBool aValue );
       
   174 	
       
   175     /**
       
   176      * enable/disable the rendering of the Vertical Scroll Arrows. 
       
   177      *
       
   178      * @param aValue if ETrue, enable the arrows
       
   179      *                          if EFalse, disable the arrrows
       
   180      */
       
   181 	void ShowVerticalScrollArrows( TBool aValue );
       
   182 	
       
   183     /**
       
   184      * are the Vertical Scroll Arrows enabled
       
   185      *
       
   186      * @return if arrows not enabled, returns EFalse
       
   187      */
       
   188 	TBool IsShowVerticalScrollArrows() const;
       
   189 		
       
   190     
       
   191 protected:
       
   192 	/**
       
   193 	 * second phase construction
       
   194 	 */
       
   195 	void ConstructL( RWindowTreeNode& aParent, MAknFepUIEventObserver* aObserver );
       
   196 	
       
   197     /**
       
   198      * Construct all the bitmap classes
       
   199      */
       
   200     void ConstructBitmapsL();
       
   201     
       
   202 	/**
       
   203 	  * constructor
       
   204 	  */
       
   205 	CAknFepUICtrlCandidateScroll();
       
   206 	
       
   207 	/**
       
   208 	 * layout contained controls
       
   209 	 */
       
   210 	void LayoutIcon();
       
   211 	
       
   212 	/**
       
   213 	 * Calculate the close rect
       
   214 	 *
       
   215 	 * @param aOuterRect filled with outer rect coords
       
   216 	 * @param aInnerRect filled with inner rect coords
       
   217 	 *
       
   218 	 */
       
   219 	void CalculateCloseRects(TRect& aOuterRect, TRect& aInnerRect) const;
       
   220 
       
   221 private:
       
   222     CFbsBitmap* iScrollCloseBitmap;
       
   223     CFbsBitmap* iScrollCloseBitmapMask;
       
   224     CFbsBitmap* iNaviArrowBitmapUp;
       
   225     CFbsBitmap* iNaviArrowBitmapUpMask;
       
   226     CFbsBitmap* iNaviArrowBitmapDown;
       
   227     CFbsBitmap* iNaviArrowBitmapDownMask;
       
   228     
       
   229     TAknLayoutRect iIndiFepClose;
       
   230     TAknLayoutRect iIndiFepArrowUp;
       
   231     TAknLayoutRect iIndiFepArrowDown;
       
   232     
       
   233     TBool iShowVerticalScrollArrows;
       
   234     TBool iShowUpScrollArrows;
       
   235     TBool iShowDownScrollArrows;
       
   236     TBool iShowClose;
       
   237     
       
   238     MAknFepUIEventObserver* iObServer;
       
   239 	};
    40 
   240 
    41 /**
   241 /**
    42  * Pane which displays the Chinese Candidates.
   242  * Pane which displays the Chinese Candidates.
    43  */
   243  */
    44 NONSHARABLE_CLASS(CAknFepUICtrlCandidatePane) : public CCoeControl, public MAknFepUICtrlCandidatePane
   244 NONSHARABLE_CLASS(CAknFepUICtrlCandidatePane) : 
       
   245 				public CCoeControl,
       
   246 				public MAknFepUICtrlCandidatePane,
       
   247 				public MAknFepUIEventObserver
    45     {
   248     {
    46 public:
   249 public:
    47     /**
   250     /**
    48      * first phase construction
   251      * first phase construction
    49      */
   252      */
    50     static CAknFepUICtrlCandidatePane* NewL(RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr);
   253     static CAknFepUICtrlCandidatePane* NewL( RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr, 
       
   254 											 MAknFepChineseUiMgr* aMgr );
    51     /**
   255     /**
    52      * destructor
   256      * destructor
    53      */
   257      */
    54     ~CAknFepUICtrlCandidatePane();
   258     ~CAknFepUICtrlCandidatePane();
    55 public:
   259 public:
    58      * which will subsequently be displayed.
   262      * which will subsequently be displayed.
    59      *
   263      *
    60      * @output the text buffer of the Pane
   264      * @output the text buffer of the Pane
    61      */
   265      */
    62     const TDesC& TextBuffer() const;
   266     const TDesC& TextBuffer() const;
       
   267     
       
   268     /**
       
   269      * Handle pointer event
       
   270      * @param aPointerEvent pointer event
       
   271      */
       
   272     void HandlePointerEventL( const TPointerEvent & aPointerEvent );
    63 
   273 
    64     /**
   274     /**
    65      * Allows the client to set a descriptor pointer into an existing buffer of 
   275      * Allows the client to set a descriptor pointer into an existing buffer of 
    66      * data, avoiding unnecessary copying of data.
   276      * data, avoiding unnecessary copying of data.
    67      * <p> Note that if the buffer contains less characters than the current
   277      * <p> Note that if the buffer contains less characters than the current
   167      * are the Vertical Scroll Arrows enabled?
   377      * are the Vertical Scroll Arrows enabled?
   168      *
   378      *
   169      * @return if arrows not enabled, returns EFalse
   379      * @return if arrows not enabled, returns EFalse
   170      */
   380      */
   171     TBool IsShowVerticalScrollArrows() const;
   381     TBool IsShowVerticalScrollArrows() const;
   172 
   382 		
   173     /**
   383     /**
   174      * enable/disable the rendering of the Vertical Scroll Arrows. 
   384      * enable/disable the rendering of the Vertical Scroll Arrows. 
   175      *
   385      *
   176      * @param aValue if ETrue, enable the arrows
   386      * @param aValue if ETrue, enable the arrows
   177      *                          if EFalse, disable the arrrows
   387      *                          if EFalse, disable the arrrows
   178      */
   388      */
   179     void ShowVerticalScrollArrows(TBool aValue);
   389     void ShowVerticalScrollArrows(TBool aValue);
   180 
   390     
   181     /**
   391     /**
   182      * enable/disable the rendering of the candidate ordinal numbers
   392      * This function is not needed.
   183      *
   393      *
   184      * @param aValue if ETrue, enable the ordinals
   394      * @param aValue if ETrue, enable the ordinals
   185      *                          if EFalse, disable the ordinals
   395      *                          if EFalse, disable the ordinals
   186      *
   396      *
   187      */
   397      */
   188     void ShowCandidateOrdinals(TBool aValue);
   398     void ShowCandidateOrdinals(TBool /*aValue*/){};
   189 
       
   190     /**
       
   191      * enable/disable the rendering of the candidate ordinal numbers
       
   192      *
       
   193      * @return if not shown, return EFalse
       
   194      */
       
   195     TBool IsShowCandidateOrdinals() const;
       
   196 
   399 
   197     /**
   400     /**
   198      * This function returns the number of Candidates that are visible in the pane 
   401      * This function returns the number of Candidates that are visible in the pane 
   199      * in its current configuration.
   402      * in its current configuration.
   200      *
   403      *
   355 	/**
   558 	/**
   356 	 *	To test whether need to get new candidate page
   559 	 *	To test whether need to get new candidate page
   357 	 */
   560 	 */
   358 	TBool NeedGetNewCandidatePage();
   561 	TBool NeedGetNewCandidatePage();
   359 	
   562 	
       
   563 	/**
       
   564 	 *	Close button is pressed
       
   565 	 */
       
   566 	void FepUIClosePressed();
       
   567 
       
   568 	/**
       
   569 	 *	Set MAknFepUiStateCtrl pointer
       
   570 	 */
       
   571 	void SetFepUiState(MAknFepUiStateCtrl* aFepUiState);	
       
   572 	
       
   573 	/**
       
   574 	 *	Hide preview
       
   575 	 */
       
   576 	void HidePreviewL();
       
   577 
   360 public: // from CCoeControl
   578 public: // from CCoeControl
   361     /**
   579     /**
   362      * size changed
   580      * size changed
   363      */
   581      */
   364     virtual void SizeChanged();
   582     virtual void SizeChanged();
   376      * @param aIndex the control to return, must be between 0 and the number of controls
   594      * @param aIndex the control to return, must be between 0 and the number of controls
   377      * @return pointer to contained control, ownership is not passed
   595      * @return pointer to contained control, ownership is not passed
   378      * 
   596      * 
   379      */
   597      */
   380     CCoeControl* ComponentControl(TInt aIndex) const;
   598     CCoeControl* ComponentControl(TInt aIndex) const;
   381 
       
   382     /**
       
   383      * draw
       
   384      *
       
   385      * @param aRect rectangle
       
   386      *
       
   387      */
       
   388     virtual void Draw(const TRect& aRect) const;
       
   389     
       
   390     
   599     
   391     void Enable(TBool aEnable);
   600     void Enable(TBool aEnable);
   392 
   601 
   393 protected:
   602 protected:
       
   603     
   394     /**
   604     /**
   395      * second phase construction
   605      * second phase construction
   396      */
   606      */
   397     void ConstructL(RWindow& aParent);
   607     void ConstructL(RWindow& aParent);
   398 
   608 
   399     /**
   609     /**
   400      * Construct all the bitmap classes
   610      * Construct function
   401      */
   611      */
   402     void ConstructBitmapsL();
   612     CAknFepUICtrlCandidatePane( CAknFepUiLayoutDataMgr* aLafDataMgr, MAknFepChineseUiMgr* aMgr );
   403 
       
   404     /**
       
   405      * constructor
       
   406      */
       
   407     CAknFepUICtrlCandidatePane( CAknFepUiLayoutDataMgr* aLafDataMgr );
       
   408 
       
   409     /**
       
   410      * layout the rectangles
       
   411      */
       
   412     void LayoutRects();
       
   413 
   613 
   414     /**
   614     /**
   415      * layout contained controls
   615      * layout contained controls
   416      */
   616      */
   417     void LayoutContainedControls();
   617     void LayoutContainedControls();
   418 
   618 
   419     /**
   619     /**
   420      * layout the labels for a single candidate
   620      * layout the labels for a single candidate
   421      */
   621      */
   422     void LayoutLabel(TInt aIndex);
   622     void LayoutLabel(TInt aIndex);
   423 
   623     
   424     /**
   624     /**
   425      * layout the labels for all the candidates (even those that are not currently visible)
   625      * layout the labels for all the candidates (even those that are not currently visible)
   426      */
   626      */
   427     void LayoutLabels();
   627     void LayoutLabels();
   428 
   628 
   429     /**
   629     /**
   430      * layout selected candidate
   630      * layout the scroll pane
   431      * <p> Note that there is only one instance, as there can 
   631      */
   432      * only be one selected candidate at a time. Therefore, the control
   632     void LayoutScroll();
   433      * is placed in the position that is correct based on the current selection
       
   434      *
       
   435      * @param aIndex the index of the new position of the selected candidate
       
   436      *
       
   437      */
       
   438     void LayoutCandidateSelected();
       
   439 
   633 
   440     /**
   634     /**
   441      * set label vilisibilty, according to the current pane layout
   635      * set label vilisibilty, according to the current pane layout
   442      */
   636      */
   443     void UpdateLabelVisibility();
   637     void UpdateLabelVisibility();
   454      * Only paging once per call.
   648      * Only paging once per call.
   455      * 
   649      * 
   456      */
   650      */
   457     void InternalSpilitPhraseCandidate();
   651     void InternalSpilitPhraseCandidate();
   458 
   652 
   459 private: // the following are owned
       
   460     CAknFepUICtrlCandidateSelected* iCandidateSelected;
       
   461     CFbsBitmap* iNaviArrowBitmapLeft;
       
   462     CFbsBitmap* iNaviArrowBitmapLeftMask;
       
   463     CFbsBitmap* iNaviArrowBitmapRight;
       
   464     CFbsBitmap* iNaviArrowBitmapRightMask;
       
   465     CFbsBitmap* iNaviArrowBitmapUp;
       
   466     CFbsBitmap* iNaviArrowBitmapUpMask;
       
   467     CFbsBitmap* iNaviArrowBitmapDown;
       
   468     CFbsBitmap* iNaviArrowBitmapDownMask;
       
   469 private: // the following need resetting
   653 private: // the following need resetting
   470     RPointerArray<CEikLabel> iCandidateLabelArray;
   654     RPointerArray<CAknFepUICtrlCandidateCharacter> iCandidateLabelArray;
   471     RPointerArray<CEikLabel> iOrdinalLabelArray;
       
   472     RArray<TCandidateMode> iCandidateModeArray;
   655     RArray<TCandidateMode> iCandidateModeArray;
   473 private: // the following are members
   656 private: // the following are members
   474     CAknFepUiLayoutDataMgr* iLafDataMgr;
   657     CAknFepUiLayoutDataMgr* iLafDataMgr;
   475     TAknLayoutRect iIndiFepArrowLeft;
       
   476     TAknLayoutRect iIndiFepArrowRight;
       
   477     TAknLayoutRect iIndiFepArrowUp;
       
   478     TAknLayoutRect iIndiFepArrowDown;
       
   479     TBufC<EMaxCandidates> iBuffer;
   658     TBufC<EMaxCandidates> iBuffer;
   480     CAknFepUICtrlContainerChinese::TPaneLayout iPaneLayout;
   659     CAknFepUICtrlContainerChinese::TPaneLayout iPaneLayout;
   481     TInt iVisibleCount;
   660     TInt iVisibleCount;
   482     TInt iSelected;
   661     TInt iSelected;
   483     TBool iHighlighted;
   662     TBool iHighlighted;
   484     TBool iShowHorizontalScrollArrows;
       
   485     TBool iShowVerticalScrollArrows;
       
   486     TBool iShowUpScrollArrows;
       
   487     TBool iShowDownScrollArrows;
       
   488     TBool iShowLeftScrollArrows;
       
   489     TBool iShowRightScrollArrows;
       
   490     TBool iShowCandidateOrdinals;
       
   491     RArray<TPage> iPages;
   663     RArray<TPage> iPages;
   492     //next paging candidate index
   664     //next paging candidate index
   493     TInt iUnpagedIndex;
   665     TInt iUnpagedIndex;
   494     TInt iCurDisplayPage;
   666     TInt iCurDisplayPage;
   495     CDesCArrayFlat* iCandidateArray;
   667     CDesCArrayFlat* iCandidateArray;
   496     TInt iOrdinalLableWidth;
   668     MAknFepChineseUiMgr* iChineseUiMgr;
       
   669     MAknFepUiStateCtrl* iFepUiState;
       
   670     CAknFepUICtrlCandidateScroll* iCtrlScroll;
       
   671     CAknFepPreview* iPreview;
       
   672     TBool iPointDown;
   497     };
   673     };
   498 
   674 
   499 #endif //__AKN_FEP_AVKON_CANDIDATE_PANE_H__
   675 #endif //__AKN_FEP_AVKON_CANDIDATE_PANE_H__
   500 
   676 
   501 // End of file
   677 // End of file