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.
11 #include "guilib/GUIDialog.h"
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
21 CGUIDialogKaiToast(void);
22 ~CGUIDialogKaiToast(void) override
;
24 enum eMessageType
{ Default
= 0, Info
, Warning
, Error
};
29 std::string description
;
30 std::string imagefile
;
32 unsigned int displayTime
;
33 unsigned int messageTime
;
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
);
44 bool OnMessage(CGUIMessage
& message
) override
;
45 void FrameMove() override
;
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
);
53 unsigned int m_toastDisplayTime
;
54 unsigned int m_toastMessageTime
;
56 static TOASTQUEUE m_notifications
;
57 static CCriticalSection m_critical
;