emailuis/uicomponents/src/fstextinputvisual.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  Implementation of CFsTextInputVisual class
       
    15 *
       
    16 */
       
    17 
       
    18 //<cmail> removed __FS_ALFRED_SUPPORT flag (other places in this file not tagged!)
       
    19 //#include <fsconfig.h>     
       
    20 //#ifdef __FS_ALFRED_SUPPORT
       
    21 #include "emailtrace.h"
       
    22 #include <alf/alfcontrol.h>
       
    23 #include <alf/alfdisplay.h>
       
    24 /*#else // !__FS_ALFRED_SUPPORT
       
    25 #include <hitchcock.h>
       
    26 #endif // __FS_ALFRED_SUPPORT*/
       
    27 //</cmail> removed __FS_ALFRED_SUPPORT flag (other places in this file not tagged!)
       
    28 #include <coecntrl.h>
       
    29 
       
    30 #include "fstextinputvisual.h"
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 void CFsTextInputVisual::ConstructL( CAlfControl& aOwner )
       
    35     {
       
    36     FUNC_LOG;
       
    37     CAlfVisual::ConstructL( aOwner );
       
    38     }
       
    39 
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // Constructor
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CFsTextInputVisual::CFsTextInputVisual( CAlfControl& aOwner, 
       
    46     CCoeControl& aCoeControl ) :
       
    47     iCoeControl( aCoeControl )
       
    48     {
       
    49     FUNC_LOG;
       
    50     //No implementation nedeed
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 // Constructs and returns an CFsTextInputVisual object. The object is added
       
    55 // to the aOwnerControl.
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CFsTextInputVisual* CFsTextInputVisual::AddNewL( CAlfControl& aOwnerControl,
       
    59     CCoeControl& aCoeControl,
       
    60     CAlfLayout* aParentLayout )
       
    61     {
       
    62     FUNC_LOG;
       
    63     CFsTextInputVisual* self = 
       
    64         new ( ELeave ) CFsTextInputVisual( aOwnerControl, 
       
    65                                            aCoeControl );
       
    66     CleanupStack::PushL( self );
       
    67     self->ConstructL( aOwnerControl );
       
    68     
       
    69     if ( aParentLayout )
       
    70         {
       
    71         aOwnerControl.Append( self, aParentLayout );
       
    72         }
       
    73     CleanupStack::Pop( self );
       
    74     return self;
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Destructor
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 CFsTextInputVisual::~CFsTextInputVisual()
       
    82     {
       
    83     FUNC_LOG;
       
    84     //No implementation nedeed
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // From CHuiVisual
       
    89 // Sets rect of the CFsTextInputField and redraws content.
       
    90 // ---------------------------------------------------------------------------
       
    91 //
       
    92 void CFsTextInputVisual::DrawSelf( CAlfGc& /*aGc*/, 
       
    93                                    const TRect& aDisplayRect ) const
       
    94     {
       
    95     FUNC_LOG;
       
    96     TRect rect( aDisplayRect );
       
    97 //<cmail>    
       
    98 //#ifdef __FS_ALFRED_SUPPORT
       
    99 // this needs investigation once the FAL is needed again. Currently
       
   100 // it is not part of the requirements for fs_generic.dll.
       
   101 //#else // !__FS_ALFRED_SUPPORT
       
   102 // this needs investigation once the FAL is needed again. Currently
       
   103 // it is not part of the requirements for fs_generic.dll.
       
   104 /*    CCoeControl& nativeControl = *( Display()->NativeControl() );
       
   105     TPoint p = nativeControl.Position();
       
   106     TRect disp_rect( nativeControl.Position(), nativeControl.Size() );
       
   107     TSize visual_size = rect.Size();
       
   108     rect.Move( p );
       
   109     //Check if left corner of text field bounds to the disp width
       
   110     if ( rect.iBr.iX > disp_rect.iBr.iX )
       
   111         {
       
   112         rect.iBr.iX = disp_rect.iBr.iX;
       
   113         }
       
   114         
       
   115     if ( rect.iBr.iY > disp_rect.iBr.iY )
       
   116         {
       
   117         rect.iBr.iY = disp_rect.iBr.iY;
       
   118         }
       
   119     
       
   120     iCoeControl.SetRect( rect );
       
   121     iCoeControl.DrawNow();*/
       
   122 //#endif // __FS_ALFRED_SUPPORT
       
   123 //</cmail>
       
   124     }
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // Controls visibility of the CFsTextInputField
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 void CFsTextInputVisual::SetVisibility( TBool aVisibility )
       
   131     {
       
   132     FUNC_LOG;
       
   133     iVisible = aVisibility;
       
   134     }
       
   135