1 | /* |
2 | * Copyright (C) 2015 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(__WEBKIT_WEB_EXTENSION_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) |
21 | #error "Only <webkit2/webkit-web-extension.h> can be included directly." |
22 | #endif |
23 | |
24 | #ifndef WebKitConsoleMessage_h |
25 | #define WebKitConsoleMessage_h |
26 | |
27 | #include <glib-object.h> |
28 | #include <webkit2/WebKitDefines.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | #define WEBKIT_TYPE_CONSOLE_MESSAGE (webkit_console_message_get_type()) |
33 | |
34 | /** |
35 | * WebKitConsoleMessageSource: |
36 | * @WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT: Message produced by JavaScript. |
37 | * @WEBKIT_CONSOLE_MESSAGE_SOURCE_NETWORK: Network messages. |
38 | * @WEBKIT_CONSOLE_MESSAGE_SOURCE_CONSOLE_API: Messages produced by console API. |
39 | * @WEBKIT_CONSOLE_MESSAGE_SOURCE_SECURITY: Security messages. |
40 | * @WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER: Other messages. |
41 | * |
42 | * Enum values used to denote the various sources of console messages. |
43 | * |
44 | * Since: 2.12 |
45 | */ |
46 | typedef enum { |
47 | WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT, |
48 | WEBKIT_CONSOLE_MESSAGE_SOURCE_NETWORK, |
49 | WEBKIT_CONSOLE_MESSAGE_SOURCE_CONSOLE_API, |
50 | WEBKIT_CONSOLE_MESSAGE_SOURCE_SECURITY, |
51 | WEBKIT_CONSOLE_MESSAGE_SOURCE_OTHER |
52 | } WebKitConsoleMessageSource; |
53 | |
54 | /** |
55 | * WebKitConsoleMessageLevel: |
56 | * @WEBKIT_CONSOLE_MESSAGE_LEVEL_INFO: Information message. |
57 | * @WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG: Log message. |
58 | * @WEBKIT_CONSOLE_MESSAGE_LEVEL_WARNING: Warning message. |
59 | * @WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR: Error message. |
60 | * @WEBKIT_CONSOLE_MESSAGE_LEVEL_DEBUG: Debug message. |
61 | * |
62 | * Enum values used to denote the various levels of console messages. |
63 | * |
64 | * Since: 2.12 |
65 | */ |
66 | typedef enum { |
67 | WEBKIT_CONSOLE_MESSAGE_LEVEL_INFO, |
68 | WEBKIT_CONSOLE_MESSAGE_LEVEL_LOG, |
69 | WEBKIT_CONSOLE_MESSAGE_LEVEL_WARNING, |
70 | WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR, |
71 | WEBKIT_CONSOLE_MESSAGE_LEVEL_DEBUG |
72 | } WebKitConsoleMessageLevel; |
73 | |
74 | typedef struct _WebKitConsoleMessage WebKitConsoleMessage; |
75 | |
76 | WEBKIT_API GType |
77 | webkit_console_message_get_type (void); |
78 | |
79 | WEBKIT_API WebKitConsoleMessage * |
80 | webkit_console_message_copy (WebKitConsoleMessage *console_message); |
81 | |
82 | WEBKIT_API void |
83 | webkit_console_message_free (WebKitConsoleMessage *console_message); |
84 | |
85 | WEBKIT_API WebKitConsoleMessageSource |
86 | webkit_console_message_get_source (WebKitConsoleMessage *console_message); |
87 | |
88 | WEBKIT_API WebKitConsoleMessageLevel |
89 | webkit_console_message_get_level (WebKitConsoleMessage *console_message); |
90 | |
91 | WEBKIT_API const gchar * |
92 | webkit_console_message_get_text (WebKitConsoleMessage *console_message); |
93 | |
94 | WEBKIT_API guint |
95 | webkit_console_message_get_line (WebKitConsoleMessage *console_message); |
96 | |
97 | WEBKIT_API const gchar * |
98 | webkit_console_message_get_source_id (WebKitConsoleMessage *console_message); |
99 | |
100 | G_END_DECLS |
101 | |
102 | #endif |
103 | |