]>
vaikene.ee Git - evaf/blob - Common/eventqueue.h
2 * @file Common/eventqueue.h
3 * @brief Event queue interface implementation
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __COMMON_EVENTQUEUE_H
21 #define __COMMON_EVENTQUEUE_H
23 #include "ieventqueue.h"
37 * iEventQueue interface implementation
39 class EventQueue
: public iEventQueue
47 virtual ~EventQueue();
50 virtual bool event(QEvent
* e
);
56 virtual uint
registerEvent(QString
const & name
);
58 virtual uint
queryEvent(QString
const & name
) const;
60 virtual void unregisterEvent(uint id
);
62 virtual uint
subscribeEvent(uint id
, QObject
* obj
);
64 virtual void unsubscribeEvent(uint id
, QObject
* obj
);
66 virtual void broadcastEvent(Event
* event
);
71 /// ID of the next event
74 /// List of registered events
75 QHash
<uint
, QString
> mEvents
;
77 /// List of subscribers
78 QHash
<uint
, QList
<QPointer
<QObject
> > > mSubscribers
;
82 } // namespace evaf::Common::Internal
83 } // namespace eVaf::Common
86 #endif // eventqueue.h