/**********************************************************************
 *
 *   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_PARTY_POINTS_HEADER
#define GTK_PARTY_POINTS_HEADER

#include "table.dialog.h"

#include "game_summary.h"

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

  class PartyPoints : public TableDialog {
    public:
      // Constructor
      PartyPoints(class Table* table_a);

      // initializes the window
      void init();

      // the variables
      class Table& table(); // the table

      void party_start(); // the party is started - write the remaining points
      void game_finish(); // the game is finished - add a line to the list
      void party_close(); // the party is closed - clear the list

      void names_update(); // update the player names

      void language_update(); // update the language

    protected:
      // select a row
      static void select_row_event(GtkWidget*, gint row, gint, GdkEvent*,
				   gpointer party_points);
      // unselect a row
      static void unselect_row_event(GtkWidget*, gint row, gint, GdkEvent*,
				     gpointer party_points);

    public:
      void game_select(unsigned const gameno); // select the game
      void game_unselect(unsigned const gameno); // select the game

      void key(GdkEventKey* key);

    private:
      GtkWidget* scrollbar; // the scrollbar to scroll the list
      GtkWidget* pointlist; // the list with the points
      GtkWidget* sum; // the sum of the points

      GameSummary game_summary; // the game summary

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_PARTY_POINTS_HEADER
#endif // #ifdef USE_UI_GTK
