emailuis/uicomponents/inc/fsfastaddressingvisualizer.h
branchRCL_3
changeset 25 3533d4323edc
parent 0 8466d47a6819
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Declaration of CFsFastAddressingVisualizer class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSFASTADDRESSINGVISUALIZER_H
       
    20 #define C_FSFASTADDRESSINGVISUALIZER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 //<cmail> removed __FS_ALFRED_SUPPORT flag (other places in this file not tagged!)
       
    25 //#include <fsconfig.h>
       
    26 /*#ifdef __FS_ALFRED_SUPPORT
       
    27 #else // !__FS_ALFRED_SUPPORT
       
    28 #endif // __FS_ALFRED_SUPPORT*/
       
    29 //</cmail> removed __FS_ALFRED_SUPPORT flag
       
    30 #include "fsfastaddressinglist.h"
       
    31 
       
    32 class CAlfAnchorLayout;
       
    33 class CAlfFlowLayout;
       
    34 class CFsTextInputVisual;
       
    35 
       
    36 /**
       
    37  * CFsFastAddressingVisualizer class is responsible for visualisation
       
    38  * of the fast addressing list component. The class constructs the
       
    39  * visualization tree and manages the visualization of the text input field.
       
    40  *
       
    41  */
       
    42 
       
    43 NONSHARABLE_CLASS( CFsFastAddressingVisualizer ) : public CBase
       
    44     {
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Two-phased constructor
       
    49      *
       
    50      * @param aOwner Owner of visualizer
       
    51      * @param aTextControl CoeControl of which the Rect will be handled
       
    52      * @return Created instance of CFsFastAddressingVisualizer class
       
    53      */
       
    54     static CFsFastAddressingVisualizer* NewL( CAlfControl& aOwner,
       
    55         CCoeControl& aTextControl );
       
    56 
       
    57     /**
       
    58      * Two-phased constructor
       
    59      *
       
    60      * @param aOwner Owner of visualizer
       
    61      * @param aTextControl CoeControl of which the Rect will be handled
       
    62      * @return Created instance of CFsFastAddressingVisualizer class
       
    63      */
       
    64     static CFsFastAddressingVisualizer* NewLC( CAlfControl& aOwner,
       
    65         CCoeControl& aTextControl );
       
    66 
       
    67     /**
       
    68      * Destructor
       
    69      */
       
    70     virtual ~CFsFastAddressingVisualizer();
       
    71 
       
    72     /**
       
    73      * Set the icon image.
       
    74      *
       
    75      * @param aIconID Sets icon image
       
    76      * @param aImage Image to be set
       
    77      */
       
    78     void SetIcon(
       
    79         const CFsFastAddressingList::TIconID aIconID,
       
    80         const TAlfImage& aImage );
       
    81 
       
    82     /**
       
    83      * Sets icon visibility
       
    84      *
       
    85      * @param aIconID Sets icon image
       
    86      * @param aVisible State of icon visibility.
       
    87      */
       
    88     void SetIconVisible( const CFsFastAddressingList::TIconID aIconID,
       
    89                          const TBool aVisible );
       
    90 
       
    91     /**
       
    92      * Returns the icon visibility.
       
    93      * @param aIconID Id of icon which visiblity will be set
       
    94      * @return TBool icon visibility status.
       
    95      */
       
    96     TBool IconVisible( const CFsFastAddressingList::TIconID aIconID ) const;
       
    97 
       
    98     /**
       
    99      * Redraw the FAL.
       
   100      */
       
   101     void Refresh();
       
   102 
       
   103 
       
   104     /**
       
   105      * Sets list visiblity
       
   106      *
       
   107      * @param aVisible If ETrue list is set to be visible.
       
   108      *                 If EFalse list is set to invisible.
       
   109      */
       
   110     void SetVisible( const TBool aVisible );
       
   111 
       
   112     /**
       
   113      * Move selection up.
       
   114      * Selection implemented in TreeList.
       
   115      */
       
   116 
       
   117     void MoveSelectionUp();
       
   118     /**
       
   119      * Move selection down.
       
   120      * Selection implemented in TreeList.
       
   121      */
       
   122 
       
   123     void MoveSelectionDown();
       
   124 
       
   125     /**
       
   126      * Returns pointer to the layout for the text input field.
       
   127      * @return Layout for the text input field.
       
   128      */
       
   129     CAlfLayout* GetTextLayout() const;
       
   130 
       
   131     /**
       
   132      * Sets visibility of the text field layout.
       
   133      * @param iVisible visibility of the text input field.
       
   134      */
       
   135     void SetTextFieldVisible( const TBool iVisible );
       
   136 
       
   137     /**
       
   138      * Returns status of visibility of the text field layout.
       
   139      * @return TBool visibility status of the text input field.
       
   140      */
       
   141     TBool IsTextFieldVisible() const;
       
   142 
       
   143     /**
       
   144      * Sets position of the list (bottom of text field or on top of text field)
       
   145      * @param aPos position of the list
       
   146      *             {EListOnTopOfTextField,EListBelowTextField}
       
   147      */
       
   148     void SetListPosition( CFsFastAddressingList::TFsListPosition aPos );
       
   149 
       
   150     /**
       
   151      * Returns position of the list
       
   152      * @return TFsListPosition position of the list
       
   153      *                         {EListOnTopOfTextField,EListBelowTextField}
       
   154      */
       
   155     CFsFastAddressingList::TFsListPosition ListPosition() const;
       
   156 
       
   157     /**
       
   158      * Returns main layout of FAL
       
   159      * @return CHuiLayout* pointer to the main layout.
       
   160      */
       
   161     CAlfLayout* GetMainLayout() const;
       
   162 
       
   163     /**
       
   164      * Returns layout for list component
       
   165      * @return CHuiLayout* pointer to the main layout.
       
   166      */
       
   167     CAlfLayout* GetListLayout() const;
       
   168 
       
   169 private:
       
   170     /**
       
   171      * Default constructor
       
   172      *
       
   173      * @param aOwner Owner of the visualizer.
       
   174      */
       
   175     CFsFastAddressingVisualizer( CAlfControl& aOwner );
       
   176 
       
   177     /**
       
   178      * Second phase constructor
       
   179      * @param aTextControl CCoeControl of which the TRect will be managed
       
   180      */
       
   181     void ConstructL( CCoeControl& aTextControl );
       
   182 
       
   183     /**
       
   184      * Draw underline text
       
   185      */
       
   186     void DrawUnderline();
       
   187 
       
   188     /**
       
   189      * Sets anchors for the textinput layout and for the list layout
       
   190      */
       
   191     void SetAnchors();
       
   192 
       
   193 
       
   194 private: //Data
       
   195 
       
   196     /**
       
   197      * Root laout of the fast addresing list component.
       
   198      * Not owned.
       
   199      */
       
   200     CAlfAnchorLayout* iRootLayout;
       
   201 
       
   202     /**
       
   203      * Layout passed to the tree list component.
       
   204      * Not owned.
       
   205      */
       
   206     CAlfLayout* iItemsList;
       
   207 
       
   208     /**
       
   209      * Layout for text input field.
       
   210      * Not owned.
       
   211      */
       
   212     CAlfFlowLayout* iTextField;
       
   213 
       
   214     /**
       
   215      * Image visual for icon A
       
   216      * Not owned.
       
   217      */
       
   218     CAlfImageVisual* iIconA;
       
   219 
       
   220     /**
       
   221      * Image visual for icon B
       
   222      * Not owned.
       
   223      */
       
   224     CAlfImageVisual* iIconB;
       
   225 
       
   226     /**
       
   227      * Controls which owns the visualizer.
       
   228      * Not owned.
       
   229      */
       
   230     CAlfControl& iControlOwner;
       
   231 
       
   232     /**
       
   233      * Visualizer for the text input field
       
   234      * Not owned.
       
   235      */
       
   236     CFsTextInputVisual* iTextInputVisual;
       
   237 
       
   238     /**
       
   239      * Visibility of text field.
       
   240      */
       
   241     TBool iTextFieldVisible;
       
   242 
       
   243     /**
       
   244      * List position.
       
   245      * {EListOnTopOfTextField,EListBelowTextField}
       
   246      */
       
   247     CFsFastAddressingList::TFsListPosition iListPosition;
       
   248     };
       
   249 
       
   250 
       
   251 #endif  // C_FSFASTADDRESSINGVISUALIZER_H