www.pudn.com > tapi3.zip > TAPILINE.H
// tapiline.h : header file // (c) Dialogic corp 1995, 1996 // // Functions defs #define FUNCTION_MAKECALL 1 #define FUNCTION_DROP 2 #define FUNCTION_ANSWER 3 #define FUNCTION_DIAL 4 #define FUNCTION_DEVSPEC 5 #define FUNCTION_FORWARD 6 // Wave IN/OUT defs #define WAVEIN 1 #define WAVEOUT 2 // Device specific action steps #define DEVSPEC_IDLE 0 #define DEVSPEC_STARTING 1 // before LINE_REPLY arrived #define DEVSPEC_PROGRESS 2 #define DEVSPEC_SUCCESS 4 #define DEVSPEC_STARTFAILED 8 // failed to start #define DEVSPEC_RESULTFAILED 16 // failed to finish class CTapiCall; BOOL IsLineRemote(LPLINEDEVCAPS lpDC); // no longer need this //typedef CMapCallList; // list of calls on line ///////////////////////////////////////////////////////////////////////////// // CTapiLine command target class CTapiLine : public CObject { DECLARE_DYNCREATE(CTapiLine) protected: CTapiLine(); // protected constructor used by dynamic creation // Attributes public: CTapiLine(DWORD dwLineID); virtual ~CTapiLine(); CString m_csName; // Readable name protected: CTapiApp *m_pApp; // Main app handle DWORD m_dwLineID; // device ID HLINE m_hLine; // Line handle UINT m_uiWaveInID; // WAVE/In ID UINT m_uiWaveOutID; // WAVE/Out ID DWORD m_dwApiVersion; // TAPI version supported DWORD m_dwExtVersion; // Extension version // for now, until one call is destroyed, don't establish another CTapiCall *m_pActiveCall; // Active call -to be replaced by List LINECALLPARAMS *m_lpCallParms; HANDLE m_hCallSem; DWORD m_dwDevSpecStat; // Status of devspec function DWORD m_dwDevSpecFunc; // Currrently executed devspec function BOOL m_bRemote; // Operations public: DWORD ctlLineOpen(DWORD dwLineID); DWORD ctlLineClose(); LONG ctlLineForward(LPSTR lpDest); HLINE ctlGetHLine() {return m_hLine;} DWORD ctlGetLineID() {return m_dwLineID;} DWORD ctlGetWaveInID() {return m_uiWaveInID;} DWORD ctlGetWaveOutID() {return m_uiWaveOutID;} CTapiCall *ctlGetActiveCall() // Protect by mutex together w/setcall {return m_pActiveCall;} DWORD ctlLineGetCaps(LPLINEDEVCAPS *lppDevCaps); BOOL ctlSetCallParms(LINECALLPARAMS *lpCallParms); // set the internal structure if needed LONG ctlLineMakeCall(LPCSTR lpDestAddress, DWORD dwCountryCode); LONG ctlLineAnswer(HCALL hCall = NULL); LONG ctlLineDrop(CTapiCall *pCall = NULL); LONG ctlLineDeallocateCall(CTapiCall *pCall = NULL); LONG ctlOfferCall(HCALL hCall); LONG ctlLineDial(CTapiCall *pCall, LPCSTR lpAddr, DWORD dwCountryCode); virtual void ctlPurgeCalls(); // free memory & other resources virtual void ctlUpdateCallStatus(WORD wFunction, DWORD dwStatus, CTapiCall *pCall); virtual BOOL ctlUpdateCallInfo(HCALL hCall, LPLINECALLINFO lpCallInfo); LPLINEDEVSTATUS ctlGetLineDevStatus(); void ctlConfigDialog(HWND hWnd, LPSTR lpClass); LONG ctlLineDevSpecific(DWORD dwFunc, DWORD dwAddressID, HCALL hCall, LPVOID lParams, DWORD dwSize); void ctlUpdateDevSpecStatus(DWORD dwDevSpecStat = 0xffffffff) {if(dwDevSpecStat != 0xffffffff) InterlockedExchange((LONG *)&m_dwDevSpecStat, dwDevSpecStat);} DWORD ctlGetDevSpecStatus() {return m_dwDevSpecStat;} void ctlUpdateDevSpecFunction(DWORD dwDevSpecFunc = 0xffffffff) {if(dwDevSpecFunc != 0xffffffff) InterlockedExchange((LONG *)&m_dwDevSpecFunc, dwDevSpecFunc);} DWORD ctlGetDevSpecFunc() {return m_dwDevSpecFunc;} DWORD ctlGetApiVersion() {return m_dwApiVersion;} DWORD ctlGetExtVersion() {return m_dwExtVersion;} BOOL IsRemote(){return m_bRemote;} protected: LONG AddCall(HCALL hCall=NULL); void RemoveCall(CTapiCall *pCall = NULL); void ctlGetWaveDeviceID (WORD wType); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CTapiLine) //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CTapiLine) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG //DECLARE_MESSAGE_MAP() }; /////////////////////////////////////////////////////////////////////////////