uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdecklayout.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 // FORWARD DECLARATION
       
    31 /*This class test protected function of CAlfDeckLayout*/
       
    32 class CTestCAlfDeckLayout : public CAlfDeckLayout
       
    33     {
       
    34 public:
       
    35     /**
       
    36     * C++ default constructor.
       
    37     */
       
    38     CTestCAlfDeckLayout();
       
    39     /**
       
    40     * Destructor.
       
    41     */
       
    42     ~CTestCAlfDeckLayout();
       
    43     /**
       
    44     * TestProtectedFuncForVisual test protected functions of CAlfDeckLayout
       
    45     * @since S60 5.0
       
    46     * @param aItem is not used.
       
    47     * @return Symbian OS error code.
       
    48     */
       
    49     TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
       
    50     };
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CTestCAlfDeckLayout::CTestCAlfDeckLayout
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CTestCAlfDeckLayout::CTestCAlfDeckLayout(){}
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CTestCAlfDeckLayout::~CTestCAlfDeckLayout
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CTestCAlfDeckLayout::~CTestCAlfDeckLayout(){}
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CTestCAlfDeckLayout::TestProtectedFuncForVisual
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 TInt CTestCAlfDeckLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
       
    69     {
       
    70     TUid vUid = { 0x00000000 };
       
    71     PropertyOwnerExtension( vUid, NULL );
       
    72     DoRemoveAndDestroyAllD();
       
    73     return KErrNone;
       
    74     }
       
    75 
       
    76 // ============================ MEMBER FUNCTIONS ===============================
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CTestPlatAlfVisual::TestAlfDeckLayoutAddNewL
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 TInt CTestPlatAlfVisual::TestAlfDeckLayoutAddNewL( CStifItemParser& /*aItem*/ )
       
    83     {
       
    84     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    85     _LIT( KTestAlfDeckLayoutAddNewL, "TestAlfDeckLayoutAddNewL" );
       
    86     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutAddNewL );
       
    87     // Print to log file
       
    88     iLog->Log( KTestAlfDeckLayoutAddNewL );
       
    89     
       
    90     CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
       
    91     STIF_ASSERT_NOT_NULL( vLayout );
       
    92     
       
    93     return KErrNone;
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CTestPlatAlfVisual::TestAlfDeckLayoutFullConstructL
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 TInt CTestPlatAlfVisual::TestAlfDeckLayoutFullConstructL( CStifItemParser& /*aItem*/ )
       
   101     {
       
   102     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   103     _LIT( KTestAlfDeckLayoutFullConstructL, "TestAlfDeckLayoutFullConstructL" );
       
   104     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutFullConstructL );
       
   105     // Print to log file
       
   106     iLog->Log( KTestAlfDeckLayoutFullConstructL );
       
   107     
       
   108     CAlfDeckLayout* vLayout = new ( ELeave ) CAlfDeckLayout;
       
   109     CleanupStack::PushL( vLayout );
       
   110     vLayout->ConstructL( *iAlfCtl );
       
   111     CleanupStack::Pop( vLayout );
       
   112     
       
   113     return KErrNone;
       
   114     }
       
   115 
       
   116 // -----------------------------------------------------------------------------
       
   117 // CTestPlatAlfVisual::TestAlfDeckLayoutForLayoutL
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 TInt CTestPlatAlfVisual::TestAlfDeckLayoutForLayoutL( CStifItemParser& /*aItem*/ )
       
   121     {
       
   122     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   123     _LIT( KTestAlfDeckLayoutForLayoutL, "TestAlfDeckLayoutForLayoutL" );
       
   124     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutForLayoutL );
       
   125     // Print to log file
       
   126     iLog->Log( KTestAlfDeckLayoutForLayoutL );
       
   127     
       
   128     CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
       
   129     vLayout->BaseUnit();
       
   130     
       
   131     return KErrNone;
       
   132     }
       
   133 
       
   134 // -----------------------------------------------------------------------------
       
   135 // CTestPlatAlfVisual::TestAlfDeckLayoutForVisualL
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 TInt CTestPlatAlfVisual::TestAlfDeckLayoutForVisualL( CStifItemParser& /*aItem*/ )
       
   139     {
       
   140     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   141     _LIT( KTestAlfDeckLayoutForVisualL, "TestAlfDeckLayoutForVisualL" );
       
   142     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutForVisualL );
       
   143     // Print to log file
       
   144     iLog->Log( KTestAlfDeckLayoutForVisualL );
       
   145     
       
   146     CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
       
   147     _LIT8( KTest, "tset" );
       
   148     TBuf8<KBufSize> vBuf( KTest );
       
   149     vLayout->FindTag( vBuf );
       
   150     vLayout->UpdateChildrenLayout();
       
   151     vLayout->RemoveAndDestroyAllD();
       
   152     
       
   153     return KErrNone;
       
   154     }
       
   155 
       
   156 // -----------------------------------------------------------------------------
       
   157 // CTestPlatAlfVisual::TestAlfDeckLayoutProtectedFuncL
       
   158 // -----------------------------------------------------------------------------
       
   159 //
       
   160 TInt CTestPlatAlfVisual::TestAlfDeckLayoutProtectedFuncL( CStifItemParser& aItem )
       
   161     {
       
   162     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   163     _LIT( KTestAlfDeckLayoutProtectedFuncL, "TestAlfDeckLayoutProtectedFuncL" );
       
   164     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutProtectedFuncL );
       
   165     // Print to log file
       
   166     iLog->Log( KTestAlfDeckLayoutProtectedFuncL );
       
   167     
       
   168     CTestCAlfDeckLayout* vLayout = new ( ELeave ) CTestCAlfDeckLayout;
       
   169     CleanupStack::PushL( vLayout );
       
   170     vLayout->ConstructL( *iAlfCtl );
       
   171     vLayout->TestProtectedFuncForVisual( aItem );
       
   172     CleanupStack::Pop( vLayout );
       
   173     
       
   174     return KErrNone;
       
   175     }
       
   176 
       
   177 // End of file