📄 voipcallerinfodb.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.
//
// VoIPCallerInfoDB.h : Declaration of the CVoIPCallerInfoDB
#ifndef __VOIPCALLERINFODB_H_
#define __VOIPCALLERINFODB_H_
#include "DB.h"
#include <atlbase.h>
#include <atlcom.h>
#include "VoIPCallerInfoDBEnum.h"
class CVoIPCallerInfoRecord;
#define CALLER_INFO_DB_NAME L"VoIP Caller Information DB"
#define CALLER_INFO_DB_PROPERTY_COUNT 7
/*------------------------------------------------------------------------------
VoIPCallerInfoFlags
Flags that specify boolean properties about the caller.
------------------------------------------------------------------------------*/
enum VoIPCallerInfoFlags
{
e_vcifBlocked = 0x0001, // If set, this caller is blocked.
e_vcifAutoForward = 0x0002, // If set, autoforward this caller (CALLER_INFO_FORWARDINGURI is set).
e_vcifCustomRingTone = 0x0004, // If set, use a custom ring tone for this caller (CALLER_INFO_RINGTONEPATH is set).
};
/*------------------------------------------------------------------------------
VoIPCallerInfo PropIDs
Database fields for caller info databases.
------------------------------------------------------------------------------*/
const VOIP_PROPID CALLER_INFO_URI = MAKELONG(CEVT_LPWSTR , 0x0001);
const VOIP_PROPID CALLER_INFO_FRIENDLYNAME = MAKELONG(CEVT_LPWSTR , 0x0002);
const VOIP_PROPID CALLER_INFO_VOIPNAME = MAKELONG(CEVT_LPWSTR , 0x0003);
const VOIP_PROPID CALLER_INFO_SPEEDDIALENTRY = MAKELONG(CEVT_I4 , 0x0004);
const VOIP_PROPID CALLER_INFO_FLAGS = MAKELONG(CEVT_I4 , 0x0005);
const VOIP_PROPID CALLER_INFO_FORWARDINGURI = MAKELONG(CEVT_LPWSTR , 0x0006);
const VOIP_PROPID CALLER_INFO_RINGTONEPATH = MAKELONG(CEVT_LPWSTR , 0x0007);
/////////////////////////////////////////////////////////////////////////////
// CVoIPCallerInfoDB
class ATL_NO_VTABLE CVoIPCallerInfoDB :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CVoIPCallerInfoDB, &CLSID_VoIPCallerInfoDB>,
public IVoIPCallerInfoDB
{
public:
CVoIPCallerInfoDB();
~CVoIPCallerInfoDB();
virtual HRESULT STDMETHODCALLTYPE Init(
/* [in] */ BSTR bstrURI
);
// IVoIPCallerInfoDB
virtual HRESULT STDMETHODCALLTYPE get_Enumerator(
/* [retval][out] */ IVoIPCallerInfoDBEnum **ppiEnum
);
virtual HRESULT STDMETHODCALLTYPE FindCallerInfoByURI(
/* [in] */ BSTR bstrURI,
/* [retval][out] */ IVoIPCallerInfoRecord **ppiRecord
);
virtual HRESULT STDMETHODCALLTYPE FindCallerInfoBySpeedDialEntry(
/* [in] */ INT idxSpeedDial,
/* [retval][out] */ IVoIPCallerInfoRecord **ppiRecord
);
virtual HRESULT STDMETHODCALLTYPE CreateRecord(
/* [out][retval] */ IVoIPCallerInfoRecord **ppiRecord
);
virtual HRESULT STDMETHODCALLTYPE get_SpeedDialEnumerator(
/* [out] [retval] */ IVoIPCallerInfoDBEnum **ppiEnum
);
virtual HRESULT STDMETHODCALLTYPE get_FriendlyNameEnumerator(
/* [out] [retval] */ IVoIPCallerInfoDBEnum **ppiEnum
);
public:
// Package internal member functions
HRESULT FillRecord(
IVoIPCallerInfoRecord *piRecord,
CEPROPVAL *pProps,
int cProps
);
HRESULT InternalCreateRecord(
CComObject<CVoIPCallerInfoRecord> **ppRecord
);
HRESULT CreateEnumerator(
IVoIPCallerInfoDBEnum **ppiEnum,
FilterFn *pfnFilter
);
private:
//Finds a record in the underlying DB by the specified cepropval structure
HRESULT FindRecordByCEPROPVAL(CEPROPVAL *pcepv, IVoIPCallerInfoRecord * * ppiRecord);
public:
DECLARE_NO_REGISTRY()
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CVoIPCallerInfoDB)
COM_INTERFACE_ENTRY(IVoIPCallerInfoDB)
END_COM_MAP()
private:
CVoipDB* m_pCallerInfoDB;
BOOL m_fInit;
};
#endif //__VOIPCALLERINFODB_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -