1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- 2 3 caja-progress-info.h: file operation progress info. 4 5 Copyright (C) 2007 Red Hat, Inc. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public 18 License along with this program; if not, write to the 19 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 Boston, MA 02110-1301, USA. 21 22 Author: Alexander Larsson <alexl@redhat.com> 23 */ 24 25 #ifndef CAJA_PROGRESS_INFO_H 26 #define CAJA_PROGRESS_INFO_H 27 28 #include <glib-object.h> 29 #include <gio/gio.h> 30 31 #define CAJA_TYPE_PROGRESS_INFO (caja_progress_info_get_type ()) 32 #define CAJA_PROGRESS_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_PROGRESS_INFO, CajaProgressInfo)) 33 #define CAJA_PROGRESS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CAJA_TYPE_PROGRESS_INFO, CajaProgressInfoClass)) 34 #define CAJA_IS_PROGRESS_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_PROGRESS_INFO)) 35 #define CAJA_IS_PROGRESS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAJA_TYPE_PROGRESS_INFO)) 36 #define CAJA_PROGRESS_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAJA_TYPE_PROGRESS_INFO, CajaProgressInfoClass)) 37 38 typedef struct _CajaProgressInfo CajaProgressInfo; 39 typedef struct _CajaProgressInfoClass CajaProgressInfoClass; 40 41 GType caja_progress_info_get_type (void) G_GNUC_CONST; 42 43 /* Signals: 44 "changed" - status or details changed 45 "progress-changed" - the percentage progress changed (or we pulsed if in activity_mode 46 "started" - emited on job start 47 "finished" - emitted when job is done 48 49 All signals are emitted from idles in main loop. 50 All methods are threadsafe. 51 */ 52 53 CajaProgressInfo *caja_progress_info_new (gboolean should_start, gboolean can_pause); 54 void caja_progress_info_get_ready (CajaProgressInfo *info); 55 void caja_progress_info_disable_pause (CajaProgressInfo *info); 56 57 GList * caja_get_all_progress_info (void); 58 59 char * caja_progress_info_get_status (CajaProgressInfo *info); 60 char * caja_progress_info_get_details (CajaProgressInfo *info); 61 double caja_progress_info_get_progress (CajaProgressInfo *info); 62 GCancellable *caja_progress_info_get_cancellable (CajaProgressInfo *info); 63 void caja_progress_info_cancel (CajaProgressInfo *info); 64 gboolean caja_progress_info_get_is_started (CajaProgressInfo *info); 65 gboolean caja_progress_info_get_is_finished (CajaProgressInfo *info); 66 gboolean caja_progress_info_get_is_paused (CajaProgressInfo *info); 67 68 void caja_progress_info_start (CajaProgressInfo *info); 69 void caja_progress_info_finish (CajaProgressInfo *info); 70 void caja_progress_info_pause (CajaProgressInfo *info); 71 void caja_progress_info_resume (CajaProgressInfo *info); 72 void caja_progress_info_set_status (CajaProgressInfo *info, 73 const char *status); 74 void caja_progress_info_take_status (CajaProgressInfo *info, 75 char *status); 76 void caja_progress_info_set_details (CajaProgressInfo *info, 77 const char *details); 78 void caja_progress_info_take_details (CajaProgressInfo *info, 79 char *details); 80 void caja_progress_info_set_progress (CajaProgressInfo *info, 81 double current, 82 double total); 83 void caja_progress_info_pulse_progress (CajaProgressInfo *info); 84 85 86 #endif /* CAJA_PROGRESS_INFO_H */ 87