examples/Networking/TcpIp/EchoClientUI/Eikecho.h

00001 /*
00002 Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description: Header file for EIKON interface to ECHOENG  
00028 */
00029 
00030 
00031 #include <basched.h>
00032 #include <eikenv.h>
00033 #include <coecntrl.h>
00034 #include <eikappui.h>
00035 #include <e32keys.h>
00036 #include <eikconso.h>
00037 #include <eikapp.h>
00038 #include <eikdoc.h>
00039 #include <eikon.rsg>
00040 #include <eikinfo.h>
00041 //#include <eikcmds.hrh>
00042 #include <eikon.hrh>//newly added
00043 #include <eikecho.rsg>
00044 #include "ECHOENG.H"
00045 
00046 #ifndef _EIKECHO_H_
00047 #define _EIKECHO_H_
00048 
00049 
00050 
00051 const TUid KUidEikEchoApp = {0xE800006A};
00052 
00053 // Connection values: substitute alternative values for KInetAddr
00054 // and KInetHostName if you want to use different servers
00055 const TUint32 KInetAddr = INET_ADDR(10,159,34,198);//(193,63,255,1); //
00056 _LIT(KInetHostName,"phoenix.doc.ic.ac.uk");
00057 
00058 // Integer formatting descriptor
00059 _LIT(KIntFormat,"%d");
00060 
00061 
00062 //
00063 // CConsoleControl: console-type control
00064 //
00065 
00066 class CConsoleControl : public CCoeControl, public MUINotify
00067         {
00068 public:
00069         static CConsoleControl* NewL(CEchoEngine* aEchoEngine);
00070         ~CConsoleControl();
00071         void ConstructL(CEchoEngine* aEchoEngine);
00072 
00073         // Override CCoeControl
00074     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00075     void ActivateL();
00076 
00077         //Implement MUINotify up calls
00078         void PrintNotify(const TDesC& aDes);
00079         void PrintNotify(TInt aInt);
00080         void ErrorNotifyL(const TDesC& aErrMessage, TInt aErrCode);
00081 protected:
00082         CConsoleControl() {}
00083 private:
00084         CEikConsoleScreen* iConsole;    // Standard EIKON console control
00085         CEchoEngine* iEchoEngine;               // The echo engine
00086         };
00087 
00088 //
00089 // CEchoAppUi: user interface command handling
00090 //
00091 
00092 class CEchoAppUi : public CEikAppUi
00093     {
00094 public:
00095         CEchoAppUi(CEchoEngine* aEchoEngine);
00096     void ConstructL();
00097         void CreateConsoleL();
00098         ~CEchoAppUi();
00099 private:
00100         // Override CEikAppUi
00101     void HandleCommandL(TInt aCommand);
00102 private:
00103         CConsoleControl* iConsoleControl;
00104         CEchoEngine* iEchoEngine;
00105         };
00106 
00107 //
00108 // CEchoDocument: document class, which owns the engine
00109 //
00110 
00111 class CEchoDocument : public CEikDocument
00112         {
00113 public:
00114         CEchoDocument(CEikApplication& aApp);
00115         static CEchoDocument* NewL(CEikApplication& aApp);
00116         ~CEchoDocument();
00117         void ConstructL();
00118 private:
00119         // Override CApaDocument
00120         CEikAppUi* CreateAppUiL();
00121 private:
00122         CEchoEngine* iEchoEngine; // Document owns the echo engine
00123         };
00124 
00125 //
00126 // CEchoApplication
00127 //
00128 
00129 class CEchoApplication : public CEikApplication
00130         {
00131 private: // from CApaApplication
00132         CApaDocument* CreateDocumentL();
00133         TUid AppDllUid() const;
00134         };
00135 #endif
00136 
00137 
00138 

Generated by  doxygen 1.6.2