csutil/cspmeter.h
00001 /* 00002 Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> 00003 Writen by Eric Sunshine <sunshine@sunshineco.com> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_CSPMETER_H__ 00021 #define __CS_CSPMETER_H__ 00022 00023 #include "csextern.h" 00024 #include "ivaria/pmeter.h" 00025 00026 struct iConsoleOutput; 00027 00050 class CS_CSUTIL_EXPORT csTextProgressMeter : public iProgressMeter 00051 { 00052 private: 00053 iConsoleOutput* console; 00054 int granularity; 00055 int tick_scale; 00056 int total; 00057 int current; 00058 int anchor; 00059 00060 public: 00062 csTextProgressMeter (iConsoleOutput* console, int total = 100); 00064 virtual ~csTextProgressMeter (); 00065 00072 void SetTickScale (int); 00074 int GetTickScale () const { return tick_scale; } 00075 00076 SCF_DECLARE_IBASE; 00077 00082 virtual void CS_GNUC_PRINTF (3, 4) 00083 SetProgressDescription (const char*, const char*, ...) { } 00084 virtual void CS_GNUC_PRINTF (3, 0) 00085 SetProgressDescriptionV (const char*, const char*, va_list) { } 00086 00088 virtual void Step (); 00090 virtual void Reset () { current = 0; anchor = 0; } 00092 virtual void Restart (); 00094 virtual void Abort (); 00096 virtual void Finalize (); 00097 00099 virtual void SetTotal (int n) { total = n; Reset(); } 00101 virtual int GetTotal () const { return total; } 00103 virtual int GetCurrent () const { return current; } 00104 00111 virtual void SetGranularity (int); 00113 virtual int GetGranularity () const { return granularity; } 00114 }; 00115 00116 #endif // __CS_CSPMETER_H__
Generated for Crystal Space by doxygen 1.2.18