/**********************************************************************
 *
 *   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_BUG_REPORT_HEADER
#define GTK_BUG_REPORT_HEADER

#include "dialog.h"

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

  class BugReport : public Dialog {
    public:
      // Constructor
      BugReport(class GTK_GUI* gui_a);

      // initializes the window
      void init();

      // a game has been opened
      void game_open();
      // a game has been closed
      void game_close();

      // update the button 'save on desktop'
      void save_on_desktop_update();
      // update the language
      void language_update();

      // event for resetting the bug report
      static void reset_event(GtkWidget*, gpointer bug_report);
      // event for sending the bug report
      static void send_event(GtkWidget*, gpointer bug_report);
      // open the file select box
      static void open_selector_event(GtkWidget*, gpointer bug_report);
      // load the selected bug report
      static void load_event(GtkWidget*, gpointer bug_report);
      // save on desktop 
      static void save_on_desktop_toggled_event(GtkWidget*, gpointer bug_report);

      // reset 
      void reset();
      // send the bug report
      void send();
      // open the file select box
      void open_selector();
      // load the selected bug report
      void load();
      // the button 'save on desktop' has been toggled
      void save_on_desktop_toggled();

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

    private:
      GtkWidget* information; // the information
      GtkWidget* file; // the file
      GtkWidget* save_on_desktop; // checkbox where to save the bug report
    public:
      GtkWidget* selector; // the file select box
    private:
      GtkWidget* text; // the text
      GtkWidget* save; // button for saving the bug report
      GtkWidget* cancel; // button for canceling the bug report

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_BUG_REPORT_HEADER
#endif // #ifdef USE_UI_GTK
