/**********************************************************************
 *
 *   FreeDoko a Doppelkopf-Game
 *    
 *   Copyright (C) 2001-2004  by Diether Knof and Borg Enders
 *
 *   This program is free software; you can redistribute it and/or 
 *   modify it under the terms of the GNU General Public License as 
 *   published by the Free Software Foundation; either version 2 of 
 *   the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT 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 can find this license in the file 'gpl.txt'.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 *   MA  02111-1307  USA
 *
 *  Contact:
 *    Diether Knof dknof@gmx.de
 *    Borg Enders  borg@borgsoft.de
 *
 **********************************************************************/

#ifdef USE_UI_GTK
#ifndef GTK_RESERVATION_HEADER
#define GTK_RESERVATION_HEADER

#include "widget.h"
#include "playfield.dialog.h"

#include "../../game/reservation.h"
class Player;

namespace GTK_DOKO {
#include <gtk/gtkwidget.h>

  class Reservation : public PlayfieldDialog {
    public:
      // constructor
      Reservation(class Playfield* playfield);

      // initialize the reservation
      void init();

      // update the sensitivity
      void sensitivity_update(Player const& player);

      // get the reservation
      ::Reservation get(Player const& player);

      // preset the reservation
      void preset(Player const& player);

      // set the reservation
      ::Reservation& set(Player const& player, ::Reservation& reservation);

      // the widget for the rule
      XGtkRadioButton& button(GameType const& type);
      // the widget for the rule
      XGtkRadioButton& button(MarriageSelector const& type);


    protected:
      static void change_game_type_event(GtkWidget* button, gpointer game_type);
      static void marriage_toggle_event(GtkWidget*, gpointer reservation);

    public:
      void marriage_toggle();

    public:
      void language_update(); // update the language

    private:
      GtkWidget* notebook;
      XGtkLabel bookmark_default;
      XGtkLabel bookmark_solo;

      vector<XGtkRadioButton*> game_type_p;
      vector<XGtkRadioButton*> marriage_selector_p;
      XGtkCheckButton swines;
      XGtkCheckButton hyperswines;

    private: // not to be used
      Reservation();
      Reservation(Reservation const&);
      Reservation& operator=(Reservation const&);
  }; // class Reservation : public PlayfieldDialog 

} // namespace GTK_DOKO

#endif // #ifndef GTK_RESERVATION_HEADER
#endif // #ifdef USE_UI_GTK
