/**********************************************************************
 *
 *   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_PLAYFIELD_HEADER
#define GTK_PLAYFIELD_HEADER

class Player;

namespace GTK_DOKO {
#include <gtk/gtkwidget.h>
  class GTK_GUI;
  // the parts of the playfield
  class Table;
  class PartySettings;
  class Reservation;
  class Gametype;
  class Genscher;
  class GenscherInfo;
  class GameFinished;
    

  // the main window
  class Playfield {
    public:
      // constructor
      Playfield(GTK_GUI* gui);
      // destructor
      ~Playfield();

      // the variables
      class GTK_GUI& gui(); // the gui
      Table& table(); // the table
      PartySettings& party_settings(); // the party settings window
      Reservation& reservation(); // the reservation window
      Gametype& gametype(); // the gametype window
      Genscher& genscher(); // the genscher window
      GenscherInfo& genscher_info(); // the genscher information window
      GameFinished& game_finished(); // the game finished window

      void party_open(); // the party is opened
      void party_start(); // the party is started
      void game_open(); // the game is opened
      void game_start(); // the game is started
      void game_finish(); // the game is finished
      void game_close(); // the game is closed
      void party_finish(); // the party is finished
      void party_close(); // the party is closed

      // updates
      void cards_update();
      void player_update(Player const& player);
      void name_update(Player const& player);

      // updates the language
      void language_update();

    protected:
      // key event
      static gboolean key_event(GtkWidget* widget, GdkEventKey* key,
				gpointer playfield);
    public:
      void key(GdkEventKey* key);

    private:
      GTK_GUI* const gui_; // the gui

      Table* table_; // the table
      PartySettings* party_settings_; // the party settings window
      Reservation* reservation_; // the reservation window
      Gametype* gametype_; // the gametype window
      Genscher* genscher_; // the genscher window
      GenscherInfo* genscher_info_; // the genscher information window
      GameFinished* game_finished_; // the game finished window

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_PLAYFIELD_HEADER
#endif // #ifdef USE_UI_GTK
