plover-gtk/transactionhelper.h
author J. Ali Harlow <ali@juiblex.co.uk>
Thu Mar 02 11:26:00 2017 +0000 (2017-03-02)
changeset 64 b19c8e5795eb
parent 38 a29623b68ca2
child 98 71127797ca73
permissions -rw-r--r--
Release 0.5.2.53
     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 enum {
    29     PLOVER_TRANSACTION_HELPER_REPORT_INSTALL=RAZOR_INSTALL_ACTION_ADD,
    30     PLOVER_TRANSACTION_HELPER_REPORT_REMOVE=RAZOR_INSTALL_ACTION_REMOVE,
    31     PLOVER_TRANSACTION_HELPER_REPORT_UPDATE
    32 } PloverTransactionHelperReportAction;
    33 
    34 typedef struct _PloverTransactionHelper {
    35     GObject parent_instance;
    36     PloverPackageSet *alternate_installed,*installed;
    37     PloverRepository *upstream;
    38     PloverPackageSet *relocated_upstream;
    39     gchar *base;
    40     gchar *unsatisfied;
    41     struct comps *comps;
    42     gboolean check_vendor;
    43     gboolean report_adding_dependencies;
    44     gboolean report_removing_dependants;
    45     struct plover_vector *report_adding,*report_removing;
    46     GSList *transactions;
    47     GtkBuilder *ui;
    48     GtkAssistant *assistant;
    49     guint pulse_handler;
    50     GError *error;
    51     gchar *error_primary_text;
    52     GtkWidget *error_dialog;
    53 } PloverTransactionHelper;
    54 
    55 typedef struct _PloverTransactionHelperClass {
    56     GObjectClass parent_class;
    57 } PloverTransactionHelperClass;
    58 
    59 GType plover_transaction_helper_get_type(void);
    60 PloverTransactionHelper *plover_transaction_helper_new(GtkBuilder *ui);
    61 PloverPackageSet *
    62   plover_transaction_helper_get_installed(PloverTransactionHelper *helper);
    63 void plover_transaction_helper_set_installed(PloverTransactionHelper *helper,
    64   PloverPackageSet *installed);
    65 PloverRepository *
    66   plover_transaction_helper_get_upstream(PloverTransactionHelper *helper,
    67   GError **error);
    68 void plover_transaction_helper_set_upstream(PloverTransactionHelper *helper,
    69   PloverRepository *upstream);
    70 const char *plover_transaction_helper_get_base(PloverTransactionHelper *helper);
    71 void plover_transaction_helper_set_base(PloverTransactionHelper *helper,
    72   const char *base);
    73 struct comps *
    74   plover_transaction_helper_get_comps(PloverTransactionHelper *helper,
    75   GError **error);
    76 const char *
    77   plover_transaction_helper_get_prefix(PloverTransactionHelper *helper,
    78   GError **error);
    79 void plover_transaction_helper_set_check_vendor(PloverTransactionHelper *helper,
    80   gboolean check_vendor);
    81 const char *
    82   plover_transaction_helper_get_unsatisfied(PloverTransactionHelper *helper);
    83 gboolean
    84   plover_transaction_helper_add_transaction(PloverTransactionHelper *helper,
    85   PloverTransaction *transaction,struct plover_vector *report_packages,
    86   PloverTransactionHelperReportAction report_action,GError **error);
    87 struct plover_vector *plover_transaction_helper_group_get_default_packages(
    88   PloverTransactionHelper *helper,const char *group,GError **error);
    89 gboolean
    90   plover_transaction_helper_install_packages(PloverTransactionHelper *helper,
    91   struct plover_vector *packages,GError **error);
    92 gboolean
    93   plover_transaction_helper_install_group(PloverTransactionHelper *helper,
    94   const char *group,GError **error);
    95 gboolean
    96   plover_transaction_helper_remove_group(PloverTransactionHelper *helper,
    97   const char *group,GError **error);
    98 gboolean
    99   plover_transaction_helper_update(PloverTransactionHelper *helper,
   100   GError **error);
   101 gboolean plover_transaction_helper_get_visible(PloverTransactionHelper *helper);
   102 void plover_transaction_helper_present(PloverTransactionHelper *helper);
   103 const char *plover_transaction_helper_get_error(PloverTransactionHelper *helper,
   104   const GError **error);
   105 void plover_transaction_helper_set_error(PloverTransactionHelper *helper,
   106   const GError *error,const char *primary_text);
   107 
   108 #endif /* __PLOVER_TRANSACTION_HELPER_H__ */