~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to src/pipeline-ui.h

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/*
 
3
 * pipeline-ui.h: 
 
4
 *
 
5
 * Contact:
 
6
 *   Moonlight List (moonlight-list@lists.ximian.com)
 
7
 *
 
8
 * Copyright 2007 Novell, Inc. (http://www.novell.com)
 
9
 *
 
10
 * See the LICENSE file included with the distribution for details.
 
11
 */
 
12
 
 
13
#ifndef __MOON_PIPELINE_UI_H__
 
14
#define __MOON_PIPELINE_UI_H__
 
15
 
 
16
#include <gtk/gtkwidget.h>
 
17
#include <gtk/gtk.h>
 
18
#include <glib.h>
 
19
 
 
20
#include "downloader.h"
 
21
#include "runtime.h"
 
22
#include "moonlightconfiguration.h"
 
23
 
 
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;
 
39
        
 
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;
 
52
        
 
53
        static void ResponseEventHandler (GtkDialog *dialog, gint response, gpointer data);
 
54
        void ResponseEvent (GtkDialog *dialog, GtkResponseType response);
 
55
 
 
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);
 
59
 
 
60
        void DownloadProgressChanged (EventObject *sender, EventArgs *args);
 
61
        void DownloadCompleted (EventObject *sender, EventArgs *args);
 
62
        void DownloadFailed (EventObject *sender, EventArgs *args);
 
63
 
 
64
        void CreateDownloader ();
 
65
        void DestroyDownloader ();
 
66
 
 
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 ();
 
73
 
 
74
        void AcceptClicked ();
 
75
        void Close (); // Closes the window and unrefs ourself
 
76
        void Show ();// Shows the codec installation ui and refs ourself
 
77
        
 
78
        CodecDownloader (Surface *surface);
 
79
        virtual ~CodecDownloader ();
 
80
 
 
81
 
 
82
public:
 
83
        static void ShowUI (Surface *surface); 
 
84
};
 
85
 
 
86
#endif /* __MOON_PIPELINE_UI_H__ */