1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    GUIEvent.h
11 /// @author  Daniel Krajzewicz
12 /// @date    Sept 2002
13 /// @version $Id$
14 ///
15 // Definition of an own event class
16 /****************************************************************************/
17 #ifndef GUIEvent_h
18 #define GUIEvent_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <utils/foxtools/FXThreadEvent.h>
27 #include <utils/foxtools/FXBaseObject.h>
28 #include <fx.h>
29 
30 
31 /**
32  * As events are distinguished by their number, here is the enumeration
33  * of our custom events
34  */
35 enum GUIEventType {
36     /// @brief send when a simulation has been loaded
37     EVENT_SIMULATION_LOADED,
38 
39     /// @brief send when a simulation step has been performed
40     EVENT_SIMULATION_STEP,
41 
42     /// @brief send when a message occured
43     EVENT_MESSAGE_OCCURRED,
44 
45     /// @brief send when a warning occured
46     EVENT_WARNING_OCCURRED,
47 
48     /// @brief send when a error occured
49     EVENT_ERROR_OCCURRED,
50 
51     /// @brief send when a debug occured
52     EVENT_DEBUG_OCCURRED,
53 
54     /// @brief send when a gldebug occured
55     EVENT_GLDEBUG_OCCURRED,
56 
57     /// @brief send when a status change occured
58     EVENT_STATUS_OCCURRED,
59 
60     /**@brief Send when the simulation is over;
61      * @note The reason and the time step are stored within the event
62     */
63     EVENT_SIMULATION_ENDED,
64 
65     /// @brief End of events list; use this to define new
66     EVENT_END
67 };
68 
69 
70 // ===========================================================================
71 // class definitions
72 // ===========================================================================
73 /**
74  * GUIEvent
75  *
76  */
77 class GUIEvent {
78 public:
79     /// @brief returns the event type
getOwnType()80     GUIEventType getOwnType() const {
81         return myType;
82     }
83 
84     /// @brief destructor
~GUIEvent()85     virtual ~GUIEvent() { }
86 
87 protected:
88     /// @brief constructor
GUIEvent(GUIEventType ownType)89     GUIEvent(GUIEventType ownType) :
90         myType(ownType) { }
91 
92     /// @brief the type of the event
93     GUIEventType myType;
94 };
95 
96 
97 #endif
98 
99 /****************************************************************************/
100 
101