uiaccelerator_plat/alf_core_toolkit_api/tsrc/src/testuiaifctkitblockshuitimedpoint.cpp
branchRCL_3
changeset 52 31fccae4f8a7
parent 22 7c5dd702d6d3
equal deleted inserted replaced
51:e5af45d51884 52: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:  test api of alf_core_toolkit
       
    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/huitimedpoint.h>
       
    27 #include <uiacceltk/HuiMappingFunctions.h>
       
    28 
       
    29 #include "testuiaifcoretoolkit.h"
       
    30 
       
    31 const TReal32 number = 0.5;
       
    32 // -----------------------------------------------------------------------------
       
    33 // CTestUiAifCoreToolkit::TestTHTPConstructor
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 TInt CTestUiAifCoreToolkit::TestTHTPConstructor( CStifItemParser& /*aItem*/ )
       
    37     {
       
    38 
       
    39     // Print to UI
       
    40     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    41     _LIT( KCHuiIMageBrush, "In TestTHTPConstructor" );
       
    42     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
    43     // Print to log file
       
    44     iLog->Log( KCHuiIMageBrush );
       
    45 
       
    46     THuiTimedPoint point;
       
    47 
       
    48     return KErrNone;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CTestUiAifCoreToolkit::TestTHTPConstructorWithTReal
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 TInt CTestUiAifCoreToolkit::TestTHTPConstructorWithTReal( CStifItemParser& /*aItem*/ )
       
    56     {
       
    57 
       
    58     // Print to UI
       
    59     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    60     _LIT( KCHuiIMageBrush, "In TestTHTPConstructorWithTReal" );
       
    61     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
    62     // Print to log file
       
    63     iLog->Log( KCHuiIMageBrush );
       
    64 
       
    65     THuiTimedPoint point( number, number );
       
    66 
       
    67     return KErrNone;
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CTestUiAifCoreToolkit::TestTHTPSetStyle
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 TInt CTestUiAifCoreToolkit::TestTHTPSetStyle( CStifItemParser& /*aItem*/ )
       
    75     {
       
    76 
       
    77     // Print to UI
       
    78     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    79     _LIT( KCHuiIMageBrush, "In TestTHTPSetStyle" );
       
    80     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
    81     // Print to log file
       
    82     iLog->Log( KCHuiIMageBrush );
       
    83 
       
    84     THuiTimedPoint point( number, number );
       
    85     point.SetStyle( EHuiTimedValueStyleNone );
       
    86 
       
    87     return KErrNone;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CTestUiAifCoreToolkit::TestTHTPSetFunctionL
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TInt CTestUiAifCoreToolkit::TestTHTPSetFunctionL( CStifItemParser& /*aItem*/ )
       
    95     {
       
    96 
       
    97     // Print to UI
       
    98     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    99     _LIT( KCHuiIMageBrush, "In TestTHTPSetFunctionL" );
       
   100     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   101     // Print to log file
       
   102     iLog->Log( KCHuiIMageBrush );
       
   103 
       
   104     THuiConstantMappingFunction* function = new( ELeave ) THuiConstantMappingFunction();
       
   105     CleanupStack::PushL( function );
       
   106     STIF_ASSERT_NOT_NULL( function );
       
   107     THuiTimedPoint point( number, number );
       
   108     point.SetFunction( function );
       
   109     CleanupStack::PopAndDestroy( function );
       
   110 
       
   111     return KErrNone;
       
   112     }
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CTestUiAifCoreToolkit::TestTHTPSet
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 TInt CTestUiAifCoreToolkit::TestTHTPSet( CStifItemParser& /*aItem*/ )
       
   119     {
       
   120 
       
   121     // Print to UI
       
   122     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   123     _LIT( KCHuiIMageBrush, "In TestTHTPSet" );
       
   124     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   125     // Print to log file
       
   126     iLog->Log( KCHuiIMageBrush );
       
   127 
       
   128     THuiRealPoint realPoint;
       
   129     THuiTimedPoint point( number, number );
       
   130     point.Set( realPoint );
       
   131 
       
   132     return KErrNone;
       
   133     }
       
   134 
       
   135 // -----------------------------------------------------------------------------
       
   136 // CTestUiAifCoreToolkit::TestTHTPSetTReal
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 TInt CTestUiAifCoreToolkit::TestTHTPSetTReal( CStifItemParser& /*aItem*/ )
       
   140     {
       
   141 
       
   142     // Print to UI
       
   143     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   144     _LIT( KCHuiIMageBrush, "In TestTHTPSetTReal" );
       
   145     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   146     // Print to log file
       
   147     iLog->Log( KCHuiIMageBrush );
       
   148 
       
   149     THuiTimedPoint point( number, number );
       
   150     point.Set( number );
       
   151 
       
   152     return KErrNone;
       
   153     }
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CTestUiAifCoreToolkit::TestTHTPSetWithSpeed
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 TInt CTestUiAifCoreToolkit::TestTHTPSetWithSpeed( CStifItemParser& /*aItem*/ )
       
   160     {
       
   161 
       
   162     // Print to UI
       
   163     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   164     _LIT( KCHuiIMageBrush, "In TestTHTPSetWithSpeed" );
       
   165     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   166     // Print to log file
       
   167     iLog->Log( KCHuiIMageBrush );
       
   168 
       
   169     THuiRealPoint realPoint;
       
   170     THuiTimedPoint point( number, number );
       
   171     point.SetWithSpeed( realPoint, 0 );
       
   172 
       
   173     return KErrNone;
       
   174     }
       
   175 
       
   176 // -----------------------------------------------------------------------------
       
   177 // CTestUiAifCoreToolkit::TestTHTPSetWithSpeedTReal
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 TInt CTestUiAifCoreToolkit::TestTHTPSetWithSpeedTReal( CStifItemParser& /*aItem*/ )
       
   181     {
       
   182 
       
   183     // Print to UI
       
   184     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   185     _LIT( KCHuiIMageBrush, "In TestTHTPSetWithSpeedTReal" );
       
   186     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   187     // Print to log file
       
   188     iLog->Log( KCHuiIMageBrush );
       
   189 
       
   190     THuiTimedPoint point( number, number );
       
   191     point.SetWithSpeed( number, 0 );
       
   192 
       
   193     return KErrNone;
       
   194     }
       
   195 
       
   196 // -----------------------------------------------------------------------------
       
   197 // CTestUiAifCoreToolkit::TestTHTPNow
       
   198 // -----------------------------------------------------------------------------
       
   199 //
       
   200 TInt CTestUiAifCoreToolkit::TestTHTPNow( CStifItemParser& /*aItem*/ )
       
   201     {
       
   202 
       
   203     // Print to UI
       
   204     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   205     _LIT( KCHuiIMageBrush, "In TestTHTPNow" );
       
   206     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   207     // Print to log file
       
   208     iLog->Log( KCHuiIMageBrush );
       
   209 
       
   210     THuiTimedPoint point( number, number );
       
   211     point.Now();
       
   212 
       
   213     return KErrNone;
       
   214     }
       
   215 
       
   216 // -----------------------------------------------------------------------------
       
   217 // CTestUiAifCoreToolkit::TestTHTPRealNow
       
   218 // -----------------------------------------------------------------------------
       
   219 //
       
   220 TInt CTestUiAifCoreToolkit::TestTHTPRealNow( CStifItemParser& /*aItem*/ )
       
   221     {
       
   222 
       
   223     // Print to UI
       
   224     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   225     _LIT( KCHuiIMageBrush, "In TestTHTPRealNow" );
       
   226     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   227     // Print to log file
       
   228     iLog->Log( KCHuiIMageBrush );
       
   229 
       
   230     THuiTimedPoint point( number, number );
       
   231     point.RealNow();
       
   232 
       
   233     return KErrNone;
       
   234     }
       
   235 
       
   236 // -----------------------------------------------------------------------------
       
   237 // CTestUiAifCoreToolkit::TestTHTPTarget
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 TInt CTestUiAifCoreToolkit::TestTHTPTarget( CStifItemParser& /*aItem*/ )
       
   241     {
       
   242 
       
   243     // Print to UI
       
   244     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   245     _LIT( KCHuiIMageBrush, "In TestTHTPTarget" );
       
   246     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   247     // Print to log file
       
   248     iLog->Log( KCHuiIMageBrush );
       
   249 
       
   250     THuiTimedPoint point( number, number );
       
   251     point.Target();
       
   252 
       
   253     return KErrNone;
       
   254     }
       
   255 
       
   256 // -----------------------------------------------------------------------------
       
   257 // CTestUiAifCoreToolkit::TestTHTPRealTarget
       
   258 // -----------------------------------------------------------------------------
       
   259 //
       
   260 TInt CTestUiAifCoreToolkit::TestTHTPRealTarget( CStifItemParser& /*aItem*/ )
       
   261     {
       
   262 
       
   263     // Print to UI
       
   264     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   265     _LIT( KCHuiIMageBrush, "In TestTHTPRealTarget" );
       
   266     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   267     // Print to log file
       
   268     iLog->Log( KCHuiIMageBrush );
       
   269 
       
   270     THuiTimedPoint point( number, number );
       
   271     point.RealTarget();
       
   272 
       
   273     return KErrNone;
       
   274     }
       
   275 
       
   276 // -----------------------------------------------------------------------------
       
   277 // CTestUiAifCoreToolkit::TestTHTPFinish
       
   278 // -----------------------------------------------------------------------------
       
   279 //
       
   280 TInt CTestUiAifCoreToolkit::TestTHTPFinish( CStifItemParser& /*aItem*/ )
       
   281     {
       
   282 
       
   283     // Print to UI
       
   284     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   285     _LIT( KCHuiIMageBrush, "In TestTHTPFinish" );
       
   286     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KCHuiIMageBrush );
       
   287     // Print to log file
       
   288     iLog->Log( KCHuiIMageBrush );
       
   289 
       
   290     THuiTimedPoint point( number, number );
       
   291     point.Finish();
       
   292 
       
   293     return KErrNone;
       
   294     }