OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadinglistener.hpp
Go to the documentation of this file.
1 #ifndef COMPONENTS_LOADINGLISTENER_H
2 #define COMPONENTS_LOADINGLISTENER_H
3 
4 #include <string>
5 
6 namespace Loading
7 {
8  class Listener
9  {
10  public:
17  virtual void setLabel (const std::string& label, bool important=false) {}
18 
23  virtual void loadingOn() {}
24  virtual void loadingOff() {}
25 
27  virtual void setProgressRange (size_t range) {}
29  virtual void setProgress (size_t value) {}
31  virtual void increaseProgress (size_t increase = 1) {}
32  };
33 
35  struct ScopedLoad
36  {
40  };
41 }
42 
43 #endif
virtual void loadingOff()
Definition: loadinglistener.hpp:24
Listener * mListener
Definition: loadinglistener.hpp:39
virtual void setProgress(size_t value)
Set current progress. Valid range is [0, progressRange)
Definition: loadinglistener.hpp:29
Used for stopping a loading sequence when the object goes out of scope.
Definition: loadinglistener.hpp:35
virtual void setProgressRange(size_t range)
Set the total range of progress (e.g. the number of objects to load).
Definition: loadinglistener.hpp:27
Definition: loadinglistener.hpp:8
~ScopedLoad()
Definition: loadinglistener.hpp:38
ScopedLoad(Listener *l)
Definition: loadinglistener.hpp:37
virtual void loadingOn()
Definition: loadinglistener.hpp:23
virtual void setLabel(const std::string &label, bool important=false)
Definition: loadinglistener.hpp:17
virtual void increaseProgress(size_t increase=1)
Increase current progress, default by 1.
Definition: loadinglistener.hpp:31