Home | History | Annotate | Download | only in gobject
      1 /*
      2  *  Copyright (C) 2010 Igalia S.L.
      3  *
      4  *  This library is free software; you can redistribute it and/or
      5  *  modify it under the terms of the GNU Lesser General Public
      6  *  License as published by the Free Software Foundation; either
      7  *  version 2 of the License, or (at your option) any later version.
      8  *
      9  *  This library is distributed in the hope that it will be useful,
     10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  *  Lesser General Public License for more details.
     13  *
     14  *  You should have received a copy of the GNU Lesser General Public
     15  *  License along with this library; if not, write to the Free Software
     16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     17  */
     18 
     19 #ifndef WebKitDOMEventTarget_h
     20 #define WebKitDOMEventTarget_h
     21 
     22 #include "webkit/webkitdomdefines.h"
     23 #include <glib-object.h>
     24 #include <webkit/webkitdefines.h>
     25 
     26 G_BEGIN_DECLS
     27 
     28 #define WEBKIT_TYPE_DOM_EVENT_TARGET            (webkit_dom_event_target_get_type ())
     29 #define WEBKIT_DOM_EVENT_TARGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_DOM_EVENT_TARGET, WebKitDOMEventTarget))
     30 #define WEBKIT_DOM_EVENT_TARGET_CLASS(obj)      (G_TYPE_CHECK_CLASS_CAST ((obj), WEBKIT_TYPE_DOM_EVENT_TARGET, WebKitDOMEventTargetIface))
     31 #define WEBKIT_DOM_IS_EVENT_TARGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_DOM_EVENT_TARGET))
     32 #define WEBKIT_DOM_EVENT_TARGET_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WEBKIT_TYPE_DOM_EVENT_TARGET, WebKitDOMEventTargetIface))
     33 
     34 typedef struct _WebKitDOMEventTargetIface WebKitDOMEventTargetIface;
     35 
     36 struct _WebKitDOMEventTargetIface {
     37     GTypeInterface gIface;
     38 
     39     /* virtual table */
     40     void          (* dispatch_event)(WebKitDOMEventTarget *target,
     41                                      WebKitDOMEvent       *event,
     42                                      GError              **error);
     43 
     44     gboolean      (* add_event_listener)(WebKitDOMEventTarget *target,
     45                                          const char          *eventName,
     46                                          GCallback             handler,
     47                                          gboolean              bubble,
     48                                          gpointer              userData);
     49     gboolean      (* remove_event_listener)(WebKitDOMEventTarget *target,
     50                                             const char           *eventName,
     51                                             GCallback             handler,
     52                                             gboolean              bubble);
     53 };
     54 
     55 
     56 WEBKIT_API GType     webkit_dom_event_target_get_type(void) G_GNUC_CONST;
     57 
     58 WEBKIT_API void      webkit_dom_event_target_dispatch_event(WebKitDOMEventTarget *target,
     59                                                             WebKitDOMEvent       *event,
     60                                                             GError              **error);
     61 
     62 WEBKIT_API gboolean  webkit_dom_event_target_add_event_listener(WebKitDOMEventTarget *target,
     63                                                                 const char           *eventName,
     64                                                                 GCallback             handler,
     65                                                                 gboolean              bubble,
     66                                                                 gpointer              userData);
     67 
     68 WEBKIT_API gboolean  webkit_dom_event_target_remove_event_listener(WebKitDOMEventTarget *target,
     69                                                                    const char           *eventName,
     70                                                                    GCallback             handler,
     71                                                                    gboolean              bubble);
     72 
     73 G_END_DECLS
     74 
     75 #endif /* WebKitDOMEventTarget_h */
     76