/**********************************************************************
 *
 *   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_GTKMM

#ifndef GTKMM_BUG_REPORT_REPLAY_HEADER
#define GTKMM_BUG_REPORT_REPLAY_HEADER

#include "base.h"
#include "widgets/sticky_dialog.h"
#include "../../os/os.h"

#include "../../party/party.h"
#include "../../party/rule.h"

#include <stack>
using std::stack;

#include <gtkmm/treemodel.h>
namespace Gtk {
  class Label;
  class TextView;
} // namespace Gtk

class Trick;

namespace UI_GTKMM_NS {

  /**
   **
   ** @brief	the bug report that is replayed
   **
   ** Note, this class gets the information directly over the OS,
   ** the functions must not be called by UI_GTKMM.
   ** In 'Ui_Wrap' this class must be inserted behind '::bug_report_replay'.
   **
   ** @author	Diether Knof
   **
   **/
  class BugReportReplay : public Base, public Gtk::StickyDialog, public OS {

    public:
    BugReportReplay(Base* const parent);
    ~BugReportReplay();

    void party_open(Party const& party);
    void party_get_settings();

    void game_open(Game const& game);
    void game_redistribute();
#ifdef POSTPHONED
    void game_start();

    void trick_open(::Trick const& trick);
    // the card is played
    void card_played(HandCard const& card);

    // an announcement is made
    void announcement_made(Announcement const& announcement,
			   Player const& player);
    // the player has swines
    void swines_announced(Player const& player);
    // the player has hyperswines
    void hyperswines_announced(Player const& player);

    // the marriage partner has found a bride
    void marriage(Player const& bridegroom, Player const& bride);
    // a player has announced a genscher
    void genscher(Player const& genscher, Player const& partner);
#endif

    // a bug report replay is opened
    void bug_report_replay_open(OS_NS::BugReportReplay const&
				bug_report_replay);
    // the bug report replay is closed
    void bug_report_replay_close();

    private:
    void init();

    void update_info();

    void end_bug_report();

    public:
    void name_changed(Player const& player);

    private:
    OS_NS::BugReportReplay const* bug_report_replay;

    Gtk::Label* version;
    Gtk::Label* compiled;
    Gtk::Label* system;
    Gtk::Label* time;
    Gtk::Label* language;
    Gtk::Label* trick;
    Gtk::TextView* message;

    Gtk::Label* seed;
    Gtk::Label* startplayer;
    Gtk::Label* soloplayer;
    // rules
    // players
    // game_replay (tricks)
    // hands
    // gamepoints
    // human_actions;

    private: // unused
    BugReportReplay();
    BugReportReplay(BugReportReplay const&);
    BugReportReplay& operator=(BugReportReplay const&);
  }; // class BugReportReplay : public Base, public Gtk::StickyDialog, public OS

} // namespace UI_GTKMM_NS

#endif // #ifdef GTKMM_BUG_REPORT_REPLAY_HEADER

#endif // #ifdef USE_UI_GTKMM
