fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUIAvkonCtrlContainerChinese.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 CAknFepUICtrlContainerChinese definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #ifndef __AKN_FEP_UI_AVKON_CONTAINER_CHINESE_H__
       
    30 #define __AKN_FEP_UI_AVKON_CONTAINER_CHINESE_H__
       
    31 
       
    32 #include <AknFepUiCtrlContainerChinese.h>
       
    33 #include <coecntrl.h>
       
    34 #include <AknUtils.h>
       
    35 
       
    36 class CAknsFrameBackgroundControlContext;
       
    37 class CAknFepUICtrlInputPane;
       
    38 class CAknFepUICtrlCandidatePane;
       
    39 class CAknFepUICtrlPinyinPopup;
       
    40 class CAknFepUICtrlPinyinEEP;
       
    41 class MAknFepManagerUIInterface;
       
    42 class CAknFepUiLayoutDataMgr;
       
    43 
       
    44 class MAknFepUICtrlPinyinPopupSizeChangedObserver
       
    45     {
       
    46 public:
       
    47     /// this is called when the selection popup changes size
       
    48     virtual void SelectionPopupSizeChanged(TInt aNumLines) = 0;
       
    49 
       
    50     /// this is called when the popup is enabled
       
    51     virtual void SelectionPopupEnabled(TBool aEnabled) = 0;
       
    52     };
       
    53 
       
    54 NONSHARABLE_CLASS(CAknFepUICtrlContainerChinese)
       
    55     : 
       
    56     public CCoeControl, 
       
    57     public MAknFepUICtrlPinyinPopupSizeChangedObserver,
       
    58     public MAknFepUICtrlContainerChinese
       
    59 {
       
    60 public:
       
    61     /**
       
    62      * first phase construction
       
    63      */
       
    64     static CAknFepUICtrlContainerChinese* NewL();
       
    65 
       
    66     /**
       
    67      * destructor
       
    68      */
       
    69     ~CAknFepUICtrlContainerChinese();
       
    70 
       
    71     /**
       
    72      * get the input pane
       
    73      *
       
    74      * @return pointer to the input pane, ownership is not passed
       
    75      */
       
    76     MAknFepUICtrlInputPane* InputPane() const;
       
    77 
       
    78     /**
       
    79      * get the candidate pane
       
    80      *
       
    81      * @return pointer to the candidate pane, ownership is not passed
       
    82      */
       
    83     MAknFepUICtrlCandidatePane* CandidatePane() const;
       
    84 
       
    85     /**
       
    86      * get the phrase pinyin popup window 
       
    87      *
       
    88      * @return pointer to the phrase popup window, ownership is not passed
       
    89      */
       
    90     MAknFepUICtrlPinyinPopup* PinyinPopupWindow() const;
       
    91 
       
    92     /**
       
    93      * 
       
    94      * get the pinyin phrase creation popup window 
       
    95      * 
       
    96      * @return pointer to the pinyin phrase popup window, ownership is not passed
       
    97     */
       
    98     MAknFepUICtrlEditPane* EditPaneWindow() const;    
       
    99     
       
   100     /**
       
   101      * Is the control displayed on the screen?
       
   102      *
       
   103      * @return if not enabled, returns EFalse
       
   104      *
       
   105      */
       
   106     TBool IsEnabled() const;
       
   107 	 /**
       
   108      * Enables the display of the control. Sets the control's 
       
   109      * window postion and visibility, but only if the value has
       
   110      * changed (so it's ok to call it excessively). 
       
   111      *
       
   112      * @param aEnable if ETrue, makes visible
       
   113      *                          if EFalse, makes non-visible
       
   114      *
       
   115      */
       
   116     void Enable(TBool aEnable);
       
   117 
       
   118     /**
       
   119      * Arrange the constituent panes into the correct proportions for 
       
   120      * the required layout. 
       
   121      *
       
   122      * @param aPaneLayout the required layout
       
   123      *
       
   124      */
       
   125     void SetLayout(TPaneLayout aPaneLayout);
       
   126  
       
   127 
       
   128     /**
       
   129      * Set the Highlight to the desired control.
       
   130      *
       
   131      * @param aValue if aValue is ETrue set the focus to the Candidate Pane.
       
   132      *                          if aValue is EFalse set focus to the Chinese Input Pane 
       
   133      */
       
   134     void FocusCandidatePane(TBool aValue);
       
   135 
       
   136     /**
       
   137      * enable/disable the rendering of the Horizontal Scroll Arrows. 
       
   138      *
       
   139      * @param aValue if ETrue, enable the arrows
       
   140      *                          if EFalse, disable the arrrows
       
   141      */
       
   142     void ShowHorizontalScrollArrows(TBool aValue);
       
   143     
       
   144     /**
       
   145      * enable/disable the rendering of the Vertical Scroll Arrows. 
       
   146      *
       
   147      * @param aValue if ETrue, enable the arrows
       
   148      *                          if EFalse, disable the arrrows
       
   149      */
       
   150     void ShowVerticalScrollArrows(TBool aValue);
       
   151 
       
   152     /**
       
   153      * Call this method if the fep is being displayed for a control that is 
       
   154      * contained in a popup window (i.e. a Query). It changes the layout 
       
   155      * of the container.
       
   156      *
       
   157      * @param aValue if ETrue, use the layout for display with a query
       
   158      *                          if EFalse, use the normal layout
       
   159      */
       
   160     void SetIsShownWithPopupWindows(TBool aValue);
       
   161 
       
   162      /**
       
   163      * This function sets cursor position.
       
   164      *
       
   165      * @param aCurPos containing the cursor position 
       
   166      * @param aHeight containing font height
       
   167      */
       
   168     void SetContainerPosition(TPoint aCurPos,TInt aHeight);
       
   169     
       
   170     /**
       
   171      * Set Candidate and pinyin popup invisible
       
   172      *
       
   173      */
       
   174     void SetControlInVisible( TBool aVisible ); 
       
   175     
       
   176     /**
       
   177      * Set the state to phrase creation
       
   178      */
       
   179     void PhraseCreation( TBool aPhraseCreation );
       
   180     
       
   181     /**
       
   182      * Is the state is in phrase creation
       
   183      *
       
   184      * @return if not enabled, return EFalse
       
   185      */
       
   186     TInt& IsPhraseCreation();
       
   187     
       
   188     /**
       
   189      * Set FepMan
       
   190      *
       
   191      * @return if not enabled, return EFalse
       
   192      */
       
   193     void SetFepMan( MAknFepManagerUIInterface* aFepMan );
       
   194 
       
   195 public: // from CCoeControl
       
   196 
       
   197     /**
       
   198      * size changed
       
   199      */
       
   200     virtual void SizeChanged();
       
   201 
       
   202     /**
       
   203      * count component controls
       
   204      *
       
   205      * @return number of contained controls
       
   206      */
       
   207     TInt CountComponentControls() const;
       
   208 
       
   209     /**
       
   210      * Component control
       
   211      *
       
   212      * @param aIndex the control to return, must be between 0 and the number of controls
       
   213      * @return pointer to contained control, ownership is not passed
       
   214      * 
       
   215      */
       
   216     CCoeControl* ComponentControl(TInt aIndex) const;
       
   217 
       
   218     /**
       
   219      * draw
       
   220      *
       
   221      * @param aRect rectangle
       
   222      *
       
   223      */
       
   224     virtual void Draw(const TRect& aRect) const;
       
   225 
       
   226     virtual void HandleResourceChange(TInt aType); 
       
   227 	
       
   228 protected: // From CCoeControl
       
   229     TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   230 
       
   231 public: // from MAknFepUICtrlPinyinPopupSizeChangedObserver
       
   232 
       
   233     /**
       
   234      * called when the popup window changes size, so that it can be 
       
   235      * laid out correctly
       
   236      *
       
   237      * @param aNumLines the number of visible lines
       
   238      */
       
   239     void SelectionPopupSizeChanged(TInt aNumLines);
       
   240 
       
   241     /**
       
   242      * the popup has been enabled or disabled, so change layout where necessary 
       
   243      *
       
   244      * @param aEnabled ETrue if popup has been enabled
       
   245      *                              EFalse if popup has been disabled
       
   246      */
       
   247     void SelectionPopupEnabled(TBool aEnabled);
       
   248 protected:
       
   249 
       
   250     /**
       
   251      * second phase construction
       
   252      */
       
   253     void ConstructL();
       
   254 
       
   255     /**
       
   256      * constructor
       
   257      */
       
   258     CAknFepUICtrlContainerChinese();
       
   259 
       
   260     /**
       
   261      * layout this control relative to the control pane (aka the CBA).
       
   262      */
       
   263     void LayoutContainer();
       
   264     /**
       
   265      * layout the rectangles
       
   266      */
       
   267     void LayoutRects();
       
   268 	/**
       
   269      * layout entry pane
       
   270      */
       
   271 	void LayoutInputPane();
       
   272     /**
       
   273      * layout contained controls
       
   274      */
       
   275     void LayoutContainedControls();
       
   276 
       
   277     /**
       
   278      * layout the popup window
       
   279      */
       
   280     void LayoutPinyinPopupWindow();
       
   281     
       
   282     /**
       
   283      * layout the EEP window
       
   284      */
       
   285     void LayoutPinyinEEPWindow();
       
   286 
       
   287     /**
       
   288      * set control vilisibilty, according to the current pane layout
       
   289      */
       
   290     void SetControlVisibility();
       
   291 
       
   292     /**
       
   293      * return the layout as an index that can be passed to the 
       
   294      * layout dll 
       
   295      *
       
   296      * @return index into layout macro
       
   297      */
       
   298     TInt ConvertLayoutToIndex() const;
       
   299 
       
   300     /**
       
   301      * layout the background frames
       
   302      */
       
   303 	void LayoutFrames();
       
   304 
       
   305     /**
       
   306      * layout the background frames
       
   307 	 *
       
   308 	 * @param aOuterRect filled with outer rect coords
       
   309 	 * @param aInnerRect filled with inner rect coords
       
   310 	 *
       
   311      */
       
   312 	void CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const;    
       
   313 
       
   314 private:
       
   315     CAknFepUiLayoutDataMgr* iLafDataMgr;
       
   316     CAknFepUICtrlInputPane* iInputPane;
       
   317     CAknFepUICtrlCandidatePane* iCandidatePane;
       
   318 	CAknFepUICtrlPinyinPopup* iPinyinPopupWindow;
       
   319 	CAknFepUICtrlPinyinEEP* iEditPane;
       
   320 	CAknsFrameBackgroundControlContext* iBgContext; 
       
   321 
       
   322 private:
       
   323 	TBool iEnabled;
       
   324 	TPaneLayout iPaneLayout;
       
   325     TBool iIsShownWithPopupWindows;
       
   326 	// input pane
       
   327 	TAknLayoutRect iRectCoverMainPaneInput;
       
   328     TAknLayoutRect iRectFirstShadowInput;
       
   329     TAknLayoutRect iRectOutlineFrameInput;
       
   330     TAknLayoutRect iRectInsideAreaInput;
       
   331     TAknLayoutRect iHorizLine; //line between input pane and candidate pane
       
   332     TAknLayoutRect iEEPFirstHorizLine; //line between input pane and EEP pane
       
   333     TAknLayoutRect iEEPSecondHorizLine;////line between input pane and candidate pane when EEP exist
       
   334     TPoint iContainerPosition;
       
   335     TBool isPCLPosed;
       
   336     TBool iPhraseCreationLaf;
       
   337     
       
   338     TInt iPhraseCreation;
       
   339     MAknFepManagerUIInterface* iFepMan;
       
   340 };
       
   341 #endif  // __AKN_FEP_UI_AVKON_CONTAINER_CHINESE_H__
       
   342 
       
   343 // End of file
       
   344