From 9c1cb7bb2d712048f18a02441068b91d727cbcad Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sat, 23 Apr 2005 02:58:27 +0000 Subject: [project @ 2005-04-23 02:58:27 by adrianl] Query windows, desktop save protocol, confirm abort/quit when downloads in progress svn path=/import/netsurf/; revision=1679 --- utils/utils.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'utils/utils.h') diff --git a/utils/utils.h b/utils/utils.h index e005fcbf7..9bd43a2f3 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -29,6 +29,25 @@ #define max(x,y) (((x)>(y))?(x):(y)) #endif +enum query_response { + QUERY_CONTINUE, + QUERY_YES, + QUERY_NO, + QUERY_ESCAPE +}; + +typedef int query_id; + +#define QUERY_INVALID ((query_id)-1) + +typedef struct +{ + void (*confirm)(query_id id, enum query_response res, void *pw); + void (*cancel)(query_id, enum query_response res, void *pw); + void (*escape)(query_id, enum query_response res, void *pw); +} query_callback; + + char * strip(char * const s); int whitespace(const char * str); char * squash_whitespace(const char * s); @@ -45,6 +64,8 @@ char *human_friendly_bytesize(unsigned long bytesize); /* Platform specific functions */ void die(const char * const error); void warn_user(const char *warning, const char *detail); +query_id query_user(const char *query, const char *detail, const query_callback *cb, void *pw); +void query_close(query_id); const char *local_encoding_name(void); #endif -- cgit v1.2.3