uiacceltk/hitchcock/coretoolkit/src/huimetric.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "uiacceltk/huimetric.h"  // Class definition
       
    21 #include "uiacceltk/HuiUtil.h"
       
    22 
       
    23 EXPORT_C THuiMetric::THuiMetric(TReal32 aMagnitude, TInt aUnit, TInt aReferenceTextStyleId) __SOFTFP
       
    24     : iMagnitude(aMagnitude),
       
    25       iUnit(aUnit),
       
    26       iReferenceTextStyleId(aReferenceTextStyleId)
       
    27     {    
       
    28     }
       
    29 
       
    30 EXPORT_C THuiMetric::THuiMetric(TInt aPixels)
       
    31     : iMagnitude(aPixels),
       
    32       iUnit(EHuiUnitPixel),
       
    33       iReferenceTextStyleId(EHuiTextStyleNormal)
       
    34     {    
       
    35     }
       
    36 
       
    37 EXPORT_C THuiXYMetric::THuiXYMetric()
       
    38     {
       
    39     }
       
    40     
       
    41 EXPORT_C THuiXYMetric::THuiXYMetric(const THuiMetric& aMetric)
       
    42     : iX(aMetric),
       
    43       iY(aMetric)
       
    44     {
       
    45     }
       
    46         
       
    47 EXPORT_C THuiXYMetric::THuiXYMetric(const THuiMetric& aX,  const THuiMetric& aY)
       
    48     : iX(aX),
       
    49       iY(aY)
       
    50     {   
       
    51     }
       
    52 
       
    53 EXPORT_C THuiBoxMetric::THuiBoxMetric()
       
    54     {
       
    55     }
       
    56 
       
    57 EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiMetric& aMetric)
       
    58         : iLeft(aMetric), 
       
    59           iRight(aMetric),
       
    60           iTop(aMetric),
       
    61           iBottom(aMetric)
       
    62     {
       
    63     }
       
    64 
       
    65 EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiXYMetric& aMetric)
       
    66         : iLeft(aMetric.iX),
       
    67           iRight(aMetric.iX),
       
    68           iTop(aMetric.iY),
       
    69           iBottom(aMetric.iY)
       
    70     {
       
    71     }
       
    72 
       
    73 EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiXYMetric& aTopLeft, 
       
    74         const THuiXYMetric& aBottomRight)
       
    75         : iLeft(aTopLeft.iX),
       
    76           iRight(aBottomRight.iX),
       
    77           iTop(aTopLeft.iY),
       
    78           iBottom(aBottomRight.iY)
       
    79     {
       
    80     }
       
    81 
       
    82 EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiMetric& aLeft, const THuiMetric& aRight,
       
    83         const THuiMetric& aTop, const THuiMetric& aBottom)
       
    84     : iLeft(aLeft), 
       
    85       iRight(aRight), 
       
    86       iTop(aTop), 
       
    87       iBottom(aBottom)
       
    88     {
       
    89     }
       
    90