/* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. */

#pragma once
#include "afxcmn.h"
#include "afxwin.h"

// ListDicomDlg dialog

class ListDicomDlg : public CDialog
{
	DECLARE_DYNAMIC(ListDicomDlg)

public:
        // Constructor to display all DICOMs from bdb. The default value of 
        // the boolean variable edit is false, those DICOMs could only be 
        // browsed. Unless, their attributes could be updated. 
	ListDicomDlg(DICOM_DBS dm_dbs, BOOL edit = false, 
            CWnd* pParent = NULL); 

        // Constructor to display a list of DICOMs. The boolean variable is 
        // defined whether attributes of those DICOMs could be edited 
	// or not.
	ListDicomDlg(DICOM_IMAGE *list, int number, DICOM_DBS dm_dbs, 
            BOOL edit, CWnd* pParent =NULL);
	virtual ~ListDicomDlg();

// Dialog Data
	enum { IDD = IDD_OPEN_ALL };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
	BOOL OnInitDialog();

	DECLARE_MESSAGE_MAP()
public:
	CListCtrl pDicomList;      // list control to display a list of 
				   // DICOMs.

private:
	DICOM_DBS m_dbs;           // Bdb database handles.
	DICOM_IMAGE *m_list;       // A list of DICOM_IMAGE.
	int m_number;              // The number of DICOMs in the list.
	BOOL m_edit;               // Whether the DICOMs could be edited.
public:
        CButton pButtonDelete;     // Delete button.
        
        // Click on items in the list control to display its attributes and
        // Image.
	afx_msg void OnNMClickDicomList(NMHDR *pNMHDR, LRESULT *pResult);
	
	// Click on the delete button to delete selected DICOMs.	
	afx_msg void OnBnClickedButtonDelete();
};
