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

📄 ansphoneview.h

📁 s60 接打电话代码,很有学习价值的,可以移植到不同平台
💻 H
字号:
#ifndef __ANSPHONEVIEW_H__
#define __ANSPHONEVIEW_H__

// INCLUDES

#include <coecntrl.h>
#include <eiklbo.h>
#include "AnsPhoneEngine.h"

// FORWARD DECLARATIONS
class CEikLabel;
class CAknDoubleGraphicStyleListBox;

// CLASS DECLARATION

/**
*
* @class	CAnsPhoneView AnsPhoneView.h
* @brief	This class contains a CAnsPhoneEngine object, which controls the
*			answering phone.
*			The view displays
*			->	status of the answering phone, i.e. if it is stopped/running/answering
*			->	status of new messages
*			->	list of all messages received.
*
* Copyright (c) EMCC Software Ltd 2003
* @version	1.0
*
*/
class CAnsPhoneView : public CCoeControl, public MEikListBoxObserver, public MAnsPhoneEngineObserver
	{
	public:
		enum TState { EStopped, ERunning, EAnswering, EMessages, ECanStop };

	public:
		static CAnsPhoneView* NewL(const TRect& aRect);
		~CAnsPhoneView();

	public:				// MAnsPhoneEngineObserver
		virtual void HandlePlayMessageOverL();
		virtual void HandleCallChangeL(const RCall::TStatus& aStatus);
		virtual void HandleNewMessageL();

	public:				// MEikListBoxObserver
		virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);

	public:
		void AnsweringStartL();
		void AnsweringStopL();
		void ShowMessagesL();
		void PlayMessageL();
		void RecordMessageL();
		void Stop();
		void DialL();
		void DeleteMessageL();
		void BackL();
		inline TInt MessageItemsCount() const;

	public:
		inline TState State() const;

	private:
		CAnsPhoneView();
		void ConstructL(const TRect& aRect);

	private:			// CCoeControl
		virtual void Draw(const TRect& aRect) const;
		virtual TInt CountComponentControls() const;
		virtual CCoeControl* ComponentControl(TInt aIndex) const;
		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

	private:
		CEikLabel*						iDisplayStatus;
		CEikLabel*						iDisplayMessages;
		CAknDoubleGraphicStyleListBox*	iMessagesList;

		CAnsPhoneEngine*	iEngine;

		TInt	iNumberNewMessages;
		TBool	iCanStop;

		// used for menus
		TState	iState;
		TState	iPreviousState;
		TState	iMainState;
	};

// inline functions
CAnsPhoneView::TState CAnsPhoneView::State() const	{ return iState; }
TInt CAnsPhoneView::MessageItemsCount() const            { return iEngine->MessageList().Count(); }

#endif

⌨️ 快捷键说明

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