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
// 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)
38
MoonlightConfiguration configuration;
42
GtkWidget *header_label;
43
GtkWidget *message_label;
44
GtkWidget *progress_bar;
45
GtkWidget *eula_scrollwindow;
47
GtkWidget *eula_evtbox;
48
GtkWidget *accept_button;
49
GtkWidget *cancel_button;
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);
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
CodecDownloader (Surface *surface);
79
virtual ~CodecDownloader ();
83
static void ShowUI (Surface *surface);
86
#endif /* __MOON_PIPELINE_UI_H__ */