- //
- // tcpudp.h
- //
- // Copyright (C) 2001, Forum Nokia - The Developer Community
- //
- ////////////////////////////////////////////////////////////////
- #ifndef __TCPUDP_H
- #define __TCPUDP_H
- #include <eikappui.h>
- #include <eikapp.h>
- #include <eikdoc.h>
- #include <eikenv.h>
- #include <eiktbar.h>
- #include <eikconso.h>
- #include <eikdialg.h>
- #include <eikedwin.h>
- #include <eikmenup.h>
- #include <eikon.hrh>
- #include <tcpudp.rsg>
- #include "tcpudp.hrh"
- #include "engine.h"
- const TUid KUidTcpUdpApp={ 0x0100093E };
- const TUid KUidTcpUdpVersionUid = { 0x0100093F } ;
- class CConsoleControl : public CCoeControl
- {
- public:
- CConsoleControl() {}
- ~CConsoleControl();
- void ConstructL(TPoint aLeftTop,const TSize& aSize,TInt aFlags);
- void ActivateL();
- void DrawCursor();
- void Write(const TDesC &aDes);
- CEikConsoleControl *ConsoleControl();
- TBool UpdateScrollBars();
- void ClearScreen();
- void Redraw(const TRect &aRect);
- void Lf();
- protected:
- void FocusChanged(TDrawNow aDrawNow);
- private:
- CEikConsoleScreen* iConsole;
- TInt iHistory;
- };
- //
- // class CTcpUdpView
- //
- class CTcpUdpView : public CCoeControl, public MCoeControlBrushContext
- {
- public:
- ~CTcpUdpView();
- void ConstructL(const TRect& aRect);
- void Start();
- void Stop();
- void Write(const TDesC &aMsg);
- inline CRunEngine *Engine()
- { return iEngine;};
- inline CConsoleControl *Console()
- { return iConsole;};
- void ClearScreen();
- void UpdateBusyMsg();
- void DynInitMenuPaneL(TInt aMenuId,CEikMenuPane* aMenuPane);
- private: // from CCoeControl
- void Draw(const TRect& /*aRect*/) const;
- //Component Controls
- void CreateBigConsoleL(TInt aFlags);
- private:
- CConsoleControl *iConsole;
- CRunEngine *iEngine;
- };
- //
- // CTcpUdpAppUi
- //
- class CTcpUdpAppUi : public CEikAppUi
- {
- public:
- void ConstructL();
- ~CTcpUdpAppUi();
- private: // from CEikAppUi
- void HandleCommandL(TInt aCommand);
- TBool LaunchOptionsDialogL(CRunEngine* aEngine);
- void LaunchAboutDialogL();
- void DynInitMenuPaneL(TInt aMenuId,CEikMenuPane* aMenuPane);
- void RestorePreferencesL(TPreferences &aPreferences);
- void StorePreferencesL(const TPreferences &aPreferences);
- private:
- CTcpUdpView* iAppView;
- };
- //
- // CTcpUdpDocument
- //
- class CTcpUdpDocument : public CEikDocument
- {
- public:
- // construct/destruct
- CTcpUdpDocument(CEikApplication& aApp);
- private: // from CEikDocument
- CEikAppUi* CreateAppUiL();
- };
- //
- // CTcpUdpApplication
- //
- class CTcpUdpApplication : public CEikApplication
- {
- private: // from CApaApplication
- CApaDocument* CreateDocumentL();
- TUid AppDllUid() const;
- };
- /// DIALOG CLASSES
- class COptionsDialog : public CEikDialog
- {
- public:
- COptionsDialog(CRunEngine* aEngine);
- private:
- TBool OkToExitL(TInt);
- void PreLayoutDynInitL();
- private:
- CRunEngine* iEngine;
- };
- #endif