| 1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
|---|
| 2 | /* |
|---|
| 3 | * Copyright (C) 2000 Eazel, Inc |
|---|
| 4 | * |
|---|
| 5 | * This program is free software; you can redistribute it and/or |
|---|
| 6 | * modify it under the terms of the GNU General Public License as |
|---|
| 7 | * published by the Free Software Foundation; either version 2 of the |
|---|
| 8 | * License, or (at your option) any later version. |
|---|
| 9 | * |
|---|
| 10 | * This program is distributed in the hope that it will be useful, |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | * General Public License for more details. |
|---|
| 14 | * |
|---|
| 15 | * You should have received a copy of the GNU General Public |
|---|
| 16 | * License along with this program; if not, write to the |
|---|
| 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|---|
| 18 | * Boston, MA 02111-1307, USA. |
|---|
| 19 | * |
|---|
| 20 | * Authors: J Shane Culpepper |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | #ifndef NAUTILUS_SERVICE_INSTALL_VIEW_H |
|---|
| 24 | #define NAUTILUS_SERVICE_INSTALL_VIEW_H |
|---|
| 25 | |
|---|
| 26 | #include <libnautilus/nautilus-view.h> |
|---|
| 27 | #include <gtk/gtk.h> |
|---|
| 28 | #include <eazel-package-system-types.h> |
|---|
| 29 | #include <eazel-install-corba-types.h> |
|---|
| 30 | #include <eazel-install-corba-callback.h> |
|---|
| 31 | #include <eazel-install-problem.h> |
|---|
| 32 | #include "libtrilobite/libtrilobite.h" |
|---|
| 33 | |
|---|
| 34 | typedef struct _NautilusServiceInstallView NautilusServiceInstallView; |
|---|
| 35 | typedef struct _NautilusServiceInstallViewClass NautilusServiceInstallViewClass; |
|---|
| 36 | |
|---|
| 37 | #define NAUTILUS_TYPE_SERVICE_INSTALL_VIEW (nautilus_service_install_view_get_type ()) |
|---|
| 38 | #define NAUTILUS_SERVICE_INSTALL_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NautilusServiceInstallView)) |
|---|
| 39 | #define NAUTILUS_SERVICE_INSTALL_VIEW_CLASS (klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NautilusServiceInstallViewClass)) |
|---|
| 40 | #define NAUTILUS_IS_SERVICE_INSTALL_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW)) |
|---|
| 41 | #define NAUTILUS_IS_SERVICE_INSTALL_VIEW_CLASS (klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW)) |
|---|
| 42 | |
|---|
| 43 | typedef struct _NautilusServiceInstallViewDetails NautilusServiceInstallViewDetails; |
|---|
| 44 | |
|---|
| 45 | struct _NautilusServiceInstallView { |
|---|
| 46 | GtkEventBox parent; |
|---|
| 47 | NautilusServiceInstallViewDetails *details; |
|---|
| 48 | }; |
|---|
| 49 | |
|---|
| 50 | struct _NautilusServiceInstallViewClass { |
|---|
| 51 | GtkVBoxClass parent_class; |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | typedef struct { |
|---|
| 55 | char *package_name; |
|---|
| 56 | GtkWidget *label; |
|---|
| 57 | GtkWidget *progress_bar; |
|---|
| 58 | GtkWidget *progress_label; |
|---|
| 59 | GtkWidget *vbox; /* [ progress_bar, progress_label ] */ |
|---|
| 60 | GtkWidget *hbox; /* [ label, padding, vbox ] */ |
|---|
| 61 | GtkWidget *line; |
|---|
| 62 | } InstallMessage; |
|---|
| 63 | |
|---|
| 64 | /* A NautilusContentView's private information. */ |
|---|
| 65 | struct _NautilusServiceInstallViewDetails { |
|---|
| 66 | char *uri; |
|---|
| 67 | NautilusView *nautilus_view; |
|---|
| 68 | GtkWidget *form; |
|---|
| 69 | GtkWidget *form_title; |
|---|
| 70 | GtkWidget *package_name; |
|---|
| 71 | GtkWidget *package_details; |
|---|
| 72 | GtkWidget *package_summary; |
|---|
| 73 | GtkWidget *package_version; |
|---|
| 74 | GtkWidget *total_progress_bar; |
|---|
| 75 | GtkWidget *overall_feedback_text; |
|---|
| 76 | GtkWidget *message_box; |
|---|
| 77 | GtkWidget *current_feedback_text; |
|---|
| 78 | InstallMessage *current_im; |
|---|
| 79 | GtkWidget *pane; |
|---|
| 80 | GtkWidget *middle_title; |
|---|
| 81 | |
|---|
| 82 | char *current_rpm; |
|---|
| 83 | int current_package; |
|---|
| 84 | char *remembered_password; |
|---|
| 85 | int password_attempts; |
|---|
| 86 | guint cylon_timer; |
|---|
| 87 | int using_local_file; |
|---|
| 88 | gboolean failure; |
|---|
| 89 | gboolean cancelled; |
|---|
| 90 | gboolean already_installed; |
|---|
| 91 | int last_k; /* used to avoid flickering the KB count so much */ |
|---|
| 92 | gboolean cancelled_before_downloads; |
|---|
| 93 | unsigned long download_bytes_total; |
|---|
| 94 | unsigned long download_bytes_sofar; |
|---|
| 95 | char *username; |
|---|
| 96 | |
|---|
| 97 | EazelInstallCallback *installer; |
|---|
| 98 | EazelInstallProblem *problem; |
|---|
| 99 | TrilobiteRootClient *root_client; |
|---|
| 100 | GList *categories; |
|---|
| 101 | |
|---|
| 102 | gboolean core_package; |
|---|
| 103 | |
|---|
| 104 | GList *problem_cases; |
|---|
| 105 | GList *desktop_files; |
|---|
| 106 | |
|---|
| 107 | GList *message; /* GList<InstallMessage *> */ |
|---|
| 108 | GHashTable *deps; /* package(char *) => package that needs it(char *) */ |
|---|
| 109 | }; |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | /* GtkObject support */ |
|---|
| 113 | GtkType nautilus_service_install_view_get_type (void); |
|---|
| 114 | |
|---|
| 115 | /* Component embedding support */ |
|---|
| 116 | NautilusView *nautilus_service_install_view_get_nautilus_view (NautilusServiceInstallView *view); |
|---|
| 117 | |
|---|
| 118 | /* URI handling */ |
|---|
| 119 | void nautilus_service_install_view_load_uri (NautilusServiceInstallView *view, |
|---|
| 120 | const char *uri); |
|---|
| 121 | |
|---|
| 122 | #endif /* NAUTILUS_SERVICE_INSTALL_VIEW_H */ |
|---|
| 123 | |
|---|