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

📄 callbase.hpp

📁 一个WinCE6。0下的IP phone的源代码
💻 HPP
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#pragma once

#ifndef __CALLBASE_HPP__
#define __CALLBASE_HPP__

#include "rtccore.h"
#include "Phone.hpp"
#include "auto_xxx.hxx"

class Call_t : public IUnknown
{
public: 

    //virtual functions
    virtual 
    ~Call_t(
        void
        ); 

    //IUnknown interface
    ULONG STDMETHODCALLTYPE
    AddRef(
        void
        ); 

    ULONG STDMETHODCALLTYPE
    Release(
        void
        ); 

    HRESULT STDMETHODCALLTYPE
    QueryInterface(
        REFIID, 
        LPVOID*
        )
    { ASSERT(FALSE); return E_NOTIMPL; }; 

    virtual 
    HRESULT 
    OnRTCSessionStateChangeEvent(
        __in IRTCSessionStateChangeEvent* pEvent
        );

    virtual 
    HRESULT OnRTCParticipantStateChangeEvent(
        __in IRTCParticipantStateChangeEvent* pEvent
        );

    virtual 
    HRESULT OnRTCSessionReferredEvent(
        __in IRTCSessionReferredEvent* pEvent
        );

    virtual 
    HRESULT OnRTCSessionReferStatusChangeEvent(
        __in  IRTCSessionReferStatusEvent*  pEvent
        );    

    virtual 
    HRESULT
    SetInfoAboutBeingTransferred(
        __in IRTCSessionReferredEvent*  pRTCSessionReferredEvent, 
        __in Call_t*                    pReferringCall
        ); 


    HRESULT
    GetDisplayName(
        __out_ecount(BufferSize) WCHAR* pBuffer, 
        unsigned int                    BufferSize
        ); 

    HRESULT
    GetDisplayNumber(
        __out_ecount(BufferSize) WCHAR* pBuffer, 
        unsigned int                    BufferSize
        ); 

    ce::auto_bstr&
    GetDisplayName(
        void
        ); 

    ce::auto_bstr&
    GetDisplayNumber(
        void
        ); 

    HRESULT
    GetRingTonePath(
        __out_ecount(BufferSize) WCHAR* pBuffer, 
        unsigned int                    BufferSize
        ); 

    LONG
    GetNetworkStatus(
        void
        ) 
    {
        return  m_NetworkStatus;         
    }; 

    bool
    IsBlocked(
        void
        )
    {
        return m_IsBlocked; 
    }; 

    void
    MarkAsRejected(
        void
        )
    {
        m_IsRejected = true; 
        return; 
    }; 

    bool
    IsRejected(
        void
        )
    {
        return m_IsRejected; 
    }

#ifdef DEBUG
    void
    DebugState(
        void
        ); 
#endif
    
    //pure virtual functions
    virtual 
    void
    ForceDestroy(
        void
        ) = 0; 


    virtual 
    bool 
    Contains(
        __in IRTCSession* pRTCSession
        ) = 0;

    virtual 
    HRESULT 
    DoPhoneVerb(
        PH_VERB Verb,
        VPARAM  Parameters = NULL          
        ) = 0;


    virtual
    RTC_SESSION_STATE   
    GetCallStatus(
        void
        ) = 0;

    virtual 
    HRESULT 
    GetURI(
        __deref_out BSTR* pURI
        ) = 0; 

    virtual 
    HRESULT 
    GetDuration(
        __out SYSTEMTIME* pDuration
        ) = 0; 

    virtual 
    HRESULT 
    SendDTMF(
        RTC_DTMF DTMFCode
        ) = 0;


protected: 

    Call_t(
        void
        ); 

protected: 

    SYSTEMTIME      m_StartTime;
    SYSTEMTIME      m_EndTime;

    LONG            m_NetworkStatus;

    ce::auto_bstr   m_bstrURI; 
    ce::auto_bstr   m_bstrName; 
    ce::auto_bstr   m_bstrFriendlyNumber; 
    ce::auto_bstr   m_bstrFriendlyName; 

    bool            m_IsBlocked; 
    bool            m_IsRejected; 
    ce::auto_bstr   m_bstrRingTonePath; 

private: 

    int             m_RefCount;
    
    
}; 

#endif /* __CALLBASE_HPP__ */

⌨️ 快捷键说明

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