#if !defined(AFX_SELECTDATASOURCEPAGE_H__DA10D124_389C_4190_94E7_0D7F79E60C72__INCLUDED_)
#define AFX_SELECTDATASOURCEPAGE_H__DA10D124_389C_4190_94E7_0D7F79E60C72__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectdatasourcePage.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CSelectdatasourcePage dialog
#include "resource.h"
#include "CommonQuery.h"
#include "ReportDict.h"

class CSelectdatasourcePage : public CaplTranslateDialog
{
protected:
	typedef bool(*LPQUERYFUNCTION)(CaplQuery*,CRParamsArray&,UINT);
	
	class CaplAddinElement
	{
	public:
		CaplQuery m_query;
		LPQUERYFUNCTION lpQueryFunc;
		HMODULE hMod;
		CString name;
		UINT m_id;
	};
	CArray<CaplAddinElement*,CaplAddinElement*> m_addin_elements;
// Construction
	CaplReportMgr	*m_ReportMgr;
public:
	bool TestUpdate();
	CHeader* GetHeader();
	CHeader	*m_pSelectedHeader;

	CSelectdatasourcePage(CaplReportMgr *ReportMgr, CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CSelectdatasourcePage)
	enum { IDD = IDD_SELECT_DATASOURCE_PAGE };
	CButton	m_browsefile_btn;
	CListBox	m_QueryListCtrl;
	int		m_DSType;
	CString	m_sFileName;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSelectdatasourcePage)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void ResetAddins();
	void LoadAddins();

	// Generated message map functions
	//{{AFX_MSG(CSelectdatasourcePage)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnDsFile();
	afx_msg void OnDsQuery();
	afx_msg void OnBrowseBtn();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SELECTDATASOURCEPAGE_H__DA10D124_389C_4190_94E7_0D7F79E60C72__INCLUDED_)
