eVaf
event.h
Go to the documentation of this file.
1 
20 #ifndef __COMMON_EVENT_H
21 #define __COMMON_EVENT_H
22 
23 #include "libcommon.h"
24 
25 #include <QObject>
26 #include <QEvent>
27 #include <QSharedData>
28 #include <QExplicitlySharedDataPointer>
29 
30 namespace eVaf {
31 namespace Common {
32 
39 class COMMON_EXPORT Event : public QEvent
40 {
41 public:
42 
44  static QEvent::Type const eVafEvent;
45 
61  Event(uint eventId, quint32 intValue = 0, QSharedData * dataObj = 0)
62  : QEvent(eVafEvent)
63  , mId(eventId)
64  , mValue(intValue)
65  , mData(dataObj)
66  {}
67 
71  inline uint id() const { return mId; }
72 
76  inline quint32 value() const { return mValue; }
77 
85  inline QSharedData * data() const { return mData ? mData.data() : 0; }
86 
87 
88 private:
89 
91  uint mId;
92 
94  quint32 mValue;
95 
97  QExplicitlySharedDataPointer<QSharedData> mData;
98 
99 };
100 
101 } // namespace eVaf::Common
102 } // namespace eVaf
103 
104 #endif // event.h
#define COMMON_EXPORT
Definition: libcommon.h:27
Event class for all the eVaf events.
Definition: event.h:39
uint id() const
Returns the event ID value.
Definition: event.h:71
Event(uint eventId, quint32 intValue=0, QSharedData *dataObj=0)
Creates the event object.
Definition: event.h:61
quint32 value() const
Returns the 32-bit integer value.
Definition: event.h:76
QSharedData * data() const
Returns the shared data object attached to the event.
Definition: event.h:85
Global eVaf namespace.
Definition: engine.h:37
static QEvent::Type const eVafEvent
Event type for eVaf events.
Definition: event.h:44