gloox  1.0.28
event.h
1 /*
2  Copyright (c) 2008-2023 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef EVENT_H__
15 #define EVENT_H__
16 
17 namespace gloox
18 {
19 
20  class Stanza;
21 
28  class Event
29  {
30 
31  public:
35  enum EventType
36  {
39  PingError
40  };
41 
46  Event( EventType type ) : m_eventType( type ), m_stanza( 0 ) {}
47 
53  Event( EventType type, const Stanza& stanza ) : m_eventType( type ), m_stanza( &stanza ) {}
54 
58  virtual ~Event() {}
59 
64  EventType eventType() const { return m_eventType; }
65 
71  const Stanza* stanza() const { return m_stanza; }
72 
73  protected:
74  EventType m_eventType;
75  const Stanza* m_stanza;
76 
77  };
78 
79 }
80 
81 #endif // EVENT_H__
A base class for events.
Definition: event.h:29
Event(EventType type, const Stanza &stanza)
Definition: event.h:53
@ PingError
Definition: event.h:39
@ PingPong
Definition: event.h:38
@ PingPing
Definition: event.h:37
Event(EventType type)
Definition: event.h:46
const Stanza * stanza() const
Definition: event.h:71
virtual ~Event()
Definition: event.h:58
EventType eventType() const
Definition: event.h:64
This is the base class for XMPP stanza abstractions.
Definition: stanza.h:34
The namespace for the gloox library.
Definition: adhoc.cpp:28