Add infos into target window
[ryzomcore.git] / ryzom / client / src / progress.h
blob69e9901d439d019bae6479bf29768c3f47aa0733
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef CL_PROGRESS_H
22 #define CL_PROGRESS_H
24 #include "nel/misc/types_nl.h"
25 #include "nel/misc/progress_callback.h"
27 #include "nel/misc/event_listener.h"
30 namespace NL3D
32 class UTextureFile;
37 #define PROGRESS_BAR_BORDER 0
38 #define PROGRESS_BAR_LEFT 0.25f
39 #define PROGRESS_BAR_TOP 0.09f
40 #define PROGRESS_BAR_WIDTH (1.f-2.f*PROGRESS_BAR_LEFT)
41 #define PROGRESS_BAR_HEIGHT 0.02f
42 #define PROGRESS_BAR_UPDATE 200
43 #define PROGRESS_BAR_BORDER_COLOR (CRGBA (255, 255, 255))
44 #define PROGRESS_BAR_COLOR (CRGBA (224, 200, 157))
45 #define PROGRESS_BAR_BG_COLOR (CRGBA (224/4, 200/4, 157/4))
48 // ***************************************************************************
49 // Client progress class
50 class CProgress : public NLMISC::IProgressCallback,
51 public NLMISC::IEventListener
53 public:
55 CProgress ();
56 virtual ~CProgress();
58 void release();
60 // Update the progress bar
61 virtual void progress (float value);
63 // Reset the root progress bar
64 void reset (uint rootNodeCount);
66 // Finish the progress bar
67 void finish ();
69 // New message
70 void newMessage (const std::string& message);
72 void setFontFactor(float f);
74 // display some custom text messages(text defined in client.cfg)
75 bool ApplyTextCommands;
77 // Set teleport specific message
78 void setTPMessages(const std::string &tpReason, const std::string &tpCancelText, const std::string &iconName);
80 bool getTPCancelFlag(bool clearFlag = true);
82 private:
84 // Internal progress
85 void internalProgress (float value);
87 // Display a text to describe what is the application going to do.
88 // this function can be call even if texture is NULL, driver or textcontext not initialised
89 std::string _ProgressMessage;
91 // Time since last update
92 sint64 _LastUpdate;
94 float _FontFactor;
95 uint _CurrentRootStep;
96 uint _RootStepCount;
98 std::string _TPReason;
99 std::string _TPCancelText;
101 bool _TPCancelFlag;
103 protected:
104 // from IEventListener
105 virtual void operator ()(const NLMISC::CEvent& event);
110 #endif // CL_PROGRESS_H
112 /* End of progress.h */