#pragma once

#include <AplGuiEx.h>
#include "resource.h"

class CaplPreExploitationMgr;

// CFindPDFDlg dialog

class CFindPDFDlg : public CaplTranslateDialog
{
	// Construction
protected:
	CaplAPI				*m_api;
	CaplPreExploitationMgr	*m_ExploitationMgr;

	CToolTipCtrl		m_ToolTipCtrl;

	TFindPdfModes		m_Mode;
	UINT				m_Flags;

	//LPUserFindFunct		m_pFunct;
	//LPUserCreateFunct	m_pCreateFunct;
	DWORD				m_dwUserData;
public:
	CFindPDFDlg(CaplAPI *api, TFindPdfModes mode, UINT Flags, CWnd* pParent = NULL);
	//CFindPDFDlg(CaplAPI *api, TFindPdfModes mode, UINT Flags, LPUserFindFunct lpFunct, DWORD dwData, CWnd* pParent = NULL);   // standard constructor
	//CFindPDFDlg(CaplAPI *api, TFindPdfModes mode, UINT Flags, LPUserFindFunct lpFunct, LPUserCreateFunct lpCreateFunct, DWORD dwData, CWnd* pParent = NULL);   // standard constructor

	CaplInstance*m_SelectedInst;

	bool		m_bAutoExecute;
	// Dialog Data
	//{{AFX_DATA(CFindPDFDlg)
	enum { IDD = IDD_FIND_PDF };
	CButton	m_create_btn;
	CaplButton	m_ok_btn;
	CaplButton	m_cancel_btn;
	CSortListCtrl	m_list_ctrl;
	CaplButton	m_find_btn;
	CString	m_sId;
	CString	m_sName;
	//}}AFX_DATA


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

	// Implementation
protected:
	bool FindPlanerPdf();
	bool FindSystemPdf();
	bool FindZonePdf();
	void ShowItems(aplExtent &ext);
	bool FindAllPKIPdfs();
	bool FindBaseSystemPdf();

	// Generated message map functions
	//{{AFX_MSG(CFindPDFDlg)
	afx_msg void OnFind();
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemchangedList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnCreate();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

