------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008, 2009 Vadim Godunko <vgodunko@gmail.com>                --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3266 $ $Date: 2009-04-18 13:27:41 +0400 (Sat, 18 Apr 2009) $
------------------------------------------------------------------------------
private with Qt4.Dialog_Button_Boxes;
with Qt4.Dialogs;
private with Qt4.Dialogs.Directors;
private with Qt4.Push_Buttons;
with Qt4.Sql_Databases;
private with Qt4.Sql_Table_Models;
with Qt4.Strings;
with Qt4.Widgets;

package Table_Editors is

   type Table_Editor is limited new Qt4.Dialogs.Q_Dialog with private;

   type Table_Editor_Access is access all Table_Editor'Class;

   function Create
    (DB         : Qt4.Sql_Databases.Q_Sql_Database;
     Table_Name : Qt4.Strings.Q_String;
     Parent     : access Qt4.Widgets.Q_Widget'Class := null)
       return not null Table_Editor_Access;

private

   type Table_Editor is
     new Qt4.Dialogs.Directors.Q_Dialog_Director with record
      Submit_Button : Qt4.Push_Buttons.Q_Push_Button_Access;
      Revert_Button : Qt4.Push_Buttons.Q_Push_Button_Access;
      Quit_Button   : Qt4.Push_Buttons.Q_Push_Button_Access;
      Button_Box    : Qt4.Dialog_Button_Boxes.Q_Dialog_Button_Box_Access;
      Model         : Qt4.Sql_Table_Models.Q_Sql_Table_Model_Access;
   end record;

   procedure Submit (Self : not null access Table_Editor'Class);
   pragma Q_Slot (Submit, "submit()");

end Table_Editors;
