/*****************************************************************************

        GRAOUMF TRACKER 2
        Author: Laurent de Soras, 1996-2016

--- Legal stuff ---

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

*****************************************************************************/



#if defined (ProgressBox_CURRENT_HEADER)
	#error Inclusion recursive du header ProgressBox.
#endif
#define	ProgressBox_CURRENT_HEADER

#if ! defined (ProgressBox_HEADER_INCLUDED)
#define	ProgressBox_HEADER_INCLUDED



/*\\\ INCLUDES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#include	<time.h>

#include	"base_ct.h"



/*\\\ TYPES & STRUCTURES PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/



/*\\\ DEFINITION DE LA CLASSE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

class	ProgressBox
{



/*\\\ CONSTANTES PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

public:



/*\\\ PROTOTYPES DES METHODES PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

public:
ProgressBox (const char *title_0);
~ProgressBox (void);
signed int	check_ok (void) const;
void		self_display (void) const;

signed int	manage (const volatile long *total_ptr,
                    const volatile long *position_ptr,
                    const volatile bool *active_flag_ptr,
                    volatile bool *cancel_flag_ptr);
void		redraw (void);
void		refresh (bool force_flag = true);
void		print_time (int rsc_obj, long nbr_sec);



/*\\\ ATTRIBUTS PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

public:



/*\\\ VARIABLES DE CLASSE PUBLIQUES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

public:
static ProgressBox	*displayed_progress_box_ptr;



/*\\\ CONSTANTES PRIVEES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

private:



/*\\\ PROTOTYPES DES METHODES PRIVEES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

private:



/*\\\ ATTRIBUTS PRIVEES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

private:
char *_title_0;
const volatile long *_total_ptr;
const volatile long *_position_ptr;
const volatile bool *_active_flag_ptr;
volatile bool *_cancel_flag_ptr;

clock_t	_start_time;
int		_pix_width;
int		_pix_height;
int		_pix_xpos;
int		_pix_ypos;
int		_old_bar_size;
int		_total_bar_size;
signed int	_old_percentage;


	
/*\\\ VARIABLES DE CLASSE PRIVEES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

private:



/*\\\ PROTOTYPES DES METHODES INTERDITES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

private:
ProgressBox (void);
ProgressBox (const ProgressBox &other);
void	operator = (const ProgressBox &other);

};	// Fin de la definition de la classe



/*\\\ FIN DU FICHIER \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#endif

#undef ProgressBox_CURRENT_HEADER
