mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 05:47:57 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
35
components/loadinglistener/loadinglistener.hpp
Normal file
35
components/loadinglistener/loadinglistener.hpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#ifndef COMPONENTS_LOADINGLISTENER_H
|
||||
#define COMPONENTS_LOADINGLISTENER_H
|
||||
|
||||
namespace Loading
|
||||
{
|
||||
class Listener
|
||||
{
|
||||
public:
|
||||
virtual void setLabel (const std::string& label) = 0;
|
||||
|
||||
// Use ScopedLoad instead of using these directly
|
||||
virtual void loadingOn() = 0;
|
||||
virtual void loadingOff() = 0;
|
||||
|
||||
/// Indicate that some progress has been made, without specifying how much
|
||||
virtual void indicateProgress () = 0;
|
||||
|
||||
virtual void setProgressRange (size_t range) = 0;
|
||||
virtual void setProgress (size_t value) = 0;
|
||||
virtual void increaseProgress (size_t increase) = 0;
|
||||
|
||||
/// Indicate the scene is now ready to be shown
|
||||
virtual void removeWallpaper() = 0;
|
||||
};
|
||||
|
||||
// Used for stopping a loading sequence when the object goes out of scope
|
||||
struct ScopedLoad
|
||||
{
|
||||
ScopedLoad(Listener* l) : mListener(l) { mListener->loadingOn(); }
|
||||
~ScopedLoad() { mListener->loadingOff(); }
|
||||
Listener* mListener;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue