1 /* vi:set et ai sw=2 sts=2 ts=2: */ 2 /*- 3 * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> 4 * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __THUNAR_JOB_H__ 23 #define __THUNAR_JOB_H__ 24 25 #include <gio/gio.h> 26 27 #include <exo/exo.h> 28 29 #include <thunar/thunar-enum-types.h> 30 #include <thunar/thunar-file.h> 31 32 G_BEGIN_DECLS 33 34 typedef struct _ThunarJobPrivate ThunarJobPrivate; 35 typedef struct _ThunarJobClass ThunarJobClass; 36 typedef struct _ThunarJob ThunarJob; 37 38 #define THUNAR_TYPE_JOB (thunar_job_get_type ()) 39 #define THUNAR_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TYPE_JOB, ThunarJob)) 40 #define THUNAR_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TYPE_JOB, ThunarJobClass)) 41 #define THUNAR_IS_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TYPE_JOB)) 42 #define THUNAR_IS_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TYPE_JOB)) 43 #define THUNAR_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TYPE_JOB, ThunarJobClass)) 44 45 struct _ThunarJobClass 46 { 47 /*< private >*/ 48 ExoJobClass __parent__; 49 50 /*< public >*/ 51 52 /* signals */ 53 ThunarJobResponse (*ask) (ThunarJob *job, 54 const gchar *message, 55 ThunarJobResponse choices); 56 ThunarJobResponse (*ask_replace) (ThunarJob *job, 57 ThunarFile *source_file, 58 ThunarFile *target_file); 59 }; 60 61 struct _ThunarJob 62 { 63 /*< private >*/ 64 ExoJob __parent__; 65 ThunarJobPrivate *priv; 66 }; 67 68 GType thunar_job_get_type (void) G_GNUC_CONST; 69 void thunar_job_set_total_files (ThunarJob *job, 70 GList *total_files); 71 void thunar_job_set_pausable (ThunarJob *job, 72 gboolean pausable); 73 gboolean thunar_job_is_pausable (ThunarJob *job); 74 void thunar_job_pause (ThunarJob *job); 75 void thunar_job_resume (ThunarJob *job); 76 void thunar_job_freeze (ThunarJob *job); 77 void thunar_job_unfreeze (ThunarJob *job); 78 gboolean thunar_job_is_paused (ThunarJob *job); 79 gboolean thunar_job_is_frozen (ThunarJob *job); 80 void thunar_job_processing_file (ThunarJob *job, 81 GList *current_file, 82 guint n_processed); 83 84 ThunarJobResponse thunar_job_ask_create (ThunarJob *job, 85 const gchar *format, 86 ...); 87 ThunarJobResponse thunar_job_ask_overwrite (ThunarJob *job, 88 const gchar *format, 89 ...); 90 ThunarJobResponse thunar_job_ask_delete (ThunarJob *job, 91 const gchar *format, 92 ...); 93 ThunarJobResponse thunar_job_ask_replace (ThunarJob *job, 94 GFile *source_path, 95 GFile *target_path, 96 GError **error); 97 ThunarJobResponse thunar_job_ask_skip (ThunarJob *job, 98 const gchar *format, 99 ...); 100 gboolean thunar_job_ask_no_size (ThunarJob *job, 101 const gchar *format, 102 ...); 103 gboolean thunar_job_files_ready (ThunarJob *job, 104 GList *file_list); 105 void thunar_job_new_files (ThunarJob *job, 106 const GList *file_list); 107 GList * thunar_job_ask_jobs (ThunarJob *job); 108 109 G_END_DECLS 110 111 #endif /* !__THUNAR_JOB_H__ */ 112