uiaccelerator_plat/alf_client_server_api/tsrc/src/testplatclientserverblocksappui.cpp
branchRCL_3
changeset 20 31fccae4f8a7
parent 10 7c5dd702d6d3
equal deleted inserted replaced
19:e5af45d51884 20:31fccae4f8a7
       
     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 alf client server api
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // [INCLUDE FILES]
       
    20 #include <e32svr.h>
       
    21 #include <coemain.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <alf/alfappserver.h>
       
    25 #include <alf/alfappui.h>
       
    26 #include <aknserverapp.h> 
       
    27 
       
    28 #include "testplatclientserver.h"
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CTestPlatClientServer::TestServerCAlfAppUiL
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 TInt CTestPlatClientServer::TestServerCAlfAppUiL( CStifItemParser& /*aItem*/ )
       
    35     {
       
    36 
       
    37     // Print to UI
       
    38     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
    39     _LIT( KTestServerCAlfAppUiL, "In TestServerCAlfAppUiL" );
       
    40     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerCAlfAppUiL );
       
    41     // Print to log file
       
    42     iLog->Log( KTestServerCAlfAppUiL );
       
    43 
       
    44     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
    45     delete appUI;
       
    46     
       
    47     return KErrNone;
       
    48 
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CTestPlatClientServer::TestServerContainerL
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 TInt CTestPlatClientServer::TestServerContainerL( CStifItemParser& /*aItem*/ )
       
    56     {
       
    57 
       
    58     // Print to UI
       
    59     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
    60     _LIT( KTestServerContainerL, "In TestServerContainerL" );
       
    61     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerContainerL );
       
    62     // Print to log file
       
    63     iLog->Log( KTestServerContainerL );
       
    64 
       
    65     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
    66     CleanupStack::PushL( appUI );
       
    67     appUI->ConstructL();
       
    68     appUI->Container();  
       
    69     
       
    70     CleanupStack::PopAndDestroy( appUI );
       
    71     
       
    72     return KErrNone;
       
    73 
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CTestPlatClientServer::TestServerConstructL
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 TInt CTestPlatClientServer::TestServerConstructL( CStifItemParser& /*aItem*/ )
       
    81     {
       
    82 
       
    83     // Print to UI
       
    84     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
    85     _LIT( KTestServerConstructL, "In TestServerConstructL" );
       
    86     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerConstructL );
       
    87     // Print to log file
       
    88     iLog->Log( KTestServerConstructL );
       
    89 
       
    90     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
    91     CleanupStack::PushL( appUI );
       
    92     
       
    93     appUI->ConstructL();  
       
    94     
       
    95     CleanupStack::PopAndDestroy( appUI );
       
    96     
       
    97     return KErrNone;
       
    98 
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CTestPlatClientServer::TestServerAppendDisplayOnSharedWindowL
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CTestPlatClientServer::TestServerAppendDisplayOnSharedWindowL( CStifItemParser& /*aItem*/ )
       
   106     {
       
   107 
       
   108     // Print to UI
       
   109     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   110     _LIT( KTestServerAppendDisplayOnSharedWindowL, "In TestServerAppendDisplayOnSharedWindowL" );
       
   111     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerAppendDisplayOnSharedWindowL);
       
   112     // Print to log file
       
   113     iLog->Log( KTestServerAppendDisplayOnSharedWindowL );
       
   114 
       
   115     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   116     CleanupStack::PushL( appUI );
       
   117     
       
   118     CHuiEnv* huiEnv = CHuiEnv::NewL( EHuiRendererBitgdi ); 
       
   119     CleanupStack::PushL( huiEnv );
       
   120     
       
   121     TInt temp = 10;
       
   122     TRect displayRect( TPoint( temp, temp ), TPoint( temp, temp) );
       
   123     CHuiDisplay* huiDisplay = &huiEnv->NewDisplayL(displayRect, NULL, 0, NULL, 
       
   124         CHuiDisplay::EDisplayNormal);  
       
   125     appUI->AppendDisplayOnSharedWindowL( *huiDisplay );
       
   126     
       
   127     CleanupStack::PopAndDestroy( huiEnv );
       
   128     CleanupStack::PopAndDestroy( appUI );
       
   129     
       
   130     return KErrNone;
       
   131 
       
   132     }
       
   133 
       
   134 // -----------------------------------------------------------------------------
       
   135 // CTestPlatClientServer::TestServerHandleSystemEventL
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 TInt CTestPlatClientServer::TestServerHandleSystemEventL( CStifItemParser& /*aItem*/ )
       
   139     {
       
   140 
       
   141     // Print to UI
       
   142     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   143     _LIT( KTestServerHandleSystemEventL, "In TestServerHandleSystemEventL" );
       
   144     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerHandleSystemEventL);
       
   145     // Print to log file
       
   146     iLog->Log( KTestServerHandleSystemEventL );
       
   147 
       
   148     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   149     CleanupStack::PushL( appUI );
       
   150  
       
   151     TWsEvent event;
       
   152     appUI->HandleSystemEventL( event );
       
   153     
       
   154 
       
   155     CleanupStack::PopAndDestroy( appUI );
       
   156     
       
   157     return KErrNone;
       
   158 
       
   159     }
       
   160 
       
   161 // -----------------------------------------------------------------------------
       
   162 // CTestPlatClientServer::TestServerHandleWsEventL
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 TInt CTestPlatClientServer::TestServerHandleWsEventL( CStifItemParser& /*aItem*/ )
       
   166     {
       
   167 
       
   168     // Print to UI
       
   169     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   170     _LIT( KTestServerHandleWsEventL, "In TestServerHandleWsEventL" );
       
   171     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerHandleWsEventL);
       
   172     // Print to log file
       
   173     iLog->Log( KTestServerHandleWsEventL );
       
   174 
       
   175     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   176     CleanupStack::PushL( appUI );
       
   177  
       
   178     TWsEvent event;
       
   179     CCoeControl control;
       
   180     appUI->HandleWsEventL( event, &control );
       
   181     
       
   182     CleanupStack::PopAndDestroy( appUI );
       
   183     
       
   184     return KErrNone;
       
   185 
       
   186     }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // CTestPlatClientServer::TestServerFrameworkCallsRendezvousL
       
   190 // -----------------------------------------------------------------------------
       
   191 //
       
   192 TInt CTestPlatClientServer::TestServerFrameworkCallsRendezvousL( CStifItemParser& /*aItem*/ )
       
   193     {
       
   194 
       
   195     // Print to UI
       
   196     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   197     _LIT( KTestServerFrameworkCallsRendezvousL, "In TestServerFrameworkCallsRendezvousL" );
       
   198     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerFrameworkCallsRendezvousL);
       
   199     // Print to log file
       
   200     iLog->Log( KTestServerFrameworkCallsRendezvousL );
       
   201 
       
   202     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   203     CleanupStack::PushL( appUI );
       
   204  
       
   205     appUI->FrameworkCallsRendezvous();
       
   206     
       
   207     CleanupStack::PopAndDestroy( appUI );
       
   208     
       
   209     return KErrNone;
       
   210 
       
   211     }
       
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // CTestPlatClientServer::TestServerHandleResourceChangeL
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 TInt CTestPlatClientServer::TestServerHandleResourceChangeL( CStifItemParser& /*aItem*/ )
       
   218     {
       
   219 
       
   220     // Print to UI
       
   221     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   222     _LIT( KTestServerHandleResourceChangeL, "In TestServerHandleResourceChangeL" );
       
   223     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerHandleResourceChangeL);
       
   224     // Print to log file
       
   225     iLog->Log( KTestServerHandleResourceChangeL );
       
   226 
       
   227     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   228     CleanupStack::PushL( appUI );
       
   229  
       
   230     TInt temp = 0;
       
   231     appUI->HandleResourceChangeL( temp );
       
   232     
       
   233     CleanupStack::PopAndDestroy( appUI );
       
   234     
       
   235     return KErrNone;
       
   236 
       
   237     }
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // CTestPlatClientServer::TestServerHandleCommandL
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243 TInt CTestPlatClientServer::TestServerHandleCommandL( CStifItemParser& /*aItem*/ )
       
   244     {
       
   245 
       
   246     // Print to UI
       
   247     _LIT( Ktestplatclientserver, "testplatclientserver" );
       
   248     _LIT( KTestServerHandleCommandL, "In TestServerHandleCommandL" );
       
   249     TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerHandleCommandL);
       
   250     // Print to log file
       
   251     iLog->Log( KTestServerHandleCommandL );
       
   252 
       
   253     CAlfAppUi* appUI = new ( ELeave ) CAlfAppUi();
       
   254     CleanupStack::PushL( appUI );
       
   255  
       
   256     TInt temp = 0;
       
   257     appUI->HandleCommandL( temp );
       
   258     
       
   259     CleanupStack::PopAndDestroy( appUI );
       
   260     
       
   261     return KErrNone;
       
   262 
       
   263     }
       
   264 
       
   265 //  [End of File]