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

📄 ansphoneappview.h

📁 symbian os s603rd 电话示例
💻 H
字号:
/*
============================================================================
 Name        : AnsPhoneAppView.h
 Author      : Lion
 Copyright   : Your copyright notice
 Description : Declares view class for application.
============================================================================
*/

#ifndef __ANSPHONEAPPVIEW_h__
#define __ANSPHONEAPPVIEW_h__

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


class CEikLabel;
//class CAknDoubleGraphicsStyleListBox;
class CAknDoubleStyleListBox;
// CLASS DECLARATION
class CAnsPhoneAppView : public CCoeControl, public MEikListBoxObserver, public MAnsPhoneEngineObserver
    {
    public:
    	enum TState
    		{
    		EStopped,
    		ERunning,
    		EAnswering,
    		EMessages,
    		ECanStop
    		};
    public: // New methods

        /**
        * NewL.
        * Two-phased constructor.
        * Create a CAnsPhoneAppView 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 CAnsPhoneAppView.
        */
        static CAnsPhoneAppView* NewL( const TRect& aRect );

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

        /**
        * ~CAnsPhoneAppView
        * Virtual Destructor.
        */
        virtual ~CAnsPhoneAppView();
	
	public:
		virtual void HandlePlayMessageOverL();
		virtual void HandleCallChangeL(const RCall::TStatus& aStatus);
		virtual void HandleNewMessageL();
		
		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;
		inline TState State() const;
		
	private:
		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);
		
		void SizeChanged();
    
    private: // Constructors

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

        /**
        * CAnsPhoneAppView.
        * C++ default constructor.
        */
        CAnsPhoneAppView();
    private:
    	CEikLabel* iDisplayStatus;
    	CEikLabel* iDisplayMessages;
    	CAknDoubleStyleListBox* iMessagesList;
    	
    	CAnsPhoneEngine* iEngine;
    	TInt iNumberNewMessages;
    	TBool iCanStop;
    	TState iState;
    	TState iPreviousState;
    	TState iMainState;

    };

CAnsPhoneAppView::TState CAnsPhoneAppView::State() const {return iState;}
TInt CAnsPhoneAppView::MessageItemsCount() const {return iEngine->MessageList().Count();}
#endif // __ANSPHONEAPPVIEW_h__

// End of File

⌨️ 快捷键说明

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