status.hh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #ifndef I4_STATUS_HH
  9. #define I4_STATUS_HH
  10. #include "arch.hh"
  11. class i4_const_str;
  12. class i4_status_class
  13. {
  14. public:
  15. virtual i4_bool update(float percent) = 0; // percent should be 0..1, ret false for cancel
  16. virtual ~i4_status_class() { ; }
  17. };
  18. enum { I4_STATUS_ALLOW_CANCEL=1,
  19. I4_STATUS_UNKNOWN_TOTAL=2 };
  20. // this is operating system dependant
  21. i4_status_class *i4_create_status(const i4_const_str &description, int flags=0);
  22. typedef i4_status_class *(*i4_status_create_function_type)(const i4_const_str &description,
  23. int flags=0);
  24. void i4_set_status_create_function(i4_status_create_function_type fun);
  25. class i4_idle_class
  26. {
  27. public:
  28. static i4_idle_class *first;
  29. i4_idle_class *next;
  30. virtual void idle() = 0;
  31. i4_idle_class();
  32. virtual ~i4_idle_class();
  33. };
  34. #endif