[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / dialogs / GUIDialogKaiToast.h
blob78f29198efca7346ae62d81728d1e65d855fec0e
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "guilib/GUIDialog.h"
13 #include <queue>
15 #define TOAST_DISPLAY_TIME 5000L // default 5 seconds
16 #define TOAST_MESSAGE_TIME 1000L // minimal message time 1 second
18 class CGUIDialogKaiToast: public CGUIDialog
20 public:
21 CGUIDialogKaiToast(void);
22 ~CGUIDialogKaiToast(void) override;
24 enum eMessageType { Default = 0, Info, Warning, Error };
26 struct Notification
28 std::string caption;
29 std::string description;
30 std::string imagefile;
31 eMessageType eType;
32 unsigned int displayTime;
33 unsigned int messageTime;
34 bool withSound;
37 typedef std::queue<Notification> TOASTQUEUE;
39 static void QueueNotification(eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
40 static void QueueNotification(const std::string& aCaption, const std::string& aDescription);
41 static void QueueNotification(const std::string& aImageFile, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
42 bool DoWork();
44 bool OnMessage(CGUIMessage& message) override;
45 void FrameMove() override;
46 void ResetTimer();
48 protected:
49 static void AddToQueue(const std::string& aImageFile, const eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime);
51 unsigned int m_timer;
53 unsigned int m_toastDisplayTime;
54 unsigned int m_toastMessageTime;
56 static TOASTQUEUE m_notifications;
57 static CCriticalSection m_critical;