uiresources_plat/graphic_configuration_api/tsrc/src/testdomgraphiccfgblocks.cpp
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     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 implememt of CTestDomGraphicCfg
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <akniconconfig.h>
       
    25 #include <fbs.h>
       
    26 
       
    27 #include "testdomgraphiccfg.h"
       
    28 
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // Ctestdomgraphiccfg::RunMethodL
       
    34 // Run specified method. Contains also table of test mothods and their names.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 TInt CTestDomGraphicCfg::RunMethodL( CStifItemParser& aItem ) 
       
    38     {
       
    39 
       
    40     static TStifFunctionInfo const KFunctions[] =
       
    41         {  
       
    42         // First string is the function name used in TestScripter script file.
       
    43         // Second is the actual implementation member function.
       
    44         // for AknIconConfig in akniconconfig.h.
       
    45         ENTRY( "TestAICPreferredDisplayMode",
       
    46                 CTestDomGraphicCfg::TestAICPreferredDisplayMode ),
       
    47         ENTRY( "TestAICCompressIfPreferredL",
       
    48                 CTestDomGraphicCfg::TestAICCompressIfPreferredL ),
       
    49         ENTRY( "TestAICCompressIfPreferredWithMaskL",
       
    50                 CTestDomGraphicCfg::TestAICCompressIfPreferredWithMaskL ),
       
    51         ENTRY( "TestAICEnableAknIconSrvCache",
       
    52                 CTestDomGraphicCfg::TestAICEnableAknIconSrvCache ),
       
    53 
       
    54         // [test cases entries]
       
    55 
       
    56         };
       
    57 
       
    58     const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
       
    59 
       
    60     return RunInternalL( KFunctions, count, aItem );
       
    61 
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CTestDomGraphicCfg::TestAICPreferredDisplayMode
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 TInt CTestDomGraphicCfg::TestAICPreferredDisplayMode( CStifItemParser& /*aItem*/ )
       
    69     {
       
    70     // Print to UI
       
    71     _LIT( KTestDomMenuSatInter, "TestDomGraphicCfg" );
       
    72     _LIT( KTestAICPreferredDisplayMode, "In TestAICPreferredDisplayMode" );
       
    73     TestModuleIf().Printf( 0, KTestDomMenuSatInter, KTestAICPreferredDisplayMode );
       
    74     // Print to log file
       
    75     iLog->Log( KTestAICPreferredDisplayMode );
       
    76 
       
    77     AknIconConfig::TPreferredDisplayMode mode;
       
    78     AknIconConfig::PreferredDisplayMode( mode, AknIconConfig::EImageTypeIcon );
       
    79 
       
    80     return KErrNone;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CTestDomGraphicCfg::TestAICCompressIfPreferredL
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 TInt CTestDomGraphicCfg::TestAICCompressIfPreferredL( CStifItemParser& /*aItem*/ )
       
    88     {
       
    89     // Print to UI
       
    90     _LIT( KTestDomMenuSatInter, "TestDomGraphicCfg" );
       
    91     _LIT( KTestAICCompressIfPreferredL, "In TestAICCompressIfPreferredL" );
       
    92     TestModuleIf().Printf( 0, KTestDomMenuSatInter, KTestAICCompressIfPreferredL );
       
    93     // Print to log file
       
    94     iLog->Log( KTestAICCompressIfPreferredL );
       
    95 
       
    96     CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap();
       
    97     CleanupStack::PushL( bitmap );
       
    98     
       
    99     AknIconConfig::CompressIfPreferred( bitmap );
       
   100     
       
   101     CleanupStack::PopAndDestroy( bitmap );
       
   102 
       
   103     return KErrNone;
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CTestDomGraphicCfg::TestAICCompressIfPreferredWithMaskL
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 TInt CTestDomGraphicCfg::TestAICCompressIfPreferredWithMaskL( CStifItemParser& /*aItem*/ )
       
   111     {
       
   112     // Print to UI
       
   113     _LIT( KTestDomMenuSatInter, "TestDomGraphicCfg" );
       
   114     _LIT( KTestAICCompressIfPreferredWithMaskL, "In TestAICCompressIfPreferredWithMaskL" );
       
   115     TestModuleIf().Printf( 0, KTestDomMenuSatInter, KTestAICCompressIfPreferredWithMaskL );
       
   116     // Print to log file
       
   117     iLog->Log( KTestAICCompressIfPreferredWithMaskL );
       
   118 
       
   119     CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap();
       
   120     CleanupStack::PushL( bitmap );
       
   121     CFbsBitmap* mask = new ( ELeave ) CFbsBitmap();
       
   122     CleanupStack::PushL( mask );
       
   123     
       
   124     AknIconConfig::CompressIfPreferred( bitmap, mask );
       
   125 
       
   126     CleanupStack::PopAndDestroy( mask );
       
   127     CleanupStack::PopAndDestroy( bitmap );
       
   128 
       
   129     return KErrNone;
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CTestDomGraphicCfg::TestAICEnableAknIconSrvCache
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 TInt CTestDomGraphicCfg::TestAICEnableAknIconSrvCache( CStifItemParser& /*aItem*/ )
       
   137     {
       
   138     // Print to UI
       
   139     _LIT( KTestDomMenuSatInter, "TestDomGraphicCfg" );
       
   140     _LIT( KTestAICEnableAknIconSrvCache, "In TestAICEnableAknIconSrvCache" );
       
   141     TestModuleIf().Printf( 0, KTestDomMenuSatInter, KTestAICEnableAknIconSrvCache );
       
   142     // Print to log file
       
   143     iLog->Log( KTestAICEnableAknIconSrvCache );
       
   144 
       
   145     AknIconConfig::EnableAknIconSrvCache( EFalse );
       
   146 
       
   147     return KErrNone;
       
   148     }
       
   149 
       
   150 
       
   151 //  [End of File]