plover-gtk/transactionhelper.h
author J. Ali Harlow <ali@juiblex.co.uk>
Sat Nov 15 19:04:45 2014 +0000 (2014-11-15)
changeset 24 2b9f54d14cc2
child 38 a29623b68ca2
permissions -rw-r--r--
Add GUI front-end to setup and update
     1 #ifndef __PLOVER_TRANSACTION_HELPER_H__
     2 #define __PLOVER_TRANSACTION_HELPER_H__
     3 
     4 #include <gtk/gtk.h>
     5 #include <plover/packageset.h>
     6 #include <plover/repository.h>
     7 #include <plover/transaction.h>
     8 
     9 #define PLOVER_TYPE_TRANSACTION_HELPER	plover_transaction_helper_get_type()
    10 #define PLOVER_TRANSACTION_HELPER(obj)	G_TYPE_CHECK_INSTANCE_CAST(obj,\
    11 					  PLOVER_TYPE_TRANSACTION_HELPER,\
    12 					  PloverTransactionHelper)
    13 #define PLOVER_TRANSACTION_HELPER_CLASS(klass) \
    14 					G_TYPE_CHECK_CLASS_CAST(klass,\
    15 					  PLOVER_TYPE_TRANSACTION_HELPER,\
    16 					  PloverTransactionHelperClass)
    17 #define PLOVER_IS_TRANSACTION_HELPER(obj) \
    18 					G_TYPE_CHECK_INSTANCE_TYPE(obj,\
    19 					  PLOVER_TYPE_TRANSACTION_HELPER)
    20 #define PLOVER_IS_TRANSACTION_HELPER_CLASS(klass) \
    21 					G_TYPE_CHECK_CLASS_TYPE(obj,\
    22 					  PLOVER_TYPE_TRANSACTION_HELPER)
    23 #define PLOVER_TRANSACTION_HELPER_GET_CLASS(obj) \
    24 					G_TYPE_INSTANCE_GET_CLASS(obj,\
    25 					  PLOVER_TYPE_TRANSACTION_HELPER,\
    26 					  PloverTransactionHelperClass)
    27 
    28 typedef struct _PloverTransactionHelper {
    29     GObject parent_instance;
    30     PloverPackageSet *installed;
    31     PloverRepository *upstream;
    32     PloverPackageSet *relocated_upstream;
    33     gchar *base;
    34     gchar *unsatisfied;
    35     struct comps *comps;
    36     gboolean check_vendor;
    37     gboolean report_adding_dependencies;
    38     gboolean report_removing_dependants;
    39     struct plover_vector *report_adding,*report_removing;
    40     GSList *transactions;
    41     GtkBuilder *ui;
    42     GtkAssistant *assistant;
    43     guint pulse_handler;
    44     GError *error;
    45     gchar *error_primary_text;
    46     GtkWidget *error_dialog;
    47 } PloverTransactionHelper;
    48 
    49 typedef struct _PloverTransactionHelperClass {
    50     GObjectClass parent_class;
    51 } PloverTransactionHelperClass;
    52 
    53 GType plover_transaction_helper_get_type(void);
    54 PloverTransactionHelper *plover_transaction_helper_new(GtkBuilder *ui);
    55 PloverPackageSet *
    56   plover_transaction_helper_get_installed(PloverTransactionHelper *helper);
    57 void plover_transaction_helper_set_installed(PloverTransactionHelper *helper,
    58   PloverPackageSet *installed);
    59 PloverRepository *
    60   plover_transaction_helper_get_upstream(PloverTransactionHelper *helper,
    61   GError **error);
    62 void plover_transaction_helper_set_upstream(PloverTransactionHelper *helper,
    63   PloverRepository *upstream);
    64 const char *plover_transaction_helper_get_base(PloverTransactionHelper *helper);
    65 void plover_transaction_helper_set_base(PloverTransactionHelper *helper,
    66   const char *base);
    67 struct comps *
    68   plover_transaction_helper_get_comps(PloverTransactionHelper *helper,
    69   GError **error);
    70 const char *
    71   plover_transaction_helper_get_prefix(PloverTransactionHelper *helper,
    72   GError **error);
    73 void plover_transaction_helper_set_check_vendor(PloverTransactionHelper *helper,
    74   gboolean check_vendor);
    75 const char *
    76   plover_transaction_helper_get_unsatisfied(PloverTransactionHelper *helper);
    77 gboolean
    78   plover_transaction_helper_add_transaction(PloverTransactionHelper *helper,
    79   PloverTransaction *transaction,struct plover_vector *report_packages,
    80   enum razor_install_action report_action,GError **error);
    81 struct plover_vector *plover_transaction_helper_group_get_default_packages(
    82   PloverTransactionHelper *helper,const char *group,GError **error);
    83 gboolean
    84   plover_transaction_helper_install_packages(PloverTransactionHelper *helper,
    85   struct plover_vector *packages,GError **error);
    86 gboolean
    87   plover_transaction_helper_install_group(PloverTransactionHelper *helper,
    88   const char *group,GError **error);
    89 gboolean
    90   plover_transaction_helper_remove_group(PloverTransactionHelper *helper,
    91   const char *group,GError **error);
    92 gboolean
    93   plover_transaction_helper_update(PloverTransactionHelper *helper,
    94   GError **error);
    95 gboolean plover_transaction_helper_get_visible(PloverTransactionHelper *helper);
    96 void plover_transaction_helper_present(PloverTransactionHelper *helper);
    97 const char *plover_transaction_helper_get_error(PloverTransactionHelper *helper,
    98   const GError **error);
    99 void plover_transaction_helper_set_error(PloverTransactionHelper *helper,
   100   const GError *error,const char *primary_text);
   101 
   102 #endif /* __PLOVER_TRANSACTION_HELPER_H__ */