/**********************************************************************
 *
 *   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_DIALOG_HEADER
#define GTK_DIALOG_HEADER

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

  class Dialog {
    public:
      // Constructor
      Dialog(class GTK_GUI* const gui, string const& title = "");

      // Destructor
      virtual ~Dialog();

      // initializes the window
      virtual void init();

      // the variables
      class GTK_GUI& gui(); // the gui
      GtkWidget* window(); // the window

      // sets the title
      virtual string& title_set(string const& title);

      // update the language
      virtual void language_update();

      // event for showing the window
      static void show_event(GtkWidget*, gpointer dialog);
      // event for closing the window
      static void hide_event(GtkWidget*, gpointer dialog);
      // event for deleting the window
      static gboolean delete_event(GtkWidget*, GdkEvent*, gpointer dialog);
      // event for toggeling the window
      static void toggle_event(GtkWidget*, gpointer dialog);

      virtual void show(); // show the window
      virtual void close(); // close the window
      virtual void toggle(); // toggle the appearance of the window

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

    private:
      class GTK_GUI* const gui_; // the gui

      string title; // title of the window

      GtkWidget* window_; // the window

    protected:
      GtkWidget* button_close; // the close-button

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

} // namespace GTK_DOKO

#endif // #ifndef GTK_DIALOG_HEADER
#endif // #ifdef USE_UI_GTK
