2009-11-08 Chris Toshok <toshok@ximian.com>
[moon.git] / src / pipeline-ui.h
blob246bd9be1cde7a3e71702b95355a4f24f813d1cf
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * pipeline-ui.h:
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
13 #ifndef __MOON_PIPELINE_UI_H__
14 #define __MOON_PIPELINE_UI_H__
16 #include <gtk/gtkwidget.h>
17 #include <gtk/gtk.h>
18 #include <glib.h>
20 #include "downloader.h"
21 #include "runtime.h"
22 #include "moonlightconfiguration.h"
24 class CodecDownloader : public EventObject {
25 private:
26 static bool running; // If there already is another CodecDownloader running
27 Surface *surface;
28 // 0: initial, waiting for user input
29 // 1: install clicked, downloading eula
30 // 2: eula downloaded, waiting for user input
31 // 3: accept clicked, downloading codec
32 // 4: codecs downloaded
33 // 5: user clicked don't install (or that value was read from the configuration)
34 // 6: something went wrong (download failed for instance)
35 int state;
36 char *eula;
37 Downloader *dl;
38 MoonlightConfiguration configuration;
40 GtkWidget *dialog;
41 GtkWidget *vbox;
42 GtkWidget *header_label;
43 GtkWidget *message_label;
44 GtkWidget *progress_bar;
45 GtkWidget *eula_scrollwindow;
46 GtkWidget *eula_view;
47 GtkWidget *eula_evtbox;
48 GtkWidget *accept_button;
49 GtkWidget *cancel_button;
50 GtkWidget *icon;
51 GtkWidget *dont_ask;
53 static void ResponseEventHandler (GtkDialog *dialog, gint response, gpointer data);
54 void ResponseEvent (GtkDialog *dialog, GtkResponseType response);
56 static void DownloadProgressChangedHandler (EventObject *sender, EventArgs *args, gpointer closure);
57 static void DownloadCompletedHandler (EventObject *sender, EventArgs *args, gpointer closure);
58 static void DownloadFailedHandler (EventObject *sender, EventArgs *args, gpointer closure);
60 void DownloadProgressChanged (EventObject *sender, EventArgs *args);
61 void DownloadCompleted (EventObject *sender, EventArgs *args);
62 void DownloadFailed (EventObject *sender, EventArgs *args);
64 void CreateDownloader ();
65 void DestroyDownloader ();
67 void ToggleEula (bool show);
68 void ToggleProgress (bool show);
69 void SetHeader (const gchar *message);
70 void SetMessage (const gchar *message);
71 void HideMessage ();
72 void AdaptToParentWindow ();
74 void AcceptClicked ();
75 void Close (); // Closes the window and unrefs ourself
76 void Show ();// Shows the codec installation ui and refs ourself
78 bool VerifyDownload (const char *filename);
80 CodecDownloader (Surface *surface);
81 virtual ~CodecDownloader ();
84 public:
85 static void ShowUI (Surface *surface);
88 #endif /* __MOON_PIPELINE_UI_H__ */