-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppSettings.h
90 lines (73 loc) · 1.62 KB
/
AppSettings.h
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
#pragma once
#include "json.hpp"
#include <fstream>
#include <string>
#include "StringCoding.h"
using std::string;
using std::to_string;
using std::ifstream;
using std::ofstream;
using json = nlohmann::json;
struct AppSettings {
private:
static bool safeDelete;
static bool displayByTopics;
static string* selectedTopics;
static int countOfSelectedTopics;
public:
/*
Setting default settings.
*/
static void defaultSettings();
/*
Attempt to load saved settings.
If there is a file "appSettings.json" and it is not empty,
it is read and the downloaded settings are installed.
*/
static void loadSettings();
/*
Saving settings.
Writing the settings values to the "appSettings.json" file.
*/
static void saveSettings();
/*
Changing the safe deletion setting state.
*/
static void changeStateSafeDelete();
/*
Receiving the safe deletion setting state.
*/
static bool isSafeDelete();
/*
Setting state of the display mode by themes.
*/
static void setDisplayTopicsMode(bool state);
/*
Checking if the display mode set to display by topics.
*/
static bool isDisplayTopicsMode();
/*
Getting the array of selected topics.
*/
static string* getSelectedTopics();
/*
Adding the topic to the array of selected topics.
*/
static void addTopicInSelected(string topic);
/*
Checking if topic is selected.
*/
static bool isTopicSelected(string topic);
/*
Unselecting the topic, if it is selected.
*/
static void unselectTopic(string topic);
/*
Unselecting all selected topics.
*/
static void unselectAllTopics();
/*
Receiving the count of selected topics.
*/
static int getCountOfSelectedTopics();
};