ansphoneview.h

来自「series60 应用程序开发的源代码 series60 应用程序开发的源代码」· C头文件 代码 · 共 92 行

H
92
字号
#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 + =
减小字号Ctrl + -
显示快捷键?