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

📄 voipcallrecord.h

📁 一个WinCE6。0下的IP phone的源代码
💻 H
字号:
//
// 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.
//
// VoIPCallRecord.h : Declaration of the CVoIPCallRecord

#ifndef __VOIPCALLLOGRECORD_H_
#define __VOIPCALLLOGRECORD_H_

#include "VoIPCallLogDB.h"
#include <atlbase.h>
#include <atlcom.h>


#define MAX_WCHAR 500
#define RECORD_ID_CALLTYPE      0
#define RECORD_ID_ENDTIME       1
#define RECORD_ID_FRIENDLYNAME  2
#define RECORD_ID_STARTTIME     3
#define RECORD_ID_URI           4
#define RECORD_ID_VOIPNAME      5   
#define RECORD_ID_TIMESTAMP     6

/////////////////////////////////////////////////////////////////////////////
// CVoIPCallLogRecord
class ATL_NO_VTABLE CVoIPCallLogRecord : 
    public CComObjectRootEx<CComMultiThreadModel>,
    public CComCoClass<CVoIPCallLogRecord, &CLSID_VoIPCallLogRecord>,
    public IVoIPCallRecord
    { 

public:
    // Construction/destruction
    CVoIPCallLogRecord();
    virtual ~CVoIPCallLogRecord();

public:
    // IVoIPCallRecord

    //get/put the call type
    STDMETHOD (get_CallType)(VoIPCallType *pvctType);
    STDMETHOD (put_CallType)(VoIPCallType vctType);

    //Calculate the duration
    STDMETHOD (get_Duration)(SYSTEMTIME *pdate);

    //Get set the start/end time
    STDMETHOD (get_EndTime)(SYSTEMTIME *pdate);
    STDMETHOD (put_EndTime)(SYSTEMTIME date);
    STDMETHOD (get_StartTime)(SYSTEMTIME *pdate);
    STDMETHOD (put_StartTime)(SYSTEMTIME date);

    //Get/set the names and URI
    STDMETHOD (get_FriendlyName)(BSTR *pbstrFriendlyName);
    STDMETHOD (put_FriendlyName)(BSTR bstrFriendlyName);
    STDMETHOD (get_VoIPName)(BSTR *pbstrVoIPName);
    STDMETHOD (put_VoIPName)(BSTR bstrVoIPName);
    STDMETHOD (get_URI)(BSTR *pbstrURI);
    STDMETHOD (put_URI)(BSTR bstrURI);

    //Write/Remove the record from the DB
    STDMETHOD (Commit)();
    STDMETHOD (DeleteFromDB)();

    //non COM methods
    HRESULT put_TimeStamp(FILETIME& ft);
    
public:
    VOID        SetDB(CVoipDB   *pdb)  { m_pDBOwner = pdb; }
    VOID        SetOID(CEOID    ceoid) { m_ceoid = ceoid; }

private:
    //The internal DB we belong to
    CVoipDB         *m_pDBOwner;

    //Our OID in the DB (if we have been written)
    CEOID           m_ceoid;

    //What is our call type
    VoIPCallType    m_vctType;

    //Our URI
    WCHAR           m_pURI[MAX_WCHAR];

    //Friendly Name
    WCHAR           m_pFriendlyName[MAX_WCHAR];

    //VoIPName
    WCHAR           m_pVoIPName[MAX_WCHAR];

    //Start and end time
    SYSTEMTIME      m_StartTime;
    SYSTEMTIME      m_EndTime;

    FILETIME        m_TimeStamp;

public:
DECLARE_NO_REGISTRY()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CVoIPCallLogRecord)
    COM_INTERFACE_ENTRY(IVoIPCallRecord)
END_COM_MAP()

// IVoIPCallRecord
};

#endif //__VOIPCALLRECORD_H_

⌨️ 快捷键说明

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