classicui_plat/personalisation_framework_api/tsrc/src/testdompslnfwblockspluginhandler.cpp
changeset 21 558113899881
parent 14 3320e4e6e8bb
child 22 75713bee6484
child 33 b3425bf29f82
equal deleted inserted replaced
14:3320e4e6e8bb 21:558113899881
     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 pslnfwpluginhandler.h
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // [INCLUDE FILES]
       
    20 #include <pslnfwpluginhandler.h>
       
    21 #include "testdompslnframework.h"
       
    22 
       
    23 const TInt KPluginUid = 0x101F84A5;
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // Ctestdompslnframework::TestPlsnFWPHNewL
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 TInt CTestDOMPSLNFramework::TestPlsnFWPHNewL( CStifItemParser& /*aItem*/)
       
    33     {
       
    34     // Print to UI
       
    35     _LIT( Ktestdompslnframework, "testdompslnframework" );
       
    36     _LIT( KTestPlsnFWPHNewL, "In TestPlsnFWPHNewL" );
       
    37     TestModuleIf().Printf( 0, Ktestdompslnframework, KTestPlsnFWPHNewL );
       
    38     // Print to log file
       
    39     iLog->Log( KTestPlsnFWPHNewL );
       
    40 
       
    41     CAknViewAppUi* appui  = static_cast<CAknViewAppUi*>( CEikonEnv::Static()->AppUi() );
       
    42     iFWPHandler = CPslnFWPluginHandler::NewL( appui );
       
    43     STIF_ASSERT_NOT_NULL( iFWPHandler );
       
    44 
       
    45     return KErrNone;
       
    46     }
       
    47 
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // Ctestdompslnframework::TestPlsnFWPHNewLWithArray
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 TInt CTestDOMPSLNFramework::TestPlsnFWPHNewLWithArrayL( CStifItemParser& /*aItem*/)
       
    54     {
       
    55     // Print to UI
       
    56     _LIT( Ktestdompslnframework, "testdompslnframework" );
       
    57     _LIT( KTestPlsnFWPHNewLWithArray, "In TestPlsnFWPHNewLWithArray" );
       
    58     TestModuleIf().Printf( 0, Ktestdompslnframework, KTestPlsnFWPHNewLWithArray );
       
    59     // Print to log file
       
    60     iLog->Log( KTestPlsnFWPHNewLWithArray );
       
    61 
       
    62     CArrayPtrFlat<CPslnFWPluginInterface>* array = 
       
    63         new ( ELeave ) CArrayPtrFlat<CPslnFWPluginInterface>( 1 );
       
    64     CleanupStack::PushL( array );
       
    65 
       
    66     CAknViewAppUi* appui  = static_cast<CAknViewAppUi*>( CEikonEnv::Static()->AppUi() );
       
    67 
       
    68     iFWPHandler = CPslnFWPluginHandler::NewL( appui, array );
       
    69     STIF_ASSERT_NOT_NULL( iFWPHandler );
       
    70     CleanupStack::Pop( array );
       
    71     
       
    72     return KErrNone;
       
    73     }
       
    74 
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // Ctestdompslnframework::TestPlsnFWPHDelete
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 TInt CTestDOMPSLNFramework::TestPlsnFWPHDelete( CStifItemParser& /*aItem*/)
       
    81     {
       
    82     // Print to UI
       
    83     _LIT( Ktestdompslnframework, "testdompslnframework" );
       
    84     _LIT( KTestPlsnFWPHDelete, "In TestPlsnFWPHDelete" );
       
    85     TestModuleIf().Printf( 0, Ktestdompslnframework, KTestPlsnFWPHDelete );
       
    86     // Print to log file
       
    87     iLog->Log( KTestPlsnFWPHDelete );
       
    88 
       
    89     delete iFWPHandler;
       
    90     iFWPHandler = NULL;
       
    91 
       
    92     return KErrNone;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // Ctestdompslnframework::TestPlsnFWPHLoadPluginsLWithArray
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 TInt CTestDOMPSLNFramework::TestPlsnFWPHLoadPluginsLWithArrayL( CStifItemParser& /*aItem*/)
       
   100     {
       
   101     // Print to UI
       
   102     _LIT( Ktestdompslnframework, "testdompslnframework" );
       
   103     _LIT( KTestPlsnFWPHLoadPluginsLWithArray, "In TestPlsnFWPHLoadPluginsLWithArray" );
       
   104     TestModuleIf().Printf( 0, Ktestdompslnframework, KTestPlsnFWPHLoadPluginsLWithArray );
       
   105     // Print to log file
       
   106     iLog->Log( KTestPlsnFWPHLoadPluginsLWithArray );
       
   107 
       
   108     CArrayPtrFlat<CPslnFWPluginInterface>* array = 
       
   109         new ( ELeave ) CArrayPtrFlat<CPslnFWPluginInterface>( 1 );
       
   110     CleanupStack::PushL( array );
       
   111     
       
   112     TRAP_IGNORE( iFWPHandler->LoadPluginsL( array ) );
       
   113     CleanupStack::Pop( array );
       
   114 
       
   115     return KErrNone;
       
   116     }
       
   117 
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // Ctestdompslnframework::TestPlsnFWPHLoadPluginsLWithId
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 TInt CTestDOMPSLNFramework::TestPlsnFWPHLoadPluginsLWithId( CStifItemParser& /*aItem*/)
       
   124     {
       
   125     // Print to UI
       
   126     _LIT( Ktestdompslnframework, "testdompslnframework" );
       
   127     _LIT( KTestPlsnFWPHLoadPluginsLWithId, "In TestPlsnFWPHLoadPluginsLWithId" );
       
   128     TestModuleIf().Printf( 0, Ktestdompslnframework, KTestPlsnFWPHLoadPluginsLWithId );
       
   129     // Print to log file
       
   130     iLog->Log( KTestPlsnFWPHLoadPluginsLWithId );
       
   131 
       
   132     TInt err;
       
   133     TRAP(err, iFWPHandler->LoadPluginL( TUid::Uid( KPluginUid ) ) );
       
   134 
       
   135     return err;
       
   136 
       
   137     }