#ifndef __simplefeature_export_dlg_H
#define __simplefeature_export_dlg_H

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
    #pragma interface "simplefeature_export_dlg.h"
#endif

// Include wxWidgets' headers
#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif
#include "wx/arrstr.h"
#include <wx/grid.h>

//---------------------------------------------------------------------
#include "saga_api/saga_api.h"
#include "saga_gui/saga_frame.h"
#include "pgsql/pg_menu_db.h"
//---------------------------------------------------------------------

enum {
	ID_TEXTCTRL_SFname = 10000,
	ID_RADIOBUTTON_create_pk,
	ID_RADIOBUTTON_Select_pk_column,
	ID_TEXTCTRL_PK_ColName,
	ID_CHOICE_PK_ColName,
	ID_COMBOBOX_srid,
	ID_COMBOBOX_srtext,
	ID_COMBOBOX_proj4text,
	ID_TEXT_label_p4t,
	// Geometry Columns
	ID_TEXT,
	ID_TEXTCTRL_catalog,
	ID_COMBO_f_schema,
	ID_TEXTCTRL_geocol,
	ID_COMBO_f_coorddim,
	ID_GRID_SRID,
	ID_ButtonSRID_p,
	ID_ButtonSRID_g,
	ID_TEXTCTRL_srid
};
//---------------------------------------------------------------------

class CSimpleFeature_export_dlg : public wxDialog
{
public:
	CSimpleFeature_export_dlg();
	CSimpleFeature_export_dlg(wxWindow *parent, wxWindowID id, const wxString &title,
							  CSG_Shapes *pShapes);
	~CSimpleFeature_export_dlg();

	//-------------------------------------------
	// GET FUNCTIONS
	//-------------------------------------------
	wxString		Get_SimpleFeatureName();
	int				Get_PK_ColNumber();
	int				Get_SRID();
	wxString		Get_TableCatalog();
	wxString		Get_TableSchema();
	wxString		Get_GeometryColumn();
	int				Get_CoordDimension();
	//-------------------------------------------

	void			Set_PotShapeName(bool bEnabled)
	{
		m_pTextCtrl_SFname->SetEditable(bEnabled);
	}

private:

	//-------------------------------------------
	// PRIVATE MEMBER VARIABLES
	//-------------------------------------------
	CSG_Shapes		*m_pShapes;
	wxString		m_potShapeName;
	//-------------------------------------------

	//-------------------------------------------
	// dialog controls
	//-------------------------------------------
	// SimpleFeature Name
	wxTextCtrl		*m_pTextCtrl_SFname;
	// Primary key
	wxRadioButton	*m_pRadioButton_create_pk;	// item6
	wxRadioButton	*m_pRadioButton_select_pk;	// item7
	wxTextCtrl		*m_pTextCtrl_pk_colname;	// item9
	wxChoice		*m_pChoice_pk_col;			// item10
	//-------------------------------------------
	// SRID
	wxGrid			*m_pGrid_SRID;
	wxTextCtrl		*m_pTextCtrl_SRID;
	wxButton		*m_pButtonSRID_p;
	wxButton		*m_pButtonSRID_g;

	//-------------------------------------------
	// Geometry Columns
	wxTextCtrl		*m_pTextCtrl_catalog;
	wxComboBox		*m_pComboBox_schema;
	wxTextCtrl		*m_pTextCtrl_geometrycolumn;
	wxComboBox		*m_pComboBox_coorddimension;

	//-------------------------------------------
	// PRIVATE MEMBER FUNCTIONS
	//-------------------------------------------
	wxString		_Get_Reduced_ShapeName(wxString &ShapeName);
	void			_CreateDLG();

	wxArrayString	_Get_PK_Column_Names(CSG_Shapes *pShapes);
	//-------------------------------------------

	// EVENT TABLE FUNCTIONS
	void			On_RadioButtonSelected_pk(wxCommandEvent& event);
	void			On_ButtonSRID_p(wxCommandEvent &event);
	void			On_ButtonSRID_g(wxCommandEvent &event);
	//-------------------------------------------

	//class Cpgdatabase	*m_pDB;

//---------------------------------------------------------------------
	DECLARE_EVENT_TABLE()
};

#endif /* __simplefeature_export_dlg_H */