Garmin Fleet Management Controller  2.19.0
Event.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * Event.h
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef Event_H
11 #define Event_H
12 
13 #include "stdafx.h"
14 #include <list>
15 
16 class Event;
17 
18 #include "garmin_types.h"
19 #include "EventId.h"
20 #include "EventListener.h"
21 
22 //----------------------------------------------------------------------
34 //----------------------------------------------------------------------
35 class Event
36 {
37 public:
38  static void post
39  (
40  EventId aEventId,
41  uint32 aEventData = 0,
42  void * aEventDataPtr = NULL,
43  BOOL handleNow = FALSE
44  );
45 
46  static void addListener
47  (
48  EventListener * aListener
49  );
50 
51  static void removeListener
52  (
53  EventListener * aListener
54  );
55 
56 private:
58  static std::list<EventListener*> mListeners;
59 };
60 
61 #endif
#define FALSE
Definition: garmin_types.h:46
static void addListener(EventListener *aListener)
Adds a window that is interested in receiving events.
Definition: Event.cpp:24
EventId
Events generated by the FMI PC Application.
Definition: EventId.h:19
static std::list< EventListener * > mListeners
List of listeners that should receive event notifications.
Definition: Event.h:58
static void removeListener(EventListener *aListener)
Remove a target window from the interested object list.
Definition: Event.cpp:40
Event dispatcher.
Definition: Event.h:35
unsigned long int uint32
32-bit unsigned integer
Definition: garmin_types.h:66
Base class for objects that take action in response to an Event being posted.
Definition: EventListener.h:24
static void post(EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE)
Posts a message to all windows that have registered to get events.
Definition: Event.cpp:67