ansphonecallmaker.h

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

H
71
字号

#ifndef __ANSPHONECALLMAKER_H__
#define __ANSPHONECALLMAKER_H__

#include <etel.h>

class MAnsPhoneCallMakerObserver
{
    public:
        virtual void HandleCallHungUpL() = 0;
};

/**
*
* @class    CAnsPhoneCallMaker AnsPhoneCallMaker.h
* @brief    This class makes a phone call
*
*    An RCall handle is required to make the call. In order to open it, we need a handle on
*    an RLine handle. This will have been opened before this class is constructed and is passed
*    in as a parameter of the constructor.
*    
*    The MakeCallL() function is called in order to make the call.
*    This uses one of the RCall.DialL() functions. The RunL() function is called when the number 
*    has been dialled. At this point, we ask the RCall handle to notify us if a change occurs to 
*    its status, using NotifyStatusChange(). This will result in the RunL() function being
*    called when the status has changed. If the status is hanging up or idle, then we close the
*    RCall handle.
*    The observer is updated when the call has been hung up
*
* Copyright (c) EMCC Software Ltd 2003
* @version    1.0
*
*/

class CAnsPhoneCallMaker : public CActive
{
    public:
        static CAnsPhoneCallMaker* NewL(MAnsPhoneCallMakerObserver& aObserver, RLine& aLine);
        ~CAnsPhoneCallMaker();

    public:                // CActive
        virtual void RunL();
        virtual void DoCancel();

    public:
        void MakeCallL(const TDesC& aNumber);

    private:
        //    the state of this object governs what happens when the
        //    StartL() / Stop() / RunL() / DoCancel() functions are called.
        enum TState{ ENoState, EDialling, EWatching };

    private:
        CAnsPhoneCallMaker(MAnsPhoneCallMakerObserver& aObserver, RLine& aLine);
        void ConstructL();

    private:
        void StartL();
        void Stop();

    private:
        MAnsPhoneCallMakerObserver&    iObserver;
        RLine&                        iLine;
        RCall                        iCall;
        RCall::TStatus                iCallStatus;
        TState                        iState;
        TPtrC                       iNumber;
};

#endif

⌨️ 快捷键说明

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