/** -*- Mode: C++; tab-width: 4 -*-
 * vim: sw=4:ts=4:
 *
 * Gnome Apt package installation handler
 *
 * 	(C) 1998 Havoc Pennington <hp@pobox.com>
 * 	    2003 Filip Van Raemdonck <mechanix@debian.org>
 *
 * 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 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
 *
 * 	$Id$
 *
 **/

#ifndef GNOME_APT_CHILD_PROCESS_H
#define GNOME_APT_CHILD_PROCESS_H

#include <gtk/gtkwidget.h>

class ChildDialog {
public:
  
  ChildDialog(const char* title,
              const char* label);
  ~ChildDialog();

  int fork();

  // Parent should so this, child should exec() or whatever;
  // return false if the child died abnormally
  //  or close was clicked.
  bool run();

private:
  GtkWidget* dialog_;
  GtkWidget* term_;
  GtkWidget* label_;
  bool we_are_parent_;

  bool child_done_;
  bool close_anyway_;

  static void child_died_cb(GtkWidget* w, gpointer data);
  void child_died();

  static gint close_cb(GtkWidget* w, gpointer data);
  gint close();
};

#endif
