--- a/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUIAvkonCtrlCandidatePane.h Tue Sep 14 21:59:06 2010 +0300
+++ b/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUIAvkonCtrlCandidatePane.h Wed Sep 15 12:34:44 2010 +0300
@@ -36,18 +36,222 @@
#include "AknFepUICtrlCandidatePane.h"
#include "AknFepUIAvkonCtrlContainerChinese.h"
-class CAknFepUICtrlCandidateSelected;
+class CAknFepUICtrlCandidateCharacter;
+class MAknFepUIEventObserver;
+
+/**
+ * Pane which displays the preview character.
+ */
+NONSHARABLE_CLASS(CAknFepPreview) : public CCoeControl
+ {
+public:
+ /**
+ * first phase construction
+ */
+ static CAknFepPreview* NewL( RWindowTreeNode& aParent );
+
+ /**
+ * Destruction function
+ *
+ */
+ ~CAknFepPreview();
+
+ /**
+ * draw
+ *
+ * @param aRect rectangle
+ */
+ virtual void Draw( const TRect& aRect ) const;
+
+ /**
+ * size changed
+ */
+ virtual void SizeChanged();
+
+ /**
+ * Show preview lable
+ * @param aRect rectangle
+ * @param aCharacter preview text
+ */
+ void ShowL( TRect& aRect, const TDesC& aCharacter );
+
+ /**
+ * Hide preview lable
+ */
+ void HideL();
+
+ /**
+ * count component controls
+ *
+ * @return number of contained controls
+ */
+ TInt CountComponentControls() const;
+
+ /**
+ * Component control
+ *
+ * @param aIndex the control to return, must be between 0 and the number of controls
+ * @return pointer to contained control, ownership is not passed
+ */
+ CCoeControl* ComponentControl(TInt aIndex) const;
+
+protected:
+ /**
+ * Construction function
+ *
+ */
+ CAknFepPreview();
+
+ /**
+ * second phase construction
+ */
+ void ConstructL( RWindowTreeNode& aParent );
+
+ /**
+ * layout the background frames
+ *
+ * @param aOuterRect filled with outer rect coords
+ * @param aInnerRect filled with inner rect coords
+ *
+ */
+ void CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const;
+
+private:
+ // Preview lable
+ CEikLabel* iPreviewLabel;
+ };
+
+/**
+ * Pane which displays the Up arrow & Down arrow & close.
+ */
+NONSHARABLE_CLASS(CAknFepUICtrlCandidateScroll) : public CCoeControl
+ {
+public:
+ /**
+ * first phase construction
+ */
+ static CAknFepUICtrlCandidateScroll* NewL( RWindowTreeNode& aParent,
+ MAknFepUIEventObserver* aObserver );
+
+ /**
+ * destructor
+ */
+ ~CAknFepUICtrlCandidateScroll();
+
+ /**
+ * size changed
+ */
+ virtual void SizeChanged();
+
+ /**
+ * draw
+ *
+ * @param aRect rectangle
+ */
+ virtual void Draw( const TRect& aRect ) const;
+
+ /**
+ * Handle pointer event
+ * @param aPointerEvent pointer event
+ */
+ void HandlePointerEventL( const TPointerEvent & aPointerEvent );
+
+ /**
+ * enable/disable the rendering of the Up Scroll Arrows.
+ *
+ * @param aValue if ETrue, enable the arrows
+ * if EFalse, disable the arrrows
+ */
+ void ShowUpScrollArrows( TBool aValue );
+
+ /**
+ * enable/disable the rendering of the down Scroll Arrows.
+ *
+ * @param aValue if ETrue, enable the arrows
+ * if EFalse, disable the arrrows
+ */
+ void ShowDownScrollArrows( TBool aValue );
+
+ /**
+ * enable/disable the rendering of the Vertical Scroll Arrows.
+ *
+ * @param aValue if ETrue, enable the arrows
+ * if EFalse, disable the arrrows
+ */
+ void ShowVerticalScrollArrows( TBool aValue );
+
+ /**
+ * are the Vertical Scroll Arrows enabled
+ *
+ * @return if arrows not enabled, returns EFalse
+ */
+ TBool IsShowVerticalScrollArrows() const;
+
+
+protected:
+ /**
+ * second phase construction
+ */
+ void ConstructL( RWindowTreeNode& aParent, MAknFepUIEventObserver* aObserver );
+
+ /**
+ * Construct all the bitmap classes
+ */
+ void ConstructBitmapsL();
+
+ /**
+ * constructor
+ */
+ CAknFepUICtrlCandidateScroll();
+
+ /**
+ * layout contained controls
+ */
+ void LayoutIcon();
+
+ /**
+ * Calculate the close rect
+ *
+ * @param aOuterRect filled with outer rect coords
+ * @param aInnerRect filled with inner rect coords
+ *
+ */
+ void CalculateCloseRects(TRect& aOuterRect, TRect& aInnerRect) const;
+
+private:
+ CFbsBitmap* iScrollCloseBitmap;
+ CFbsBitmap* iScrollCloseBitmapMask;
+ CFbsBitmap* iNaviArrowBitmapUp;
+ CFbsBitmap* iNaviArrowBitmapUpMask;
+ CFbsBitmap* iNaviArrowBitmapDown;
+ CFbsBitmap* iNaviArrowBitmapDownMask;
+
+ TAknLayoutRect iIndiFepClose;
+ TAknLayoutRect iIndiFepArrowUp;
+ TAknLayoutRect iIndiFepArrowDown;
+
+ TBool iShowVerticalScrollArrows;
+ TBool iShowUpScrollArrows;
+ TBool iShowDownScrollArrows;
+ TBool iShowClose;
+
+ MAknFepUIEventObserver* iObServer;
+ };
/**
* Pane which displays the Chinese Candidates.
*/
-NONSHARABLE_CLASS(CAknFepUICtrlCandidatePane) : public CCoeControl, public MAknFepUICtrlCandidatePane
+NONSHARABLE_CLASS(CAknFepUICtrlCandidatePane) :
+ public CCoeControl,
+ public MAknFepUICtrlCandidatePane,
+ public MAknFepUIEventObserver
{
public:
/**
* first phase construction
*/
- static CAknFepUICtrlCandidatePane* NewL(RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr);
+ static CAknFepUICtrlCandidatePane* NewL( RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr,
+ MAknFepChineseUiMgr* aMgr );
/**
* destructor
*/
@@ -60,6 +264,12 @@
* @output the text buffer of the Pane
*/
const TDesC& TextBuffer() const;
+
+ /**
+ * Handle pointer event
+ * @param aPointerEvent pointer event
+ */
+ void HandlePointerEventL( const TPointerEvent & aPointerEvent );
/**
* Allows the client to set a descriptor pointer into an existing buffer of
@@ -169,7 +379,7 @@
* @return if arrows not enabled, returns EFalse
*/
TBool IsShowVerticalScrollArrows() const;
-
+
/**
* enable/disable the rendering of the Vertical Scroll Arrows.
*
@@ -177,22 +387,15 @@
* if EFalse, disable the arrrows
*/
void ShowVerticalScrollArrows(TBool aValue);
-
+
/**
- * enable/disable the rendering of the candidate ordinal numbers
+ * This function is not needed.
*
* @param aValue if ETrue, enable the ordinals
* if EFalse, disable the ordinals
*
*/
- void ShowCandidateOrdinals(TBool aValue);
-
- /**
- * enable/disable the rendering of the candidate ordinal numbers
- *
- * @return if not shown, return EFalse
- */
- TBool IsShowCandidateOrdinals() const;
+ void ShowCandidateOrdinals(TBool /*aValue*/){};
/**
* This function returns the number of Candidates that are visible in the pane
@@ -357,6 +560,21 @@
*/
TBool NeedGetNewCandidatePage();
+ /**
+ * Close button is pressed
+ */
+ void FepUIClosePressed();
+
+ /**
+ * Set MAknFepUiStateCtrl pointer
+ */
+ void SetFepUiState(MAknFepUiStateCtrl* aFepUiState);
+
+ /**
+ * Hide preview
+ */
+ void HidePreviewL();
+
public: // from CCoeControl
/**
* size changed
@@ -378,38 +596,20 @@
*
*/
CCoeControl* ComponentControl(TInt aIndex) const;
-
- /**
- * draw
- *
- * @param aRect rectangle
- *
- */
- virtual void Draw(const TRect& aRect) const;
-
void Enable(TBool aEnable);
protected:
+
/**
* second phase construction
*/
void ConstructL(RWindow& aParent);
/**
- * Construct all the bitmap classes
- */
- void ConstructBitmapsL();
-
- /**
- * constructor
+ * Construct function
*/
- CAknFepUICtrlCandidatePane( CAknFepUiLayoutDataMgr* aLafDataMgr );
-
- /**
- * layout the rectangles
- */
- void LayoutRects();
+ CAknFepUICtrlCandidatePane( CAknFepUiLayoutDataMgr* aLafDataMgr, MAknFepChineseUiMgr* aMgr );
/**
* layout contained controls
@@ -420,22 +620,16 @@
* layout the labels for a single candidate
*/
void LayoutLabel(TInt aIndex);
-
+
/**
* layout the labels for all the candidates (even those that are not currently visible)
*/
void LayoutLabels();
/**
- * layout selected candidate
- * <p> Note that there is only one instance, as there can
- * only be one selected candidate at a time. Therefore, the control
- * is placed in the position that is correct based on the current selection
- *
- * @param aIndex the index of the new position of the selected candidate
- *
+ * layout the scroll pane
*/
- void LayoutCandidateSelected();
+ void LayoutScroll();
/**
* set label vilisibilty, according to the current pane layout
@@ -456,44 +650,26 @@
*/
void InternalSpilitPhraseCandidate();
-private: // the following are owned
- CAknFepUICtrlCandidateSelected* iCandidateSelected;
- CFbsBitmap* iNaviArrowBitmapLeft;
- CFbsBitmap* iNaviArrowBitmapLeftMask;
- CFbsBitmap* iNaviArrowBitmapRight;
- CFbsBitmap* iNaviArrowBitmapRightMask;
- CFbsBitmap* iNaviArrowBitmapUp;
- CFbsBitmap* iNaviArrowBitmapUpMask;
- CFbsBitmap* iNaviArrowBitmapDown;
- CFbsBitmap* iNaviArrowBitmapDownMask;
private: // the following need resetting
- RPointerArray<CEikLabel> iCandidateLabelArray;
- RPointerArray<CEikLabel> iOrdinalLabelArray;
+ RPointerArray<CAknFepUICtrlCandidateCharacter> iCandidateLabelArray;
RArray<TCandidateMode> iCandidateModeArray;
private: // the following are members
CAknFepUiLayoutDataMgr* iLafDataMgr;
- TAknLayoutRect iIndiFepArrowLeft;
- TAknLayoutRect iIndiFepArrowRight;
- TAknLayoutRect iIndiFepArrowUp;
- TAknLayoutRect iIndiFepArrowDown;
TBufC<EMaxCandidates> iBuffer;
CAknFepUICtrlContainerChinese::TPaneLayout iPaneLayout;
TInt iVisibleCount;
TInt iSelected;
TBool iHighlighted;
- TBool iShowHorizontalScrollArrows;
- TBool iShowVerticalScrollArrows;
- TBool iShowUpScrollArrows;
- TBool iShowDownScrollArrows;
- TBool iShowLeftScrollArrows;
- TBool iShowRightScrollArrows;
- TBool iShowCandidateOrdinals;
RArray<TPage> iPages;
//next paging candidate index
TInt iUnpagedIndex;
TInt iCurDisplayPage;
CDesCArrayFlat* iCandidateArray;
- TInt iOrdinalLableWidth;
+ MAknFepChineseUiMgr* iChineseUiMgr;
+ MAknFepUiStateCtrl* iFepUiState;
+ CAknFepUICtrlCandidateScroll* iCtrlScroll;
+ CAknFepPreview* iPreview;
+ TBool iPointDown;
};
#endif //__AKN_FEP_AVKON_CANDIDATE_PANE_H__