1 #ifndef NOTIFICATIONMANAGER_H
2 #define NOTIFICATIONMANAGER_H
3 
4 
5 #include "../utils/uievents.h"
6 #include "../utils/globalevents.h"
7 #include "../utils/mixins.hh"
8 #include <lslutils/globalsmanager.h>
9 #include <wx/timer.h>
10 #include <wx/event.h>
11 #include <vector>
12 
13 class INotification;
14 
15 class NotificationManager : public SL::NonCopyable, public wxEvtHandler, public GlobalEvent
16 {
17     public:
18         virtual ~NotificationManager();
19 
20 		void OnShowNotification( UiEvents::NotficationData data );
21 
22 		void OnQuit( wxCommandEvent& data );
23 
24     protected:
25         NotificationManager();
26 		INotification* m_notification_wrapper;
27 
28 		wxTimer m_rate_limit_timer;
29 		const unsigned int m_rate_limit_ms;
30 		typedef std::vector<UiEvents::NotficationData>
31 			EventDataBuffer;
32 		EventDataBuffer m_eventDataBuffer;
33 
34 		void OnTimer( wxTimerEvent& /*event*/ );
35 		void ShowNotification( const UiEvents::NotficationData& data );
36 
37         //make globals holder have access to ctor
38         template <class PB, class I >
39         friend class LSL::Util::GlobalObjectHolder;
40 
41 		EventReceiverFunc< NotificationManager, UiEvents::NotficationData, &NotificationManager::OnShowNotification> m_showNotificationSink;
42 
43 		DECLARE_EVENT_TABLE()
44 
45 };
46 
47 NotificationManager& notificationManager();
48 
49 #endif // NOTIFICATIONMANAGER_H
50 
51 /**
52 	This file is part of SpringLobby,
53 	Copyright (C) 2007-2011
54 
55 	SpringLobby is free software: you can redistribute it and/or modify
56 	it under the terms of the GNU General Public License version 2 as published by
57 	the Free Software Foundation.
58 
59 	SpringLobby is distributed in the hope that it will be useful,
60 	but WITHOUT ANY WARRANTY; without even the implied warranty of
61 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
62 	GNU General Public License for more details.
63 
64 	You should have received a copy of the GNU General Public License
65 	along with SpringLobby.  If not, see <http://www.gnu.org/licenses/>.
66 **/
67 
68