applayerprotocols/ftpengine/consui/CONSUI.H
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 /**
       
     2 * Copyright (c) 1998-2009 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:
       
    15 * PG: Hacked from eustd.h
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file CONSUI.H
       
    24  @internalComponent
       
    25 */
       
    26 
       
    27 #ifndef __FTPTEST_H
       
    28 #define __FTPTEST_H
       
    29 
       
    30 #include <e32cons.h>
       
    31 #include <f32file.h>
       
    32 #include "COMINIT.H"
       
    33 // Disable MSVC++ 5.0 aggressive warnings about non-expansion of inline functions. 
       
    34 #pragma warning(disable : 4710)	// function '...' not expanded
       
    35 
       
    36 /**
       
    37 write all your messages to this
       
    38 */
       
    39 LOCAL_D CConsoleBase* __FTPDebugConsole; 
       
    40 
       
    41 LOCAL_D RFs	iFs;
       
    42 LOCAL_D RFile	__FTPDebugFile;
       
    43 
       
    44 /**
       
    45 code this function for the real example
       
    46 @internalComponent
       
    47 */
       
    48 LOCAL_C void doExampleL(); 
       
    49 
       
    50 /**
       
    51 private
       
    52 Initialize with cleanup stack, then do example
       
    53 @internalComponent
       
    54 */
       
    55 LOCAL_C void callExampleL(); 
       
    56 
       
    57 /**
       
    58 main function called by E32
       
    59 */
       
    60 GLDEF_C TInt E32Main() 
       
    61     {
       
    62 	__UHEAP_MARK;
       
    63 	CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
       
    64 	TRAPD(error,callExampleL()); // more initialization, then do example
       
    65 	__ASSERT_ALWAYS(!error,User::Panic(_L("EPOC32EX"),error));
       
    66 	delete cleanup; // destroy clean-up stack
       
    67 	__UHEAP_MARKEND;
       
    68 	return 0; // and return
       
    69     }
       
    70 
       
    71 /**
       
    72 Initialize and call example code under cleanup stack
       
    73 @internalComponent
       
    74 */
       
    75 LOCAL_C void callExampleL() 
       
    76     {
       
    77 	__FTPDebugConsole=Console::NewL(_L("FTP Session Client console interface"),
       
    78 		TSize(KConsFullScreen,KConsFullScreen));
       
    79 	CleanupStack::PushL(__FTPDebugConsole);
       
    80 	CommInitL();
       
    81 	__FTPDebugConsole->Printf(_L("Starting...\n"));
       
    82 	TRAPD(error,doExampleL()); // perform example function
       
    83 	if (error)
       
    84 	    {
       
    85 	    __FTPDebugConsole->Printf(_L("Failed: leave code=%d"), error);
       
    86             //_LIT(KMsgPressAnyKey,_L("[press any key]"));
       
    87             __FTPDebugConsole->Printf(_L("[press any key]"));
       
    88             __FTPDebugConsole->Getch();
       
    89 	    }
       
    90 	CleanupStack::PopAndDestroy(); // close console
       
    91     }
       
    92 
       
    93 #endif