Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

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 "ivaria/pmeter.h"
00024 
00025 struct iConsoleOutput;
00026 
00049 class csTextProgressMeter : public iProgressMeter
00050 {
00051 private:
00052   iConsoleOutput* console;
00053   int granularity;
00054   int tick_scale;
00055   int total;
00056   int current;
00057   int anchor;
00058 
00059 public:
00061   csTextProgressMeter (iConsoleOutput* console, int total = 100);
00063   virtual ~csTextProgressMeter () {}
00064 
00071   void SetTickScale (int);
00073   int GetTickScale () const { return tick_scale; }
00074 
00075   SCF_DECLARE_IBASE;
00076 
00081   virtual void CS_GNUC_PRINTF (3, 4)
00082       SetProgressDescription (const char*, const char*, ...) { }
00083   virtual void CS_GNUC_PRINTF (3, 0)
00084       SetProgressDescriptionV (const char*, const char*, va_list) { }
00085 
00087   virtual void Step ();
00089   virtual void Reset () { current = 0; anchor = 0; }
00091   virtual void Restart ();
00093   virtual void Abort ();
00095   virtual void Finalize ();
00096 
00098   virtual void SetTotal (int n) { total = n; Reset(); }
00100   virtual int GetTotal () const { return total; }
00102   virtual int GetCurrent () const { return current; }
00103 
00110   virtual void SetGranularity (int);
00112   virtual int GetGranularity () const { return granularity; }
00113 };
00114 
00115 #endif // __CS_CSPMETER_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000