uiaccelerator_plat/alf_core_toolkit_api/tsrc/src/testuiaifctkitblockshuipathlayout.cpp
branchRCL_3
changeset 20 31fccae4f8a7
parent 10 7c5dd702d6d3
equal deleted inserted replaced
19:e5af45d51884 20:31fccae4f8a7
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:  For test alf core toolkit api modules
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <uiacceltk/huienv.h>
       
    25 #include <uiacceltk/huicontrol.h>
       
    26 #include <uiacceltk/huicontrolgroup.h>
       
    27 #include <uiacceltk/huivisual.h>
       
    28 #include <uiacceltk/huianchorlayout.h>
       
    29 #include <uiacceltk/huievent.h>
       
    30 #include <uiacceltk/huicurvepath.h>
       
    31 #include <uiacceltk/huicurvepathlayout.h>
       
    32 #include <eikenv.h>
       
    33 #include <e32err.h>
       
    34 
       
    35 #include "testuiaifcoretoolkit.h"
       
    36 // -----------------------------------------------------------------------------
       
    37 // CTestUiAifCoreToolkit::TestCHuiCurvePathLayAddNewL
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 TInt CTestUiAifCoreToolkit::TestCHuiCurvePathLayAddNewL( CStifItemParser& /*aItem*/ )
       
    41     {
       
    42 
       
    43     // Print to UI
       
    44     _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    45     _LIT( KTestCHuiCurvePathLayAddNewL, "In TestCHuiCurvePathLayAddNewL" );
       
    46     TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiCurvePathLayAddNewL );
       
    47     // Print to log file
       
    48     iLog->Log( KTestCHuiCurvePathLayAddNewL );
       
    49 
       
    50     STIF_ASSERT_NOT_NULL( iHuiEnv );
       
    51     STIF_ASSERT_NOT_NULL( iHuiControl );
       
    52     CHuiControl* otherControl = new( ELeave ) CHuiControl( *iHuiEnv );
       
    53     STIF_ASSERT_NOT_NULL( otherControl );
       
    54     CleanupStack::PushL( otherControl );
       
    55     iHuiControl->SetId( 0 );
       
    56     STIF_ASSERT_NOT_NULL( iHuiControlGroup );
       
    57     CHuiCurvePath* curvePath = CHuiCurvePath::NewL();
       
    58     STIF_ASSERT_NOT_NULL( curvePath );
       
    59     CleanupStack::PushL( curvePath );
       
    60     curvePath->SetOrigin( 0 );
       
    61     TReal32 length = curvePath->Length();
       
    62     TReal32 aPos = 2; 
       
    63     THuiRealPoint aPoint( 3, 3 );
       
    64     curvePath->Evaluate( aPos, aPoint ); 
       
    65     CleanupStack::PopAndDestroy( curvePath );
       
    66     CHuiCurvePathLayout* pathLayout = CHuiCurvePathLayout::AddNewL( *iHuiControl );
       
    67     STIF_ASSERT_NOT_NULL( pathLayout );
       
    68     CleanupStack::PushL( pathLayout );
       
    69     CleanupStack::Pop( 2 );
       
    70     
       
    71     return KErrNone;
       
    72     
       
    73     }
       
    74 // -----------------------------------------------------------------------------
       
    75 // CTestUiAifCoreToolkit::TestCHuiCurvePathLayCurvePathL
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 TInt CTestUiAifCoreToolkit::TestCHuiCurvePathLayCurvePathL( CStifItemParser& /*aItem*/ )
       
    79     {
       
    80 
       
    81     // Print to UI
       
    82     _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    83     _LIT( KTestCHuiCurvePathLayCurvePathL, "In TestCHuiCurvePathLayCurvePathL" );
       
    84     TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiCurvePathLayCurvePathL );
       
    85     // Print to log file
       
    86     iLog->Log( KTestCHuiCurvePathLayCurvePathL );
       
    87 
       
    88     STIF_ASSERT_NOT_NULL( iHuiEnv );
       
    89     STIF_ASSERT_NOT_NULL( iHuiControl );
       
    90     CHuiControl* otherControl = new( ELeave ) CHuiControl( *iHuiEnv );
       
    91     STIF_ASSERT_NOT_NULL( otherControl );
       
    92     CleanupStack::PushL( otherControl );
       
    93     iHuiControl->SetId( 0 );
       
    94     STIF_ASSERT_NOT_NULL( iHuiControlGroup );
       
    95     CHuiCurvePath* curvePath = CHuiCurvePath::NewL();
       
    96     STIF_ASSERT_NOT_NULL( curvePath );
       
    97     CleanupStack::PushL( curvePath );
       
    98     curvePath->SetOrigin( 0 );
       
    99     TReal32 length = curvePath->Length();
       
   100     TReal32 aPos = 2; 
       
   101     THuiRealPoint aPoint( 3, 3 );
       
   102     curvePath->Evaluate( aPos, aPoint ); 
       
   103     CleanupStack::PopAndDestroy( curvePath );
       
   104     CHuiCurvePathLayout* pathLayout = CHuiCurvePathLayout::AddNewL( *iHuiControl );
       
   105     STIF_ASSERT_NOT_NULL( pathLayout );
       
   106     CHuiCurvePath& curvePahth = pathLayout->CurvePath();
       
   107     CleanupStack::PushL( pathLayout );
       
   108     CleanupStack::Pop( 2 );
       
   109     
       
   110     return KErrNone;
       
   111     
       
   112     }
       
   113 
       
   114 // [End of File]