uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimageloaderutil.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 // CONSTANTS
       
    28 const TInt KBufSize = 64;
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CTestPlatAlfVisual::TestAlfImgLoadUtilConstructorL
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 TInt CTestPlatAlfVisual::TestAlfImgLoadUtilConstructorL( CStifItemParser& /*aItem*/ )
       
    37     {
       
    38     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    39     _LIT( KTestAlfImgLoadUtilConstructorL, "TestAlfImgLoadUtilConstructorL" );
       
    40     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilConstructorL );
       
    41     // Print to log file
       
    42     iLog->Log( KTestAlfImgLoadUtilConstructorL );
       
    43     
       
    44     CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
       
    45     CleanupStack::PushL( vUtil );
       
    46     STIF_ASSERT_NOT_NULL( vUtil );
       
    47     CleanupStack::PopAndDestroy( vUtil );
       
    48     
       
    49     return KErrNone;
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CTestPlatAlfVisual::TestAlfImgLoadUtilCreateImageLoaderL
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 TInt CTestPlatAlfVisual::TestAlfImgLoadUtilCreateImageLoaderL( CStifItemParser& /*aItem*/ )
       
    57     {
       
    58     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    59     _LIT( KTestAlfImgLoadUtilCreateImageLoaderL, "TestAlfImgLoadUtilCreateImageLoaderL" );
       
    60     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilCreateImageLoaderL );
       
    61     // Print to log file
       
    62     iLog->Log( KTestAlfImgLoadUtilCreateImageLoaderL );
       
    63     
       
    64     CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
       
    65     CleanupStack::PushL( vUtil );
       
    66     const TInt KIconIdMessaging = 268458181; 
       
    67     TUid uid; 
       
    68     uid.iUid = KIconIdMessaging;
       
    69     vUtil->CreateImageLoaderL( uid, EAknsAppIconTypeContext );
       
    70     TAknsItemID vID;
       
    71     TRect vInnerRect( 0, 0, 1, 1 );
       
    72     TRect vOutRect( 0, 0, 1, 1 );
       
    73     vUtil->CreateImageLoaderL( vID, vInnerRect, vOutRect );
       
    74     _LIT( KBitmapFile, "Z:\\resource\\apps\\avkon2.mbm" );
       
    75     TBuf<KBufSize> vBuf( KBitmapFile );
       
    76     const TInt number = 6000;
       
    77     vUtil->CreateImageLoaderL( vID, vBuf, number, number );
       
    78     vUtil->CreateSVGImageLoaderL( vBuf );
       
    79     CleanupStack::PopAndDestroy( vUtil );
       
    80     
       
    81     return KErrNone;
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CTestPlatAlfVisual::TestAlfImgLoadUtilSetL
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 TInt CTestPlatAlfVisual::TestAlfImgLoadUtilSetL( CStifItemParser& /*aItem*/ )
       
    89     {
       
    90     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    91     _LIT( KTestAlfImgLoadUtilSetL, "TestAlfImgLoadUtilSetL" );
       
    92     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilSetL );
       
    93     // Print to log file
       
    94     iLog->Log( KTestAlfImgLoadUtilSetL );
       
    95     
       
    96     CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
       
    97     CleanupStack::PushL( vUtil );
       
    98     TUid vUid = { 0x00000001 };
       
    99     vUtil->CreateImageLoaderL( vUid, EAknsAppIconTypeContext );
       
   100     vUtil->SetSize( TSize( 1, 1 ) );
       
   101     vUtil->SetSkinInstance( NULL );
       
   102     CleanupStack::PopAndDestroy( vUtil );
       
   103     
       
   104     return KErrNone;
       
   105     }
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // CTestPlatAlfVisual::TestAlfAutoSizeImgLoadUtilSetL
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 TInt CTestPlatAlfVisual::TestAlfAutoSizeImgLoadUtilSetL( CStifItemParser& /*aItem*/ )
       
   112     {
       
   113     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   114     _LIT( KTestAlfAutoSizeImgLoadUtilSetL, "TestAlfAutoSizeImgLoadUtilSetL" );
       
   115     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfAutoSizeImgLoadUtilSetL );
       
   116     // Print to log file
       
   117     iLog->Log( KTestAlfAutoSizeImgLoadUtilSetL );
       
   118     
       
   119     CAlfAutoSizeImageLoaderUtil* vUtil = new ( ELeave ) CAlfAutoSizeImageLoaderUtil;
       
   120     CleanupStack::PushL( vUtil );
       
   121     STIF_ASSERT_NOT_NULL( vUtil );
       
   122     CleanupStack::PopAndDestroy( vUtil );
       
   123     
       
   124     return KErrNone;
       
   125     }
       
   126 
       
   127 // End of file
       
   128 
       
   129