| 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 | |
| 31 | G_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 | */ |
| 46 | typedef 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 | |
| 55 | typedef struct _WebKitNavigationAction WebKitNavigationAction; |
| 56 | |
| 57 | |
| 58 | WEBKIT_API GType |
| 59 | webkit_navigation_action_get_type (void); |
| 60 | |
| 61 | WEBKIT_API WebKitNavigationAction * |
| 62 | webkit_navigation_action_copy (WebKitNavigationAction *navigation); |
| 63 | |
| 64 | WEBKIT_API void |
| 65 | webkit_navigation_action_free (WebKitNavigationAction *navigation); |
| 66 | |
| 67 | WEBKIT_API WebKitNavigationType |
| 68 | webkit_navigation_action_get_navigation_type (WebKitNavigationAction *navigation); |
| 69 | |
| 70 | WEBKIT_API guint |
| 71 | webkit_navigation_action_get_mouse_button (WebKitNavigationAction *navigation); |
| 72 | |
| 73 | WEBKIT_API guint |
| 74 | webkit_navigation_action_get_modifiers (WebKitNavigationAction *navigation); |
| 75 | |
| 76 | WEBKIT_API WebKitURIRequest * |
| 77 | webkit_navigation_action_get_request (WebKitNavigationAction *navigation); |
| 78 | |
| 79 | WEBKIT_API gboolean |
| 80 | webkit_navigation_action_is_user_gesture (WebKitNavigationAction *navigation); |
| 81 | |
| 82 | WEBKIT_API gboolean |
| 83 | webkit_navigation_action_is_redirect (WebKitNavigationAction *navigation); |
| 84 | |
| 85 | G_END_DECLS |
| 86 | |
| 87 | #endif |
| 88 | |