mmtestenv/mmtestfw/Source/TestFrameworkServer/ServerConsole.cpp
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "ServerConsole.h"
       
    17 
       
    18 
       
    19 /**
       
    20  *
       
    21  * Static constructor for CServerConsole.
       
    22  *
       
    23  * @param	"const TDesC& aName"
       
    24  *			Display name for console
       
    25  *
       
    26  * @return	"CServerConsole*"
       
    27  *			The constructed CServerConsole
       
    28  *
       
    29  * @xxxx 
       
    30  *
       
    31  */
       
    32 CServerConsole* CServerConsole::NewL(const TDesC& aName)
       
    33 	{
       
    34 	CServerConsole* s = new(ELeave) CServerConsole;
       
    35 	CleanupStack::PushL(s);
       
    36 	s->ConstructL(aName);
       
    37 	CleanupStack::Pop();
       
    38 	return s;
       
    39 	}
       
    40 
       
    41 /**
       
    42  *
       
    43  * Destructor for CServerConsole.
       
    44  * Destroys display console and its reader
       
    45  *
       
    46  * @xxxx
       
    47  *
       
    48  */
       
    49 CServerConsole::~CServerConsole()
       
    50 	{
       
    51 	delete iWindowName;
       
    52 	delete iInstructions;
       
    53 	delete iConsole;
       
    54 	}
       
    55 
       
    56 /**
       
    57  *
       
    58  * First-phase constructor for CServerConsole.
       
    59  * Adds itself to the Active Scheduler.
       
    60  *
       
    61  * @xxxx
       
    62  *
       
    63  */
       
    64 CServerConsole::CServerConsole()
       
    65 	{
       
    66 	}
       
    67 
       
    68 /**
       
    69  *
       
    70  * Second-phase constructor for CServerConsole.
       
    71  * Creates the display console and its reader.
       
    72  *
       
    73  * @param	"const TDesC& aName"
       
    74  *			Display name of console.
       
    75  *
       
    76  * @xxxx
       
    77  *
       
    78  */
       
    79 void CServerConsole::ConstructL(const TDesC& aName)
       
    80 	{
       
    81 	iWindowName = aName.AllocL();
       
    82 	iConsole =  Console::NewL(*iWindowName, TSize(KConsFullScreen,KConsFullScreen));
       
    83 	}
       
    84 
       
    85 /**
       
    86  *
       
    87  * Accessor for base console.
       
    88  *
       
    89  * @return	"CConsoleBase*"
       
    90  *			The base console.
       
    91  *
       
    92  * @xxxx 
       
    93  *
       
    94  */
       
    95 CConsoleBase* CServerConsole::Console() const
       
    96 	{
       
    97 	return iConsole;
       
    98 	}
       
    99 
       
   100 /**
       
   101  *
       
   102  * Sets and shows displayable instructions.
       
   103  *
       
   104  * @param	"const TDesC& aInstructions"
       
   105  *			Displayable instruction string.
       
   106  *
       
   107  * @xxxx 
       
   108  *
       
   109  */
       
   110 void CServerConsole::SetInstructionsL(const TDesC& aInstructions)
       
   111 	{
       
   112 	if (iInstructions)
       
   113 		{
       
   114 		delete iInstructions;
       
   115 		iInstructions = NULL;
       
   116 		}
       
   117 	iInstructions = aInstructions.AllocL();
       
   118 	iConsole->ClearScreen();
       
   119 	iConsole->Write(*iInstructions);
       
   120 	}
       
   121