sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "ServerConsole.h" sl@0: sl@0: sl@0: /** sl@0: * sl@0: * Static constructor for CServerConsole. sl@0: * sl@0: * @param "const TDesC& aName" sl@0: * Display name for console sl@0: * sl@0: * @return "CServerConsole*" sl@0: * The constructed CServerConsole sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: CServerConsole* CServerConsole::NewL(const TDesC& aName) sl@0: { sl@0: CServerConsole* s = new(ELeave) CServerConsole; sl@0: CleanupStack::PushL(s); sl@0: s->ConstructL(aName); sl@0: CleanupStack::Pop(); sl@0: return s; sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Destructor for CServerConsole. sl@0: * Destroys display console and its reader sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: CServerConsole::~CServerConsole() sl@0: { sl@0: delete iWindowName; sl@0: delete iInstructions; sl@0: delete iConsole; sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * First-phase constructor for CServerConsole. sl@0: * Adds itself to the Active Scheduler. sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: CServerConsole::CServerConsole() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Second-phase constructor for CServerConsole. sl@0: * Creates the display console and its reader. sl@0: * sl@0: * @param "const TDesC& aName" sl@0: * Display name of console. sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: void CServerConsole::ConstructL(const TDesC& aName) sl@0: { sl@0: iWindowName = aName.AllocL(); sl@0: iConsole = Console::NewL(*iWindowName, TSize(KConsFullScreen,KConsFullScreen)); sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Accessor for base console. sl@0: * sl@0: * @return "CConsoleBase*" sl@0: * The base console. sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: CConsoleBase* CServerConsole::Console() const sl@0: { sl@0: return iConsole; sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Sets and shows displayable instructions. sl@0: * sl@0: * @param "const TDesC& aInstructions" sl@0: * Displayable instruction string. sl@0: * sl@0: * @xxxx sl@0: * sl@0: */ sl@0: void CServerConsole::SetInstructionsL(const TDesC& aInstructions) sl@0: { sl@0: if (iInstructions) sl@0: { sl@0: delete iInstructions; sl@0: iInstructions = NULL; sl@0: } sl@0: iInstructions = aInstructions.AllocL(); sl@0: iConsole->ClearScreen(); sl@0: iConsole->Write(*iInstructions); sl@0: } sl@0: