www.pudn.com > tapi3.zip > TALKER32.H


// talker32.h : main header file for the TALKER32 application 
// (c) Dialogic corp 1995, 1996 
// 
 
#ifndef __AFXWIN_H__ 
	#error include 'stdafx.h' before including this file for PCH 
#endif 
 
#include "resource.h"		// main symbols 
 
#define MAXLINES  16		// Hard-coded maximum number of lines!!! 
 
// keys for searching for Calls 
#define KEY_LINE			1 
#define KEY_WAVEINHANDLE	2 
#define KEY_WAVEOUTHANDLE	3 
 
// Line options 
#define AUTOANSWER			0x0001 	// answer immed  
#define AUTOPLAY			0x0002	// play immed on connection 
#define PLAY_ONCE			0x1000 
 
///////////////////////////////////////////////////////////////////////////// 
// CTalkApp: 
// See talker32.cpp for the implementation of this class 
// 
 
class CTalkApp : public CTapiApp 
{ 
public: 
	CTalkApp(); 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CTalkApp) 
	public: 
	virtual BOOL InitInstance(); 
	virtual int ExitInstance(); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual void OnLineReply(DWORD dwCallback, DWORD idRequest, DWORD dwStatus); 
	CTapiLine *GetTapiLine(DWORD dwID) 
	{return dwID < m_dwLines ? m_ctlLines[dwID] : NULL;} 
	DWORD cappGetLineDevCaps(DWORD dwLineID, LPLINEDEVCAPS *lppDevCaps) 
	{if(dwLineID < m_dwLines) return m_ctlLines[dwLineID]->ctlLineGetCaps(lppDevCaps); else return 0xffffffff;} 
	virtual void NotifyFrontEnd(DWORD dwLineID) 
	{m_pMainWnd->PostMessage(WM_COMMAND, m_dwTapiAlert, (LPARAM)dwLineID);} 
	CTapiLine * GetLineByCall(HCALL hCall); 
	CTapiLine * GetLineByHLine(HLINE hLine); 
 
	virtual void OnCallState(HCALL hCall, DWORD hCallback, DWORD dwCallState, 
							DWORD dwCallStateDetail, DWORD dwCallPrivilege); 
	virtual void OnLineCallInfo(HCALL hCall, DWORD dwCallBack, DWORD dwParm); 
	virtual void OnMonitorDigits(HCALL hCall, DWORD dwCallBack, DWORD dwDigit, DWORD dwDigitMode); 
	virtual void OnGatherDigits(HCALL hCall, DWORD dwCallBack, DWORD dwTermination); 
	virtual void OnLineDevSpec(DWORD hCall, DWORD dwCallBack, DWORD dwParm1, DWORD dwParm2, DWORD dwParm3); 
	virtual void OnMonitorMedia(DWORD hCall, DWORD dwCallBack, DWORD dwParm1, DWORD dwParm2, DWORD dwParm3); 
	virtual LPVOID GetCallByParm(WORD wKey, DWORD dwValue); 
	virtual void SetNotificationControlID(DWORD dwID)  
	{m_dwTapiAlert = dwID;}  
	virtual void Cleanup();		// before exit, that is 
	// public utilities 
	virtual BOOL Code2CallState(DWORD dwState, LPSTR lpBuf, int nSize);	 
	virtual BOOL Code2Error(DWORD dwError, LPSTR lpBuf, int nSize);	 
	void SetHelpId(int nHelpId) {InterlockedExchange((LPLONG)&m_nHelpId, nHelpId);} 
	void OnHelp(); 
 
public: 
	WORD m_wLineOptions[MAXLINES]; 
 
protected: 
	CTapiLine *m_ctlLines[MAXLINES]; // just for now; need to implement some kind of a list 
	DWORD m_dwTapiAlert; 
	int m_nHelpId; 
 
	//{{AFX_MSG(CTalkApp) 
		// NOTE - the ClassWizard will add and remove member functions here. 
		//    DO NOT EDIT what you see in these blocks of generated code ! 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
// CStatusBox dialog 
 
class CStatusBox : public CDialog 
{ 
// Construction 
public: 
	CStatusBox(CWnd* pParent = NULL);   // standard constructor 
 
// Dialog Data 
	//{{AFX_DATA(CStatusBox) 
	enum { IDD = IDD_STATUSDLG }; 
	CString	m_csStatus; 
	//}}AFX_DATA 
 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CStatusBox) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	// Generated message map functions 
	//{{AFX_MSG(CStatusBox) 
	virtual BOOL OnInitDialog(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
};