📄 socksrv.h
字号:
// socksrv.h
//
// Copyright (c) 1999-2007 Symbian Software Ltd. All rights reserved.
//
// $Change: 937687 $
//
// cs_serv exercise
#ifndef SOCKSRV_H
#define SOCKSRV_H
// SYSTEM HEADERS
#include <coecntrl.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikproc.h>
#include <eikdoc.h>
#include <eikenv.h>
#include <eikcmbut.h>
#include <uikon.hrh>
#include <eikfnlab.h>
#include <eiktbar.h>
#include <eiklabel.h>
#include <eikedwin.h>
// Required for standard dialogs
#include <eikcore.rsg>
#include <socksrv.rsg>
// PROJECT HEADERS
#include "sockets.hrh"
#include "engsrv.h"
const TUid KUidSocketsApp = { 0x10009383 };
// CSocketsApplication
class CSocketsApplication : public CEikApplication
{
private: // from CApaApplication
CApaDocument* CreateDocumentL();
TUid AppDllUid() const;
};
// CSocketsDocument
class CSocketsDocument : public CEikDocument
{
public:
~CSocketsDocument();
static CSocketsDocument* NewL(CEikApplication& aApp);
CModel* Model() {return iModel;}
private:
CSocketsDocument(CEikApplication& aApp);
void ConstructL();
private: // from CEikDocument
CEikAppUi* CreateAppUiL();
CModel* iModel;
};
// CSocketsAppUi
class CSocketsAppView;
class CSocketsAppUi : public CEikAppUi
{
public:
void ConstructL();
~CSocketsAppUi();
private: // from CEikAppUi
void HandleCommandL(TInt aCommand);
private:
CModel* iModel;
CSocketsAppView* iAppView;
};
// class CSocketsAppView
class CSocketsAppView : public CCoeControl, public MCoeControlObserver, public MSocketObserver
{
public:
enum TConsts
{
ENumEdwins = 0x2,
};
~CSocketsAppView();
void ConstructL(const TRect& aRect, CModel* aModel);
void SendMessageL(void);
void SendReplyL(void);
void ClearRxL(void);
void SetCurrentMsgFocus(TBool aFocus);
void ReverseDescriptor(TDes& aData);
private: // from CCoeControl
void Draw(const TRect& /*aRect*/) const;
TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
// from MCoeControlObserver
void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
// from MSocketObserver
void HandleSocketEvent(TInt aSource, TInt aReason);
// Event handlers
void HandleRxSocketEvent(TInt aReason);
void HandleTxSocketEvent(TInt aReason);
void HandleMsgIn(void);
private:
CModel* iModel;
CEikEdwin* iHistory;
CEikEdwin* iMsg;
CCoeControl* iFocusControl;
CEikLabel* iHistoryLabel;
CEikLabel* iMsgLabel;
const CFont* iFont;
};
#endif // SOCKSRV_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -