~midori/midori/gtk3WebKit2only

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
 Copyright (C) 2008-2013 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#ifndef __MIDORI_WEB_SETTINGS_H__
#define __MIDORI_WEB_SETTINGS_H__

#include <katze/katze.h>

G_BEGIN_DECLS

#define MIDORI_TYPE_WEB_SETTINGS \
    (midori_web_settings_get_type ())
#define MIDORI_WEB_SETTINGS(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_WEB_SETTINGS, MidoriWebSettings))
#define MIDORI_WEB_SETTINGS_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_WEB_SETTINGS, MidoriWebSettingsClass))
#define MIDORI_IS_WEB_SETTINGS(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_WEB_SETTINGS))
#define MIDORI_IS_WEB_SETTINGS_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_WEB_SETTINGS))
#define MIDORI_WEB_SETTINGS_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_WEB_SETTINGS, MidoriWebSettingsClass))

typedef struct _MidoriWebSettings                MidoriWebSettings;
typedef struct _MidoriWebSettingsClass           MidoriWebSettingsClass;

enum
{
    MIDORI_CLEAR_NONE = 0,
    MIDORI_CLEAR_HISTORY = 1,
    MIDORI_CLEAR_COOKIES = 2, /* deprecated */
    MIDORI_CLEAR_FLASH_COOKIES = 4, /* deprecated */
    MIDORI_CLEAR_WEBSITE_ICONS = 8, /* deprecated */
    MIDORI_CLEAR_TRASH = 16, /* deprecated */
    MIDORI_CLEAR_ON_QUIT = 32,
    MIDORI_CLEAR_WEB_CACHE = 64, /* deprecated */
    MIDORI_CLEAR_SESSION = 128,
};

/* values >= MIDORI_STARTUP_LAST_OPEN_PAGES mean session is saved */
typedef enum
{
    MIDORI_STARTUP_BLANK_PAGE, /* One blank tab or speed dial is opened */
    MIDORI_STARTUP_HOMEPAGE, /* One homepage tab is opened */
    MIDORI_STARTUP_LAST_OPEN_PAGES, /* The session is loaded and saved */
    MIDORI_STARTUP_DELAYED_PAGES /* The session is saved, loading pages is delayed */
} MidoriStartup;

GType
midori_startup_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_STARTUP \
    (midori_startup_get_type ())

typedef enum
{
    MIDORI_NEWTAB_BLANK_PAGE,
    MIDORI_NEWTAB_HOMEPAGE,
    MIDORI_NEWTAB_SEARCH,
    MIDORI_NEWTAB_SPEED_DIAL,
    MIDORI_NEWTAB_CUSTOM,
} MidoriNewTabType;

GType
midori_newtab_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_NEWTAB \
    (midori_newtab_get_type ())

typedef enum
{
    MIDORI_ENCODING_CHINESE /* Traditional */,
    MIDORI_ENCODING_CHINESE_SIMPLIFIED,
    MIDORI_ENCODING_JAPANESE,
    MIDORI_ENCODING_KOREAN,
    MIDORI_ENCODING_RUSSIAN,
    MIDORI_ENCODING_UNICODE,
    MIDORI_ENCODING_WESTERN,
    MIDORI_ENCODING_CUSTOM
} MidoriPreferredEncoding;

GType
midori_preferred_encoding_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_PREFERRED_ENCODING \
    (midori_preferred_encoding_get_type ())

typedef enum
{
    MIDORI_NEW_PAGE_TAB,
    MIDORI_NEW_PAGE_WINDOW,
    MIDORI_NEW_PAGE_CURRENT
} MidoriNewPage;

GType
midori_new_page_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_NEW_PAGE \
    (midori_new_page_get_type ())

typedef enum
{
    MIDORI_TOOLBAR_DEFAULT,
    MIDORI_TOOLBAR_ICONS,
    MIDORI_TOOLBAR_SMALL_ICONS,
    MIDORI_TOOLBAR_TEXT,
    MIDORI_TOOLBAR_BOTH,
    MIDORI_TOOLBAR_BOTH_HORIZ
} MidoriToolbarStyle;

GType
midori_toolbar_style_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_TOOLBAR_STYLE \
    (midori_toolbar_style_get_type ())

typedef enum
{
    MIDORI_PROXY_AUTOMATIC,
    MIDORI_PROXY_HTTP,
    MIDORI_PROXY_NONE
} MidoriProxy;

GType
midori_proxy_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_PROXY \
    (midori_proxy_get_type ())

typedef enum
{
    MIDORI_IDENT_MIDORI /* Automatic */,
    MIDORI_IDENT_GENUINE /* Midori */,
    MIDORI_IDENT_CHROME,
    MIDORI_IDENT_SAFARI,
    MIDORI_IDENT_IPHONE,
    MIDORI_IDENT_FIREFOX,
    MIDORI_IDENT_EXPLORER,
    MIDORI_IDENT_CUSTOM,
} MidoriIdentity;

GType
midori_identity_get_type (void) G_GNUC_CONST;

#define MIDORI_TYPE_IDENTITY \
    (midori_identity_get_type ())

GType
midori_web_settings_get_type               (void) G_GNUC_CONST;

MidoriWebSettings*
midori_web_settings_new                    (void);

void
midori_web_settings_add_style              (MidoriWebSettings* settings,
                                            const gchar*       rule_id,
                                            const gchar*       style);

void
midori_web_settings_remove_style           (MidoriWebSettings* settings,
                                            const gchar*       rule_id);

const gchar*
midori_web_settings_get_system_name        (gchar**            architecture,
                                            gchar**            platform);

gboolean
midori_web_settings_has_plugin_support     (void);

gboolean
midori_web_settings_skip_plugin            (const gchar* path);

typedef enum
{
    MIDORI_SITE_DATA_UNDETERMINED,
    MIDORI_SITE_DATA_BLOCK,
    MIDORI_SITE_DATA_ACCEPT,
    MIDORI_SITE_DATA_PRESERVE,
} MidoriSiteDataPolicy;

MidoriSiteDataPolicy
midori_web_settings_get_site_data_policy   (MidoriWebSettings* settings,
                                            const gchar*       uri);

MidoriWebSettings*
midori_settings_new_full                   (gchar***           extensions);

gboolean
midori_settings_save_to_file               (MidoriWebSettings* settings,
                                            GObject*           app,
                                            const gchar*       filename,
                                            GError**           error);

G_END_DECLS

#endif /* __MIDORI_WEB_SETTINGS_H__ */