4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
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 General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include "guilib/GUIDialog.h"
27 #define TOAST_DISPLAY_TIME 5000L // default 5 seconds
28 #define TOAST_MESSAGE_TIME 1000L // minimal message time 1 second
30 class CGUIDialogKaiToast: public CGUIDialog
33 CGUIDialogKaiToast(void);
34 virtual ~CGUIDialogKaiToast(void);
36 enum eMessageType { Default = 0, Info, Warning, Error };
41 CStdString description;
44 unsigned int displayTime;
45 unsigned int messageTime;
49 typedef std::queue<Notification> TOASTQUEUE;
51 static void QueueNotification(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
52 static void QueueNotification(const CStdString& aCaption, const CStdString& aDescription);
53 static void QueueNotification(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
56 virtual bool OnMessage(CGUIMessage& message);
57 virtual void OnWindowLoaded();
58 virtual void FrameMove();
62 static void AddToQueue(const CStdString& aImageFile, const eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime);
66 unsigned int m_toastDisplayTime;
67 unsigned int m_toastMessageTime;
69 CStdString m_defaultIcon;
71 static TOASTQUEUE m_notifications;
72 static CCriticalSection m_critical;