gloox  1.0.1
event.h
1 /*
2  Copyright (c) 2008-2012 by Jakob Schroeter <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  {
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__