First public contribution.
1 // Copyright (c) 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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
27 static const TInt KDisplayWidth = 100;
28 static const TInt KLineLength = KDisplayWidth;
30 typedef TBuf<KLineLength> TLine;
33 class CScrollWindow: public CBase
36 static CScrollWindow* NewL(CConsoleBase& aConsole);
40 CScrollWindow(CConsoleBase& aConsole);
46 void AppendL(const TDesC& aLine);
51 void PageZero() {iPage = 0;}
54 CConsoleBase& iConsole;
57 RArray<TLine> iLineArray;
59 static const TInt KPageLength = 8;
64 class CDisplay: public MDriveDisplay, public CBase
67 static CDisplay* NewLC(RFs& aFs, CConsoleBase& aConsole);
71 CDisplay(RFs& aFs, CConsoleBase& aConsole);
77 void DriveListL() const;
78 void DevicesNumber(TInt aDevicesNumber) const;
79 void DriveMapL(const TDriveMap& aDriveMap) const ;
80 void DeviceMapL(TInt aRow, TInt deviceIndex, const TDeviceMap& aDeviceMap) const;
81 void DeviceMapClear(TInt deviceIndex) const;
83 void UpTime(TUint aUpTime) const;
84 void MemoryFree(TInt aBytes) const;
86 void GetDriveInfoL(TChar aChar);
89 void Read(TRequestStatus &aStatus) {iConsole.Read(aStatus);}
90 void ReadCancel() {iConsole.ReadCancel();}
91 TKeyCode KeyCode() const {return iConsole.KeyCode();}
93 void PageInc() {iScrollWindow->PageInc();}
94 void PageDec() {iScrollWindow->PageDec();}
95 void PageZero() {iScrollWindow->PageZero();}
98 void FormatDriveInfoL(const TDriveInfo& aDriveInfo);
99 void FormatVolumeInfoL(const TVolumeInfo& aVolumeInfo);
101 void CursorHome() const;
105 CConsoleBase& iConsole;
109 CScrollWindow* iScrollWindow;
113 inline void CDisplay::CursorHome() const
115 iConsole.SetPos(iCursorPos.iX, iCursorPos.iY);
120 class CMessageKeyProcessor : public CActive
123 static CMessageKeyProcessor* NewLC(CDisplay& aDisplay, RUsbOtgSession& aUsbOtgSession);
124 ~CMessageKeyProcessor();
127 CMessageKeyProcessor(CDisplay& aDisplay, RUsbOtgSession& aUsbOtgSession);
132 void RequestCharacter();
134 // Defined as pure virtual by CActive;
135 // implementation provided by this class.
137 // Service completed request.
138 // Defined as pure virtual by CActive;
139 // implementation provided by this class,
141 // Called from RunL() to handle the completed request
142 void ProcessKeyPressL(TKeyCode aKeyCode);
145 TBool HandleKeyL(TKeyCode aKeyCode);
149 RUsbOtgSession& iUsbOtgSession;