www.pudn.com > TsapiCallRouting.rar > CallRoutingDlg.h


// CallRoutingDlg.h : header file 
// 
 
#include "tsapi.h" 
#include "afxcmn.h" 
#include "global.h" 
#include "afxwin.h" 
 
#define LOG_TIME	0 
#define LOG_MESSAGE	1 
 
#define RULE_NUMBER 0 
#define LOWER_BOUND 1 
#define UPPER_BOUND 2 
#define DESTINATION 3 
 
 
#define toMessageWindow TO_MESSAGE_WINDOW 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CallRoutingDlg dialog 
 
class CallRoutingDlg : public CDialog 
{ 
// Construction 
public: 
	CallRoutingDlg(CWnd* pParent = NULL);	// standard constructor 
 	virtual ~CallRoutingDlg(); 
	afx_msg void OnLbnSelchangeLoglist(); 
// Dialog Data 
	//{{AFX_DATA(CallRoutingDlg) 
	enum { IDD = IDD_SAMPLE_DIALOG }; 
 
 
 
	CEdit	m_ToDeviceIDControl; 
	CButton	m_HangUpControl; 
	CButton	m_CallControl; 
	CString	m_ToDeviceID; 
	CString	m_LocalStatus; 
	CString	m_RemoteStatus; 
	bool routeRegistrationSuccessful; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CallRoutingDlg) 
	//}}AFX_VIRTUAL 
 
	CTsapiWnd* m_TsapiWndPtr; 
 
// Implementation 
protected: 
	HICON m_hIcon; 
 
	RouteRegisterReqID_t routeRegisterReqID; 
	 
	 
	long m_CallHandle; 
	int item;	 
	int ruleItem; 
	 
	CEdit m_destinationControl; 
	CString m_destination; 
 
	CListCtrl m_LogListControl; 
	CListCtrl m_RuleListControl; 
	CEdit m_DefaultRouteControl; 
	CString m_DefaultRoute; 
	CEdit m_UUMessageControl; 
	CString m_UUMessage; 
	CString m_lowerBound; 
	CString m_upperBound; 
 
 
 
	// Generated message map functions 
	//{{AFX_MSG(CallRoutingDlg) 
	virtual BOOL OnInitDialog(); 
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support 
	LRESULT OnTsapiCstaConfirmation(WPARAM wParam, LPARAM lParam); 
	LRESULT CallRoutingDlg::OnTsapiCstaUnsolicited(WPARAM wParam, LPARAM lParam); 
	LRESULT CallRoutingDlg::OnTsapiCstaRequest(WPARAM wParam, LPARAM lParam); 
	LRESULT RegisterRoutingServer(const char * device); 
	void UpdateRuleList(); 
	int CallRoutingDlg::getRoute(int account); 
	afx_msg void OnTimer(UINT nIDEvent); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
 
	void toMessageWindow(CString message); 
	 
 
public:	 
	CEdit m_lowerBoundControl; 
	CEdit m_upperBoundControl; 
	afx_msg void OnBnClickedAdd(); 
	afx_msg void OnBnClickedDelete(); 
	afx_msg void OnBnClickedMoveup(); 
	afx_msg void OnBnClickedMovedown(); 
	afx_msg void OnBnClickedSet(); 
	afx_msg void OnLvnItemActivateRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnHdnItemclickRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnLvnColumnclickRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnNMRclickRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnLvnItemchangedRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnNMClickRuleList(NMHDR *pNMHDR, LRESULT *pResult); 
 
private: 
	void ChangeRulePosition(int currentPosition, int newPosition, bool down); 
	UINT GetSelectedRuleNumber(); 
	void DeleteRule(UINT position); 
};