#ifndef __GDAM_LAUNCH_SERVER_DIALOG_H_
#define __GDAM_LAUNCH_SERVER_DIALOG_H_

typedef struct _GdamLaunchServerDialog GdamLaunchServerDialog;

/*
 *
 *     +--------------------------------------------------+
 *     | Sorry... no connection to the gdam-server could  |
 *     | be established.                                  |
 *     |                                                  |
 *     | What do shall I do?                              |
 *     |                                                  |
 *     |  Run server securely.         [X]                |
 *     |  Run server insecurely.       [X]                |
 *     |  Exit instead.                [X]                |
 *     |                                                  |
 *     | Server configuration:                            |
 *     |  Server port:     [6003]                         |
 *     |  Server options:  [.................]            |
 *     |                                                  |
 *     | Shall I save these settings?                     |
 *     |    Don't save the settings I chose.    [X]       |
 *     |    Save the settings I chose, but      [X]       |
 *     |       bring this dialog up again.                |
 *     |    Save the settings I chose, and      [X]       |
 *     |       don't show this dialog again.              |
 *     |                                                  |
 *     | +-----+  +-----+          +-------------------+  |
 *     | | Ok  |  |Exit |          | Save Settings Now |  |
 *     | +-----+  +-----+          +-------------------+  |
 *     +--------------------------------------------------+
 */

#include <gtk/gtkwidget.h>
#include <gdam/client/gdamchannel.h>

struct _GdamLaunchServerDialog {
	GtkWidget*		toplevel;

	GtkWidget*		main_vbox;

 	/* "Sorry... no connection to the gdam-server
	 *  could be established." */
	GtkWidget*		title_text;

	/* Table containing "Run server {in,}securely / exit" option */
	GtkWidget*		action_table;

	GtkWidget*		run_securely_radio;
	GtkWidget*		run_insecurely_radio;

	/* "Server Configuration:" */
	GtkWidget*		server_conf_label;

 	GtkWidget*		server_conf_table;
	GtkWidget*		server_port_label;
	GtkWidget*		server_options_label;
	GtkWidget*		server_port_entry;
	GtkWidget*		server_options_entry;

	/* "Shall I save these settings?" */
	GtkWidget*		save_settings_label;

	GtkWidget*		save_settings_table;

	GtkWidget*		dont_save_settings_radio;
	GtkWidget*		save_settings_radio;
	GtkWidget*		use_settings_radio;

	GtkWidget*		lower_vbox;
	GtkWidget*		ok_button;
	GtkWidget*		exit_button;
	GtkWidget*		save_settings_now_button;

	/* The channel to launch the server for. */
	GdamChannel*		channel;

	/* callbacks for when the server is launched. */
	GHookFunc		on_launch_func;
	gpointer		on_launch_data;
	GDestroyNotify		on_launch_destroy;
};

GdamLaunchServerDialog*
gdam_launch_server_dialog_run(GdamChannel*   channel,
                              GHookFunc      on_launch,
			      gpointer       on_launch_data,
			      GDestroyNotify on_launch_destroy);

#endif
