aboutsummaryrefslogtreecommitdiff
path: root/src/kristall.hpp
blob: 8f80045aacda0b530707d701c52f2175479b9e2a (plain) (blame)
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
#ifndef KRISTALL_HPP
#define KRISTALL_HPP

#include <QSettings>
#include <QClipboard>

#include "identitycollection.hpp"
#include "ssltrust.hpp"
#include "favouritecollection.hpp"

enum class Theme : int
{
    light = 0,
    dark = 1,
};

struct GenericSettings
{
    enum TextDisplay {
        FormattedText,
        PlainText,
    };

    enum RedirectionWarning {
        WarnNever = 0,
        WarnOnSchemeChange = 1,
        WarnOnHostChange = 2,
        WarnAlways = -1,
    };

    QString start_page = "about:favourites";
    Theme theme = Theme::light;
    TextDisplay text_display = FormattedText;
    bool enable_text_decoration = false;
    bool use_os_scheme_handler = false;
    TextDisplay gophermap_display = FormattedText;
    int max_redirections = 5;
    RedirectionWarning redirection_policy = WarnOnHostChange;

    // 5 seconds network timeout
    int network_timeout = 5000;

    void load(QSettings & settings);
    void save(QSettings & settings) const;
};

extern QSettings global_settings;
extern IdentityCollection global_identities;
extern QClipboard * global_clipboard;
extern SslTrust global_gemini_trust;
extern SslTrust global_https_trust;
extern FavouriteCollection global_favourites;
extern GenericSettings global_options;

#endif // KRISTALL_HPP