Statistics
| Branch: | Revision:

janus-gateway / events.h @ d97e0296

History | View | Annotate | Download (1.46 KB)

1
/*! \file    events.h
2
 * \author   Lorenzo Miniero <lorenzo@meetecho.com>
3
 * \copyright GNU General Public License v3
4
 * \brief    Event handler notifications (headers)
5
 * \details  Event handler plugins can receive events from the Janus core
6
 * and other plugins, in order to handle them somehow. This methods
7
 * provide helpers to notify events to such handlers. 
8
 * 
9
 * \ingroup core
10
 * \ref core
11
 */
12
 
13
#ifndef _JANUS_EVENTS_H
14
#define _JANUS_EVENTS_H
15

    
16
#include "debug.h"
17
#include "events/eventhandler.h"
18

    
19
/*! \brief Initialize the event handlers broadcaster
20
 * @param[in] enabled Whether broadcasting events should be supported at all
21
 * @param[in] handlers Map of all registered event handlers
22
 * @returns 0 on success, a negative integer otherwise */
23
int janus_events_init(gboolean enabled, GHashTable *handlers);
24

    
25
/*! \brief De-initialize the event handlers broadcaster */
26
void janus_events_deinit(void);
27

    
28
/*! \brief Quick method to check whether event handlers are enabled at all or not
29
 * @returns TRUE if they're enabled, FALSE if not */
30
gboolean janus_events_is_enabled(void);
31

    
32
/*! \brief Notify an event to all interested handlers
33
 * @note According to the type of event to notify, different arguments may
34
 * be required and used in order to prepare the actual object to pass to handlers.
35
 * @param[in] type Type of the event to notify
36
 * @param[in] session_id Janus session identifier this event refers to */
37
void janus_events_notify_handlers(int type, guint64 session_id, ...);
38

    
39
#endif