2016-07-11 11:14:58 -04:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Toast : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Toast();
|
|
|
|
~Toast();
|
2016-08-15 10:40:30 -04:00
|
|
|
|
2016-09-16 05:04:28 -04:00
|
|
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
2016-11-25 07:00:48 -05:00
|
|
|
const char* getName() { return "Toast"; };
|
2016-08-15 10:40:30 -04:00
|
|
|
#endif
|
2016-07-11 11:14:58 -04:00
|
|
|
|
|
|
|
static void Show(std::string image, std::string title, std::string description, int length);
|
|
|
|
|
|
|
|
private:
|
|
|
|
class UIToast
|
|
|
|
{
|
|
|
|
public:
|
2016-11-20 08:09:07 -05:00
|
|
|
std::string image;
|
|
|
|
std::string title;
|
|
|
|
std::string desc;
|
|
|
|
int length;
|
|
|
|
int start;
|
2016-07-11 11:14:58 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
static void Handler();
|
|
|
|
static void Draw(UIToast* toast);
|
|
|
|
|
|
|
|
static std::queue<UIToast> Queue;
|
|
|
|
static std::mutex Mutex;
|
|
|
|
};
|
|
|
|
}
|