forked from mirror/openmw-tes3mp
		
	The progress is not particularly accurate. It simply uses the current / total number of records written/read as indication. Cell records are currently the largest by far, but there is a good chance that could be optimized using a change tracking system.
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #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 = 1) = 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
 |