www.pudn.com > Fax_Event_Message.rar > Fax_Event_VCDLG.h


// Fax_Event_VCDlg.h : header file 
// 
 
#if !defined(AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_) 
#define AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "../../../../api/vc6.0/inc/shpa3api.h" 
#include "FirstDlg.h" 
#include "SecondDlg.h" 
#include "ThirdDlg.h" 
#include "FourthDlg.h" 
 
//fax direction 
enum { 
	C_SEND_FAX,			//send fax 
	C_RECEIVE_FAX		//receive fax 
}; 
//type of channel 
enum{ 
	ANALOG_CH=0,		//Analog trunk channel  
	INTER_CH=1,			//Station channel 
	USER_CH=2,			//Station channel 
	REC_CH=3,			//Record channel 
	SS1_CH=4,			//Digital channel (SS1) 
	FAX_CH=5,			//Fax channel 
	TUP_CH=6,			//Digital channel (SS7 TUP) 
	ISDN_USER_CH=7,		//Digital channel (ISDN user side) 
	ISDN_NET_CH = 8,	//Digital channel (ISDN network side) 
	SOFTFAX_CH = 9,		//Soft fax 
	MAGNET_CH = 10		//Magnet channel 
}; 
//user-defined trunk channel state 
enum{ 
    TRK_IDLE,					//idle 
    TRK_PLAY_VOC1,				//Play voice 'this is fax demo system: press 1 to receive fax file; press 2 to transmit fax file' 
    TRK_PLAY_VOC2,				//play voice 2:"please press key 'start' to continue" 
    TRK_DIALING,				//dialing 
    TRK_FAXING,					//faxing... 
}; 
//user-defined fax channel state 
enum{ 
	FAX_IDLE,					//idle 
	FAX_CHECK_END,				//faxing... 
}; 
//fax channel  
typedef struct tagFAX_STRUCT 
{ 
	BOOL	bUseful;			//channel seizure flag: FALSE- not seized  TRUE-seized 
	char	szChErrMsg[250];	//error message 
	char	szPage[10];			//number of fax pages 
	char	szGetID[30];		//ID of the receiver's fax machine 
	int		nDirection;			//fax direction : 0-send  1-receive  
	int		nStep;				//user-defined fax channel state 
	int		nAnswered;			//check whether press start-up button : 0-no  1-yes 
	char	szRcvPathFile[250];	//file name received(include path) 
	char	szSendFile[250];	//file name to be sent 
	char	szSendPath[250];	//path for sending fax file 
	int		nStartPage;			//start page 
	int		nEndPage;			//end page 
	int		nCheckEnd;			//test execution result of faxing task 
	int		nTrunkCh;			//trunk channel ID linked to fax channel 
	int		nHowFile;			//modes of sending fax file: 0-single file  1-multi-file  2- multi-file with page number 
	int		nSCTNumber;			//number of files in ffSCT format  
	FAX_FILE_SCT *pffSCT;	 
	int		nAllBytes;			//total number of bytes to be sent 
	int		nSendBytes;			//number of bytes sent 
	int		nRcvBytes;			//number of bytes received 
}FAX_STRUCT; 
 
//trunk channel 
typedef struct tagTRUNK_STRUCT 
{ 
	BOOL	bEnCalled;			//enable or disenable calling: TRUE-enable  FALSE-forbid  
    BOOL	bRecord;			//recording or not : TRUE-record   FALSE-not record 
	int		nCallFlag;			//inbound or outbound call : 0-inbound  1-call outbound 
	int		nLineState;			//channel state 
	char	szChErrMsg[250];	//error message 
	char	szCallNo[20];		//called party number 
	char	szCallerId[20];		//calling party number 
	char	szDtmf[20];			//DTMF received 
	int		nToFaxCh;			//fax channel connected with trunk channel by bus 
	int		nStep;				//user-defined trunk channel state 
	int		nAutoOrNot;			//faxing mode: 0- automatic   1- manual 
	BOOL	bUseful;			//channel seizure flag: FALSE- not seized  TRUE-seized 
	int		nIndex;				//Which number is the received DTMF?  
	char	szDtmfChose[1];		//stored the first received DTMF of "1" or "2"  
	int		nFirstDtmf;			//check if it is the first received DTMF "1" or "2"  
	int		nTimer;				//timer ID 
	BOOL	bLinked; 
}TRUNK_STRUCT; 
 
///////////////////////////////////////////////////////////////////////////// 
// CFax_Event_VCDlg dialog 
 
class CFax_Event_VCDlg : public CDialog 
{ 
public: 
	CFirstDlg m_FirstDlg; 
	CSecondDlg m_SecondDlg; 
	CThirdDlg m_ThirdDlg; 
	CFourthDlg m_FourthDlg; 
	CString strLab[20]; 
 
// Construction 
public: 
	CFax_Event_VCDlg(CWnd* pParent = NULL);	// standard constructor 
	virtual ~CFax_Event_VCDlg(); 
// Dialog Data 
	//{{AFX_DATA(CFax_Event_VCDlg) 
	enum { IDD = IDD_Fax_Event_VC_DIALOG }; 
	CComboBox	m_cmbFaxCh; 
	CTabCtrl	m_TabCtrl; 
	CListCtrl	m_TrkChList; 
	CListCtrl	m_FaxChList; 
	CComboBox	m_cmbTrkChNo; 
	CComboBox	m_cmbTrkCh; 
	CComboBox	m_cmbFaxChNo; 
	CString	m_strAppendFile; 
	int		m_nAutoOrNot; 
	int		m_nFaxSpeed; 
	BOOL	m_bRecord; 
	CString	m_strSetId; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CFax_Event_VCDlg) 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support 
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	HICON m_hIcon; 
 
	// Generated message map functions 
	//{{AFX_MSG(CFax_Event_VCDlg) 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnRadioSpeed4800(); 
	afx_msg void OnRadioSpeed9600(); 
	afx_msg void OnRadioSpeed14400(); 
	afx_msg void OnButtonAppendFile(); 
	afx_msg void OnButtonAppendSend(); 
	afx_msg void OnButtonFaxStop(); 
	afx_msg void OnRadioAuto(); 
	afx_msg void OnRadioManual(); 
	afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult); 
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); 
	afx_msg void OnSelchangeComboTrkCh(); 
	afx_msg void OnCheckRecord(); 
	afx_msg void OnSelchangeComboTrkch(); 
	afx_msg void OnButtonSetId(); 
	afx_msg void OnChangeEditSetId(); 
	afx_msg void OnDestroy(); 
	afx_msg void OnTimer(UINT nIDEvent); 
	virtual void OnOK() 
	{ 
	} 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
private: 
	int			m_nTotalCh;				//total number of channels	 
	char		m_szErrMsg[200];		//error message 
	FAX_STRUCT  m_FaxCh[500];			//fax channel 
	TRUNK_STRUCT m_TrkCh[500];			//trunk channel 
	char		m_szCurPath[MAX_PATH];  //current path 
	char		m_szAppendFile[50];		//append fax file 
	FILE		*m_LogFile;				//pointers pointing at log file created 
	BOOL		m_bLog;					//flag indicating if log file is successfully created: 0-unsuccessful   1-successful 
	int			m_nTabShow;				//choices provided by IDC-TAB resource framework: 
										//0-IDD_FIRST_DLG  1-IDD_SECOND_DLG 2-IDD_THIRD_DLG 3-IDD_FOURTH_DLG 
	void		UpdateTrunkChListCtrl();// update trunk channel list 
	void		UpdateFaxChListCtrl();	//update fax channel list 
	void		WriteLog(char* szLog);  // write log messages 
	BOOL		InitCtiBoard();			//initialize board 
	int			FindAnIdleFaxCh();		//search for an idle fax channel 
	int			FindAnIdleTrunkCh();	//search for an idle trunk channel 
	void		InitTrunkChListCtrl();  //initialize trunk channel list 
	void		InitFaxChListCtrl();	//initialize fax channel list 
	void		TrunkProc(UINT event, WPARAM wParam, LPARAM lParam); 
	void		FaxProc(UINT event, WPARAM wParam, LPARAM lParam);	 
	void		ScanTaskQueue();		//scan task queue 
	void		Hangup(int nChannel);	//hangup 
	void		InitLab(); 
}; 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_Fax_Event_VCDLG_H__2719AD39_556B_4238_A238_791BC0DDB330__INCLUDED_)