svgtopt/SVG/SVGImpl/src/SVGFloatCssValueImpl.cpp
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     1 /*
       
     2 * Copyright (c) 2003 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:  SVG Implementation source file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifdef _DEBUG
       
    20 #if !defined(__E32DEBUG_H__)
       
    21 #include <e32debug.h>
       
    22 #endif
       
    23 #endif
       
    24 #include "SVGFloatCssValueImpl.h"
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 // ---------------------------------------------------------------------------
       
    32 CFloatCssValueImpl::CFloatCssValueImpl()
       
    33     {
       
    34     }
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 // ---------------------------------------------------------------------------
       
    39 CFloatCssValueImpl::CFloatCssValueImpl( float aValue )
       
    40 {
       
    41     iValue = aValue;
       
    42 }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 // ---------------------------------------------------------------------------
       
    47 CFloatCssValueImpl::~CFloatCssValueImpl()
       
    48     {
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 // ---------------------------------------------------------------------------
       
    54 TFloatFixPt CFloatCssValueImpl::Value()
       
    55     {
       
    56     return iValue;
       
    57     }
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 // ---------------------------------------------------------------------------
       
    62 TInt CFloatCssValueImpl::SetValueL( const TDesC& aValue )
       
    63     {
       
    64 
       
    65     TReal32 tReal;
       
    66     TLex tLex( aValue );
       
    67     if ( tLex.Val( tReal, '.' ) == KErrNone )
       
    68         {
       
    69         iValue = ( TFloatFixPt ) tReal;
       
    70         }
       
    71     return KErrNone;
       
    72     }
       
    73 
       
    74 TInt CFloatCssValueImpl::SetValueL( const TFloatFixPt& aValue )
       
    75     {
       
    76     iValue = aValue;
       
    77     return KErrNone;
       
    78     }
       
    79 
       
    80 
       
    81 // *******************************************************
       
    82 // Private
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 // ---------------------------------------------------------------------------
       
    88 TBool CFloatCssValueImpl::IsEqual( CCssValue* aValue )
       
    89 {
       
    90 	if (((CFloatCssValueImpl*)aValue)->iValue == iValue)
       
    91 	{
       
    92 		return ETrue;
       
    93 	}
       
    94 
       
    95 	return EFalse;
       
    96 }
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 // ---------------------------------------------------------------------------
       
   101 void CFloatCssValueImpl::Print()
       
   102 {
       
   103 	#ifdef _DEBUG
       
   104 	RDebug::Printf("%d", (int)iValue);
       
   105 	#endif
       
   106 }