#ifndef __WB_MYSQL_TABLE_EDITOR_INSERT_PAGE_H__
#define __WB_MYSQL_TABLE_EDITOR_INSERT_PAGE_H__

#include "grt/tree_model.h"

class MySQLTableEditorBE;
class MGGladeXML;
class ListModelWrapper;
class DbMySQLTableEditor;

//==============================================================================
//
//==============================================================================
class DbMySQLTableEditorInsertPage
{
  public:
    DbMySQLTableEditorInsertPage(DbMySQLTableEditor *owner, MySQLTableEditorBE* be, MGGladeXML* xml);

    void refresh();
    
    void switch_be(MySQLTableEditorBE* be);  
  private:
    DbMySQLTableEditor                       *_owner;
    MySQLTableEditorBE                       *_be;
    MGGladeXML                               *_xml;

    void open_editor();
    void update_editor();
    void get_cell_value(const Gtk::TreeModel::iterator& iter, int column, Glib::ValueBase& value);
    void set_cell_value(const Gtk::TreeModel::iterator& iter, int column, const Glib::ValueBase& value);
    bool window_delete_event(GdkEventAny* event);
    void ok_click();
  
    void editor_key_pressed(GdkEventKey *ev);
  
    Glib::RefPtr<ListModelWrapper>            _inserts_model;
    Gtk::Window                              *_editor_window;
    Gtk::TreeView                            *_inserts_tv;
};

#endif
