/**********************************************************************
 *
 *   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_LAST_TRICK_HEADER
#define GTK_LAST_TRICK_HEADER

#include "table.dialog.h"

#include "../../basistypes.h"

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

  class LastTrick : public TableDialog {
    public:
      // Constructor
      LastTrick(class Table* table);

      // initializes the window
      void init();

      // update all
      void update();
      // update the cards
      void cards_update();
      // update the language
      void language_update();

      void show(); // show the window
      void close(); // hide the window

    private:
      // event for the previous trick
      static void previous_event(GtkWidget*, gpointer full_trick);
      // event for the next trick
      static void next_event(GtkWidget*, gpointer full_trick);

    public:
      // set the trick to be seen to 'trickno'
      unsigned trickno_set(unsigned const trickno);
      unsigned trickno() const;

      bool previous(); // show the previous trick
      bool next(); // show the next trick
      bool first(); // show the first trick
      bool last(); // show the last trick

    protected:
      // key event
      void key(GdkEventKey* key);

    private:
      GameStatus game_status_old; // the old game_status
      unsigned trickno_p; // number of the trick

      GtkWidget* container; // the container with the top elements

      GtkWidget* card_table; // the table with the cards
      vector<GtkWidget*> card; // the cards
      GtkWidget* startplayer; // the startplayer of the trick
      GtkWidget* winner; // the winner of the trick
      GtkWidget* extrapoints; // the extrapoints of the trick

      GtkWidget* navigation_container; // container for the navigation buttons
      GtkWidget* previous_button; // button for the previous trick
      GtkWidget* next_button; // button for the next trick

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_LAST_TRICK_HEADER
#endif // #ifdef USE_UI_GTK
