1/*
2 * Copyright (C) 2014 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 Library 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 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
21#error "Only <webkit2/webkit2.h> can be included directly."
22#endif
23
24#ifndef WebKitNavigationAction_h
25#define WebKitNavigationAction_h
26
27#include <glib-object.h>
28#include <webkit2/WebKitDefines.h>
29#include <webkit2/WebKitURIRequest.h>
30
31G_BEGIN_DECLS
32
33#define WEBKIT_TYPE_NAVIGATION_ACTION (webkit_navigation_action_get_type())
34
35/**
36 * WebKitNavigationType:
37 * @WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: The navigation was triggered by clicking a link.
38 * @WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: The navigation was triggered by submitting a form.
39 * @WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: The navigation was triggered by navigating forward or backward.
40 * @WEBKIT_NAVIGATION_TYPE_RELOAD: The navigation was triggered by reloading.
41 * @WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: The navigation was triggered by resubmitting a form.
42 * @WEBKIT_NAVIGATION_TYPE_OTHER: The navigation was triggered by some other action.
43 *
44 * Enum values used to denote the various navigation types.
45 */
46typedef enum {
47 WEBKIT_NAVIGATION_TYPE_LINK_CLICKED,
48 WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED,
49 WEBKIT_NAVIGATION_TYPE_BACK_FORWARD,
50 WEBKIT_NAVIGATION_TYPE_RELOAD,
51 WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED,
52 WEBKIT_NAVIGATION_TYPE_OTHER
53} WebKitNavigationType;
54
55typedef struct _WebKitNavigationAction WebKitNavigationAction;
56
57
58WEBKIT_API GType
59webkit_navigation_action_get_type (void);
60
61WEBKIT_API WebKitNavigationAction *
62webkit_navigation_action_copy (WebKitNavigationAction *navigation);
63
64WEBKIT_API void
65webkit_navigation_action_free (WebKitNavigationAction *navigation);
66
67WEBKIT_API WebKitNavigationType
68webkit_navigation_action_get_navigation_type (WebKitNavigationAction *navigation);
69
70WEBKIT_API guint
71webkit_navigation_action_get_mouse_button (WebKitNavigationAction *navigation);
72
73WEBKIT_API guint
74webkit_navigation_action_get_modifiers (WebKitNavigationAction *navigation);
75
76WEBKIT_API WebKitURIRequest *
77webkit_navigation_action_get_request (WebKitNavigationAction *navigation);
78
79WEBKIT_API gboolean
80webkit_navigation_action_is_user_gesture (WebKitNavigationAction *navigation);
81
82WEBKIT_API gboolean
83webkit_navigation_action_is_redirect (WebKitNavigationAction *navigation);
84
85G_END_DECLS
86
87#endif
88