/*
 * What an operation's worker (archive.c's, on its thread) may ask of
 * ops.c: where it has got to, what failed, a question for the user.
 */
#ifndef OPS_H
#define OPS_H

#include "files.h"

struct op;

GCancellable *op_cancellable(struct op *op);
bool op_cancelled(struct op *op);
void op_set_total(struct op *op, gint64 total);
void op_set_done(struct op *op, gint64 done);
gint64 op_get_done(struct op *op);
/* The name of what is in hand */
void op_set_current(struct op *op, const char *name);
/* Goes in the "couldn't be done" list at the end */
void op_fail(struct op *op, const char *name, const char *why);
/* Bytes in file and all under it; counts the op's files as it goes */
gint64 op_measure(struct op *op, GFile *file);
void op_item_done(struct op *op);
/* Waits for the user to type name's password (again: the last one was
 * wrong). NULL if they gave up; else to free */
char *op_ask_password(struct op *op, const char *name, bool again);
/* What came of it, for the window to select */
void op_made(struct op *op, GFile *file);

/* archive.c: the workers */
void arc_extract(struct op *op, GFile *archive, GFile *into, gint64 base);
void arc_compress(struct op *op, GList *files, GFile *dest,
	enum arc_format format);

#endif
