uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksevent.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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 functions for alfvisual.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 
       
    25 #include "testplatalfvisual.h"
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CTestPlatAlfVisual::TestAlfEventConstructor
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 TInt CTestPlatAlfVisual::TestAlfEventConstructor( CStifItemParser& /*aItem*/ )
       
    34     {
       
    35     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    36     _LIT( KTestAlfEventConstructor, "TestAlfEventConstructor" );
       
    37     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventConstructor );
       
    38     // Print to log file
       
    39     iLog->Log( KTestAlfEventConstructor );
       
    40     
       
    41     TAlfEvent vEvent1( 0 );
       
    42     TAlfEvent vEvent2( 0, 0 );
       
    43     TAlfScrollerEvent vScrollEvent( TAlfScrollerEvent::EMoveByItem,
       
    44             TAlfScrollerEvent::EHorizontal, 0 );
       
    45     TAlfEvent vEvent3( *iAlfDisplay, vScrollEvent );
       
    46     TKeyEvent vKey;
       
    47     TAlfEvent vEvent4( *iAlfDisplay, vKey, EEventKey );
       
    48     TPointerEvent vPointer;
       
    49     TAlfEvent vEvent5( *iAlfDisplay, vPointer );
       
    50     
       
    51     return KErrNone;
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CTestPlatAlfVisual::TestAlfEventParameters
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 TInt CTestPlatAlfVisual::TestAlfEventParameters( CStifItemParser& /*aItem*/ )
       
    59     {
       
    60     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    61     _LIT( KTestAlfEventParameters, "TestAlfEventParameters" );
       
    62     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventParameters );
       
    63     // Print to log file
       
    64     iLog->Log( KTestAlfEventParameters );
       
    65     
       
    66     TPointerEvent vPointer;
       
    67     TAlfEvent vPointerEvent( *iAlfDisplay, vPointer );
       
    68     vPointerEvent.PointerDown();
       
    69     vPointerEvent.PointerUp();
       
    70     vPointerEvent.PointerLongTap();
       
    71     vPointerEvent.IsPointerEvent();
       
    72     vPointerEvent.PointerEvent();
       
    73     vPointerEvent.Type();
       
    74     TAlfEvent vCustomEvent( 0, 0 );
       
    75     vCustomEvent.IsCustomEvent();
       
    76     TAlfScrollerEvent vScroll( TAlfScrollerEvent::EMoveByItem,
       
    77             TAlfScrollerEvent::EHorizontal, 0 );
       
    78     TAlfEvent vScrollEvent( *iAlfDisplay, vScroll );
       
    79     vScrollEvent.ScrollerEvent();
       
    80     vScrollEvent.IsScrollerEvent();
       
    81     TKeyEvent vKey;
       
    82     TAlfEvent vKeyEvent( *iAlfDisplay, vKey, EEventKey );
       
    83     vKeyEvent.IsKeyEvent();
       
    84     vKeyEvent.Code();
       
    85     vKeyEvent.KeyEvent();
       
    86     
       
    87     return KErrNone;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CTestPlatAlfVisual::TestAlfEventCustomData
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TInt CTestPlatAlfVisual::TestAlfEventCustomData( CStifItemParser& /*aItem*/ )
       
    95     {
       
    96     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    97     _LIT( KTestAlfEventCustomData, "TestAlfEventCustomData" );
       
    98     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventCustomData );
       
    99     // Print to log file
       
   100     iLog->Log( KTestAlfEventCustomData );
       
   101     
       
   102     TAlfEvent vCustomEvent( 0, 0 );
       
   103     vCustomEvent.CustomEventData();
       
   104     vCustomEvent.CustomParameter();
       
   105     
       
   106     return KErrNone;
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CTestPlatAlfVisual::TestAlfEventDisplayAndVisual
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 TInt CTestPlatAlfVisual::TestAlfEventDisplayAndVisual( CStifItemParser& /*aItem*/ )
       
   114     {
       
   115     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   116     _LIT( KTestAlfEventDisplayAndVisual, "TestAlfEventDisplayAndVisual" );
       
   117     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventDisplayAndVisual );
       
   118     // Print to log file
       
   119     iLog->Log( KTestAlfEventDisplayAndVisual );
       
   120     
       
   121     TKeyEvent vKey;
       
   122     TAlfEvent vKeyEvent( *iAlfDisplay, vKey, EEventKey );
       
   123     vKeyEvent.Display();
       
   124     vKeyEvent.SetVisual( NULL );
       
   125     vKeyEvent.Visual();
       
   126     
       
   127     return KErrNone;
       
   128     }
       
   129 
       
   130 // End of file
       
   131 
       
   132