#if !defined(AFX_LISTDIALOG_H__6BC917F1_2CFC_4D0B_A9E6_168B778DC5D3__INCLUDED_)
#define AFX_LISTDIALOG_H__6BC917F1_2CFC_4D0B_A9E6_168B778DC5D3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ListDialog.h : header file
//
#include "resource.h"
#include "aplNetStepData.h"
#include "apl_gui.h"
#include "common.h"

#include "ResizableDialog.h"
#include "afxwin.h"
class CaplWorkFlowManager;
class CaplAPI;
/////////////////////////////////////////////////////////////////////////////
// CListDialog dialog

class CListDialog : public CaplResizableDialog
{
// Construction
public:
	BOOL m_bReadOnly;
	void ShowTPInList(aplExtent &items);
	void ShowWOInList(aplExtent &items);
	CListDialog(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CListDialog)
	enum { IDD = IDD_LIST_DIALOG };
	CaplButton	m_showSchemaBtn;
	CaplButton	m_addBtn;
	CaplButton	m_propBtn;
	CaplButton	m_deleteBtn;
	CaplButton	m_okBtn;
	CaplButton	m_cancelBtn;
	CButton	m_loadBtn;
	CButton	m_viewBtn;
	CSortListCtrl	m_itemsList;
	CEdit	m_nameCtrl;
	CString	m_sName;
	//}}AFX_DATA
	CImageList m_imageList;
	CString m_sTitle;
	CString m_sItemsType;
	int m_index;

	aplExtent* m_items;	//существующие элементы: прототипы или объекты
	
	aplExtent m_newItems; //новые (добавленные элементы)
	aplExtent m_delItems; //удаленные элементы
	
	CStringArray m_fileItems;//новый файлы
	CTaskInfoArray m_taskItems;//новые прототипы
	
	CaplAPI *m_api;
	CaplWorkFlowManager* m_wf_mgr;

	CaplInstance* m_curSelItem;
	CaplInstance* m_process;
	CaplInstance* m_proc_tmpl;
	CaplInstance* m_prototype;
	
	aplExtent m_activities;

public:
	CString GetTypeName(CaplInstance* inst);
	
private:
	void DeleteTaskProt();
	void DeleteWorkObject();
	void AddTaskProt();
	void AddWorkObject();
	void ShowProperties();
	void AddFile();
	
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CListDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
public:
	// Generated message map functions
	//{{AFX_MSG(CListDialog)
	afx_msg void OnItemchangedItemsList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclkItemsList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnAddButton();
	afx_msg void OnPropButton();
	afx_msg void OnDeleteButton();
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	afx_msg void OnLoadButton();
	afx_msg void OnViewButton();
	virtual void OnCancel();
	afx_msg void OnShowSchema();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	afx_msg void OnBnClickedGetDlit();
	CaplButton m_get_glit_btn;
	CaplButton m_clear_isp_btn;
	afx_msg void OnBnClickedClearIsp();
};

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

#endif // !defined(AFX_LISTDIALOG_H__6BC917F1_2CFC_4D0B_A9E6_168B778DC5D3__INCLUDED_)
