/*   GPDriver source gpd_gui.h
 *   $Id: gpd_gui.h 1.6 2004/04/29 12:20:08 root Exp root $
 *
 *   GPDriver - gimp-print based printer spooler for RISC OS
 *   Copyright (C) 2004 Martin Wuerthner
 *
 *   This program is free software; you can redistribute it and/or modify it
 *   under the terms of the GNU General Public License as published by the Free
 *   Software Foundation; either version 2 of the License, or (at your option)
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful, but
 *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 *   for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *   Martin Wuerthner <ro-printing@mw-software.com>
 *   Mannheimer Str. 18, 67655 Kaiserslautern, Germany
 */

#include "oslib/os.h"

/* The user interface functions are chosen in such a way that a command-line
   implementation is possible as well.
 */

/* initialise the user interface, return 1 for success, 0 for failure */
extern int gui_init(void);
/* show an informational message in one of the two fields */
extern void gui_inform(const char* msg, int field);
/* as above, but substitute %d by the given integer parameter */
extern void gui_inform_d(const char* msg, int n, int field);
/* as above, but substitute two integer parameters */
extern void gui_inform_dd(const char* msg, int n1, int n2, int field);
/* set up the slider */
extern void gui_progress_start(void);
/* display a message about which page is printed */
extern void gui_progress_page(int page, int pages);
/* update the slider (and percentage message if necessary) */
extern void gui_progress_row(int row, int rows);
/* terminate the program */
extern void gui_progress_end(int keep_open);
/* display an OS error in a suitable way */
void gui_error(os_error* err);
/* display a textual error in a suitable way */
void gui_error2(const char* msg);
/* as above, but substitute %d by the given number */
void gui_error2_d(const char* msg, int n);
/* display an OS in a suitable way, preferably in a Wimp error box */
void gui_wimp_error(os_error* err);
/* as above, but substitute %d by the given integer parameter */
extern void gui_wimp_error_d(const char* msg, int n);
/* display a textual error in a suitable way, preferably in a Wimp error box */
void gui_wimp_error2(const char* msg);
/* as above, but subsitute %s by the given string */
void gui_error_c(const char* msg, const char* s);
/* display an error box if err is not NULL and return err */
os_error* gui_complain(os_error* err);
/* as gui_error but exit the program */
void gui_fatal_error(os_error* err);
/* as above but with a textual error */
void gui_fatal_error2(const char* msg);
void gui_log_msg(const char* msg, int priority);
/* look up a token in the Messages file */
const char* gui_lookup(const char* token);
/* returns a non-zero value if the user has clicked on Abort
   (to be checked after gui_error()) */
int gui_aborted(void);
/* set the number of pages to be printed */
void gui_set_pages(int pp);
/* set the current page number (starting from 1) */
void gui_set_page(int cp);
/* update the number of pages that have been printed */
void gui_set_pages_printed(int pp);
/* to be called to exit the program, passing the return code */
extern void gui_closedown(int code);
