⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syncserialcommappview.h

📁 实现在S60 SDK 3rd Device上的USB串口通信。
💻 H
字号:
/*
 ============================================================================
 Name		: SyncSerialCommAppView.h
 Author	  : Redasen
 Copyright   : Redasen
 Description : Declares view class for application.
 ============================================================================
 */

#ifndef __SYNCSERIALCOMMAPPVIEW_h__
#define __SYNCSERIALCOMMAPPVIEW_h__

// INCLUDES
#include <coecntrl.h>

class CEikLabel;
class CEikGlobalTextEditor;
class CSyncSerialEngine;

// CLASS DECLARATION
class CSyncSerialCommAppView : public CCoeControl, MCoeControlObserver
	{
public:
	// New methods

	/**
	 * NewL.
	 * Two-phased constructor.
	 * Create a CSyncSerialCommAppView object, which will draw itself to aRect.
	 * @param aRect The rectangle this view will be drawn to.
	 * @return a pointer to the created instance of CSyncSerialCommAppView.
	 */
	static CSyncSerialCommAppView* NewL(const TRect& aRect);

	/**
	 * NewLC.
	 * Two-phased constructor.
	 * Create a CSyncSerialCommAppView object, which will draw itself
	 * to aRect.
	 * @param aRect Rectangle this view will be drawn to.
	 * @return A pointer to the created instance of CSyncSerialCommAppView.
	 */
	static CSyncSerialCommAppView* NewLC(const TRect& aRect);

	/**
	 * ~CSyncSerialCommAppView
	 * Virtual Destructor.
	 */
	virtual ~CSyncSerialCommAppView();

public:
	// Functions from base classes

	/**
	 * From CCoeControl, Draw
	 * Draw this CSyncSerialCommAppView to the screen.
	 * @param aRect the rectangle of this view that needs updating
	 */
	void Draw(const TRect& aRect) const;

	/**
	 * From CoeControl, SizeChanged.
	 * Called by framework when the view size is changed.
	 */
	virtual void SizeChanged();

	/**
	 * From CoeControl, HandlePointerEventL.
	 * Called by framework when a pointer touch event occurs.
	 * Note: although this method is compatible with earlier SDKs, 
	 * it will not be called in SDKs without Touch support.
	 * @param aPointerEvent the information about this event
	 */
	virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);

private:
	// Constructors

	/**
	 * ConstructL
	 * 2nd phase constructor.
	 * Perform the second phase construction of a
	 * CSyncSerialCommAppView object.
	 * @param aRect The rectangle this view will be drawn to.
	 */
	void ConstructL(const TRect& aRect);

	/**
	 * CSyncSerialCommAppView.
	 * C++ default constructor.
	 */
	CSyncSerialCommAppView();

public:
	/**
	 * From CoeControl,CountComponentControls.
	 */
	TInt CountComponentControls() const;

	/**
	 * From CCoeControl,ComponentControl.
	 */
	CCoeControl* ComponentControl(TInt aIndex) const;

	/**
	 * OfferKeyEventL
	 * From CCoeControl, Handles key event.
	 * @param aKeyEvent The key event.
	 * @param aType The type of the event.
	 * @return Indicates whether or not the key event was
	 *           used by this control.
	 */
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

	/**
	 * From MCoeControlObserver
	 * Acts upon changes in the hosted control's state. 
	 *
	 * @param    aControl    The control changing its state
	 * @param    aEventType    The type of control event 
	 */
	void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);

public:
	void InitSerial();
	void CloseSerial();
	void SendData();
	void RecvData();

private:
	CSyncSerialEngine* iEngine;

	CEikLabel* iLabelSend; // send text label
	CEikLabel* iLabelSendData; // input send data
	CEikLabel* iLabelRecv; // recv text label
	CEikLabel* iLabelRecvData; // display recv data

	};

#endif // __SYNCSERIALCOMMAPPVIEW_h__
// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -