1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
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>
20 #include "downloader.h"
22 #include "moonlightconfiguration.h"
24 class CodecDownloader
: public EventObject
{
26 static bool running
; // If there already is another CodecDownloader running
28 bool is_user_initiated
;
29 // 0: initial, waiting for user input
30 // 1: install clicked, downloading eula
31 // 2: eula downloaded, waiting for user input
32 // 3: accept clicked, downloading codec
33 // 4: codecs downloaded
34 // 5: user clicked don't install (or that value was read from the configuration)
35 // 6: something went wrong (download failed for instance)
39 MoonlightConfiguration configuration
;
43 GtkWidget
*header_label
;
44 GtkWidget
*message_label
;
45 GtkWidget
*progress_bar
;
46 GtkWidget
*eula_scrollwindow
;
48 GtkWidget
*eula_evtbox
;
49 GtkWidget
*accept_button
;
50 GtkWidget
*cancel_button
;
54 static void ResponseEventHandler (GtkDialog
*dialog
, gint response
, gpointer data
);
55 void ResponseEvent (GtkDialog
*dialog
, GtkResponseType response
);
57 static void DownloadProgressChangedHandler (EventObject
*sender
, EventArgs
*args
, gpointer closure
);
58 static void DownloadCompletedHandler (EventObject
*sender
, EventArgs
*args
, gpointer closure
);
59 static void DownloadFailedHandler (EventObject
*sender
, EventArgs
*args
, gpointer closure
);
61 void DownloadProgressChanged (EventObject
*sender
, EventArgs
*args
);
62 void DownloadCompleted (EventObject
*sender
, EventArgs
*args
);
63 void DownloadFailed (EventObject
*sender
, EventArgs
*args
);
65 void CreateDownloader ();
66 void DestroyDownloader ();
68 void ToggleEula (bool show
);
69 void ToggleProgress (bool show
);
70 void SetHeader (const gchar
*message
);
71 void SetMessage (const gchar
*message
);
73 void AdaptToParentWindow ();
75 void AcceptClicked ();
76 void Close (); // Closes the window and unrefs ourself
77 void Show ();// Shows the codec installation ui and refs ourself
79 bool VerifyDownload (const char *filename
);
81 CodecDownloader (Surface
*surface
, bool is_user_initiated
);
82 virtual ~CodecDownloader ();
86 static void ShowUI (Surface
*surface
, bool is_user_initiated
);
89 #endif /* __MOON_PIPELINE_UI_H__ */