CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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_CRYSTALSPACE_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 
00083   virtual void CS_GNUC_PRINTF (3, 4)
00084       SetProgressDescription (const char*, const char*, ...) { }
00085   virtual void CS_GNUC_PRINTF (3, 0)
00086       SetProgressDescriptionV (const char*, const char*, va_list) { }
00087 
00089   virtual void Step (unsigned int n = 1);
00091   virtual void Reset () { current = 0; anchor = 0; }
00093   virtual void Restart ();
00095   virtual void Abort ();
00097   virtual void Finalize ();
00098 
00100   virtual void SetTotal (int n) { total = n; Reset(); }
00102   virtual int GetTotal () const { return total; }
00104   virtual int GetCurrent () const { return current; }
00105 
00112   virtual void SetGranularity (int);
00114   virtual int GetGranularity () const { return granularity; }
00115 };
00116 
00117 #endif // __CS_CSPMETER_H__

Generated for Crystal Space by doxygen 1.4.4