fep/aknfep/UiPlugins/AknFepUiInterface/inc/AknFepUICtrlCandidateSelected.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-2004 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:           
       
    15 *       Provides the CAknFepUICtrlCandidateSelected definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #ifndef __AKN_FEP_CANDIDATE_SELECTED_PANE_H__
       
    31 #define __AKN_FEP_CANDIDATE_SELECTED_PANE_H__
       
    32 
       
    33 #include <e32std.h>
       
    34 #include <coecntrl.h>
       
    35 
       
    36 #include "AknFepUICtrlCandidatePane.h"
       
    37 
       
    38 class CEikLabel;
       
    39 
       
    40 /**
       
    41  * Control representing the selected candidate. Is a window owning control,
       
    42  * that appears over the candidate pane such that it obscures the labels
       
    43  * beneath. Can be hidden, for example if there is no visible selection, 
       
    44  * or if highlighting is disabled.
       
    45  */
       
    46 class CAknFepUICtrlCandidateSelected : public CCoeControl
       
    47     {
       
    48 public:
       
    49     enum
       
    50         {
       
    51 		EOneCandidate = 1,
       
    52         EMaxSelectedCandidateLength = 10 // extend buffer for phrase input
       
    53         };
       
    54 public:
       
    55 
       
    56     /**
       
    57      * first phase construction
       
    58      */
       
    59     static CAknFepUICtrlCandidateSelected* NewL(RWindowTreeNode& aParent);
       
    60 
       
    61     /**
       
    62      * destructor
       
    63      */
       
    64     ~CAknFepUICtrlCandidateSelected();
       
    65 
       
    66     /**
       
    67      * Set the text buffer of the Pane.
       
    68      *
       
    69      * @param aCharacter, the label will be filled with the characters from aCharacter
       
    70      */
       
    71     void SetText(TPtrC aCharacter);
       
    72     
       
    73     /**
       
    74      * Set the ordinal of the Pane.
       
    75      *
       
    76      * @param aOrdinal
       
    77      */
       
    78     void SetOrdinal(TInt aOrdinal);
       
    79 
       
    80     /**
       
    81      * This function sets the candidate mode of the pane for rendering purposes.
       
    82      *
       
    83      * @param aMode the new mode
       
    84      */
       
    85     void SetCandidateMode(CAknFepUICtrlCandidatePane::TCandidateMode aMode);
       
    86 
       
    87 	/**
       
    88 	* Set layout
       
    89 	* @param aLayout the new layout
       
    90 	*/
       
    91 	void SetLayout(CAknFepUICtrlContainerChinese::TPaneLayout aLayout);
       
    92 	/**
       
    93 	* Set ordinal status
       
    94 	* @param aValue the new status
       
    95 	*/
       
    96 	void ShowOrdinal(TBool aValue);
       
    97 
       
    98 public: // from CCoeControl
       
    99     /**
       
   100      * size changed
       
   101      */
       
   102     virtual void SizeChanged();
       
   103 
       
   104     /**
       
   105      * count component controls
       
   106      *
       
   107      * @return number of contained controls
       
   108      */
       
   109     TInt CountComponentControls() const;
       
   110 
       
   111     /**
       
   112      * Component control
       
   113      *
       
   114      * @param aIndex the control to return, must be between 0 and the number of controls
       
   115      * @return pointer to contained control, ownership is not passed
       
   116      */
       
   117     CCoeControl* ComponentControl(TInt aIndex) const;
       
   118 
       
   119     /**
       
   120      * draw
       
   121      *
       
   122      * @param aRect rectangle
       
   123      */
       
   124     virtual void Draw(const TRect& aRect) const;
       
   125 
       
   126 protected:
       
   127     /**
       
   128      * second phase construction
       
   129      */
       
   130     void ConstructL(RWindowTreeNode& aParent);
       
   131 
       
   132      /**
       
   133       * constructor
       
   134       */
       
   135     CAknFepUICtrlCandidateSelected();
       
   136 
       
   137     /**
       
   138      * layout the rectangles
       
   139      */
       
   140     void LayoutRects();
       
   141 
       
   142     /**
       
   143      * layout contained controls
       
   144      */
       
   145     void LayoutContainedControls();
       
   146 
       
   147     /**
       
   148      * layout the background frames
       
   149      *
       
   150      * @param aOuterRect filled with outer rect coords
       
   151      * @param aInnerRect filled with inner rect coords
       
   152      *
       
   153      */
       
   154     void CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const;
       
   155 
       
   156     /**
       
   157      * set label vilisibilty, according to the current pane layout
       
   158      */
       
   159     void UpdateLabelVisibility();
       
   160 
       
   161 private:
       
   162     TAknLayoutRect iRectShadow;
       
   163     TAknLayoutRect iRectHighlight;
       
   164 	TBufC<EMaxSelectedCandidateLength> iBuffer;
       
   165     CAknFepUICtrlCandidatePane::TCandidateMode iCandidateMode;
       
   166     TInt iIndex;
       
   167     CAknFepUICtrlContainerChinese::TPaneLayout iPaneLayout;
       
   168 	TBool iShowOrdinal;
       
   169 private: // the following are owned
       
   170     CEikLabel* iCandidateLabel;
       
   171     CEikLabel* iOrdinalLabel;
       
   172     };
       
   173 
       
   174 #endif //__AKN_FEP_CANDIDATE_SELECTED_PANE_H__
       
   175 
       
   176 // End of file