#if !defined(AFX_SHOWALERTSDLG_H__CA6F8FA1_A022_4CAF_B2A2_5F53BD64E729__INCLUDED_)
#define AFX_SHOWALERTSDLG_H__CA6F8FA1_A022_4CAF_B2A2_5F53BD64E729__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ShowAlertsDlg.h : header file
//
#include "resource.h"
#include "apl_gui.h"
#include "apl_api.h"

class CaplInstance;
class CaplAPI;

////////////////////////////////////////////////////////////////////////////
// CShowDocCopyesDlg dialog

class CShowDocCopyesDlg : public CaplResizableDialog
{
// Construction
public:
	void UpdateFilterDescr();
	bool ApplyHardCopyRevChanges(CaplInstance *doc_copy,int nItem);
	bool ChangeDocCopyState(CaplInstance *doc_copy,const TCHAR *new_state);
	bool FindDocCopyes();
	CShowDocCopyesDlg(CWnd* pParent = NULL);   // standard constructor
	~CShowDocCopyesDlg();

	CaplAPI *m_api;
	CDocCopyFilter *m_filter;
	bool m_b_filter_created;
	CSortListCtrl m_list_ctrl;
	CaplInstance *m_cur_person;
	
	aplExtent m_doc_copyes;
	bool m_read_only;
	bool m_bIsAdmin;

	void CreateItem(CaplInstance *doc_copy,const char *id=0);
	void CreateDocCopy();
	void DeleteDocCopy(CaplInstance *doc_copy,int nItem);
	bool ShowProperties(CaplInstance *doc_copy,int nItem);
	
	void UpdateListCtrl();
	void RefreshItem(int nItem);
	void SetTablesColumns();
// Dialog Data
	//{{AFX_DATA(CShowDocCopyesDlg)
	enum { IDD = IDD_SHOWDOCCOPYES_DIALOG };
	CStatic	m_border_ctrl;
	CaplButton	m_cancel_btn;
	CButton	m_filter_btn;
	CaplButton	m_go_btn;
	CaplButton	m_add_btn;
	CaplButton	m_delete_btn;
	CaplButton	m_mark_changed_btn;
	CaplButton	m_show_prop_btn;
	CListCtrl m_filter_descr_ctrl;
	//}}AFX_DATA


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

// Implementation
protected:
	// предотвращаем потерю модальности после диалога с бочками из aplSocketTransport
	CaplParentWndProcesser m_pwp;

	bool ProcessFilterBtn();

	// Generated message map functions
	//{{AFX_MSG(CShowDocCopyesDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnDblclkItem(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelChangedItem(NMHDR* pNMHDR, LRESULT* pResult); 
	afx_msg void OnFilterBtn();
	afx_msg void OnGo();
	afx_msg void OnSave();
	afx_msg void OnAddBtn();
	afx_msg void OnDeleteBtn();
	afx_msg void OnMarkChangedBtn();
	afx_msg void OnShowProppertiesBtn();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SHOWALERTSDLG_H__CA6F8FA1_A022_4CAF_B2A2_5F53BD64E729__INCLUDED_)
