//-----------------------------------------------------------------------------
#ifndef DeviceListCtrlH
#define DeviceListCtrlH DeviceListCtrlH
//-----------------------------------------------------------------------------
#include "wx/listctrl.h"

class DeviceConfigureFrame;
class LogOutputHandlerDlg;

//-----------------------------------------------------------------------------
/// \brief IDs for the menu commands
enum
//-----------------------------------------------------------------------------
{
	LIST_ABOUT = wxID_ABOUT,
	LIST_QUIT = wxID_EXIT,
	LIST_LIST_VIEW = wxID_HIGHEST,
	LIST_ICON_VIEW,
	LIST_ICON_TEXT_VIEW,
	LIST_SMALL_ICON_VIEW,
	LIST_SMALL_ICON_TEXT_VIEW,
	LIST_REPORT_VIEW,
	LIST_VIRTUAL_VIEW,
	LIST_SMALL_VIRTUAL_VIEW,
	LIST_DESELECT_ALL,
	LIST_SELECT_ALL,
	LIST_DELETE_ALL,
	LIST_DELETE,
	LIST_ADD,
	LIST_EDIT,
	LIST_SORT,
	LIST_SET_FG_COL,
	LIST_SET_BG_COL,
	LIST_TOGGLE_MULTI_SEL,
	LIST_TOGGLE_FIRST,
	LIST_SHOW_COL_INFO,
	LIST_SHOW_SEL_INFO,
	LIST_FOCUS_LAST,
	LIST_FREEZE,
	LIST_THAW,
	LIST_TOGGLE_LINES,
	LIST_CTRL = 1000
};

//-----------------------------------------------------------------------------
enum
//-----------------------------------------------------------------------------
{
	LIST_SET_ID = LIST_CTRL + 1,
	LIST_UPDATE_FW,
	LIST_UPDATE_KERNEL_DRIVER
};

//-----------------------------------------------------------------------------
enum TListColumn
//-----------------------------------------------------------------------------
{
	lcFamily,
	lcProduct,
	lcSerial,
	lcState,
	lcFWVersion,
	lcKernelDriver,
	lcDeviceID,
	lcLAST_COLUMN
};

//-----------------------------------------------------------------------------
class DeviceListCtrl: public wxListCtrl
//-----------------------------------------------------------------------------
{
public:
	DeviceListCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style, DeviceConfigureFrame* pParentFrame );
	void OnActivated( wxListEvent& event );
	void OnColClick( wxListEvent& event );
	void OnSelected( wxListEvent& event );
	void OnDeselected( wxListEvent& event );
	void OnItemRightClick( wxListEvent& event );
	void OnSetID( wxCommandEvent& event );
	void OnUpdateFirmware( wxCommandEvent& event );
	void OnUpdateKernelDriver( wxCommandEvent& event );
	int  GetCurrentItemIndex( void ) const { return m_selectedItemID; }
private:
	DeviceConfigureFrame*	m_pParentFrame;
	int						m_selectedItemID;

	DECLARE_NO_COPY_CLASS(DeviceListCtrl)
	DECLARE_EVENT_TABLE()
};

//-----------------------------------------------------------------------------
enum
//-----------------------------------------------------------------------------
{
	LIST_CONFIGURE = LIST_CTRL + 1,
	LIST_ADD_ROW
};

//-----------------------------------------------------------------------------
enum TLogListColumn
//-----------------------------------------------------------------------------
{
	llcSectionName,
	llcDevicesUsingThisSection,
	llcFlags,
	llcOutputMask,
	llcOutputFile,
	llcClearFile,
	llcStylesheet,
	llcLAST_COLUMN
};

//-----------------------------------------------------------------------------
class LogOutputListCtrl: public wxListCtrl
//-----------------------------------------------------------------------------
{
public:
	LogOutputListCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style, LogOutputHandlerDlg* pParent );
	void OnColClick( wxListEvent& event );
	void OnSelected( wxListEvent& event );
	void OnDeselected( wxListEvent& event );
	void OnItemRightClick( wxListEvent& event );
	void OnColumnRightClick( wxListEvent& event );
	void OnModifyItem( wxCommandEvent& event );
	void OnAddItem( wxCommandEvent& event );
	void OnDeleteItem( wxCommandEvent& event );
	void OnDeleteAll( wxCommandEvent& event );
	void ShowPopup( wxListEvent& event );
	int  GetCurrentItemIndex( void ) const { return m_selectedItemID; }
private:
	LogOutputHandlerDlg*	m_pParent;
	int						m_selectedItemID;

	DECLARE_NO_COPY_CLASS(LogOutputListCtrl)
	DECLARE_EVENT_TABLE()
};

#endif // DeviceListCtrlH

