1 /* 2 ** 1998-09-30 - Header file for the progress reporting module. Pretty simple. 3 */ 4 5 #if !defined PROGRESS_H 6 #define PROGRESS_H 7 8 typedef enum { PGS_CANCEL, PGS_PROCEED } PgsRes; 9 10 enum { 11 PFLG_COUNT_RECURSIVE = (1<<0), /* Count # of items recursively? */ 12 PFLG_ITEM_VISIBLE = (1<<1), /* Display progress for individual items? */ 13 PFLG_BYTE_VISIBLE = (1<<2), /* Display total byte progress? */ 14 PFLG_BUSY_MODE = (1<<10) /* Just indicate "busyness", no direct filesystem coupling. */ 15 }; 16 17 /* ----------------------------------------------------------------------------------------- */ 18 19 /* Call this to set up an operation, which is assumed to consist of doing 20 ** something to a bunch of items. 21 */ 22 extern void pgs_progress_begin(MainInfo *min, const gchar *op_name, guint32 flags); 23 24 extern GCancellable * pgs_progress_get_cancellable(void); 25 26 /* Use these calls to report the progress of each item. */ 27 extern void pgs_progress_item_begin(MainInfo *min, const gchar *name, off_t size); 28 extern void pgs_progress_item_resize(MainInfo *min, off_t new_size); 29 extern PgsRes pgs_progress_item_update(MainInfo *min, off_t pos); 30 extern void pgs_progress_item_end(MainInfo *min); 31 32 /* Call this when the operation as a whole has completed. */ 33 extern void pgs_progress_end(MainInfo *min); 34 35 #endif /* PROGRESS_H */ 36