1 | /* |
2 | SPDX-FileCopyrightText: 2008 Erlend Hamberg <ehamberg@gmail.com> |
3 | SPDX-FileCopyrightText: 2011 Svyatoslav Kuzmich <svatoslav1@gmail.com> |
4 | SPDX-FileCopyrightText: 2012-2013 Simon St James <kdedevel@etotheipiplusone.com> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #ifndef KATEVI_GLOBAL_STATE_H |
10 | #define KATEVI_GLOBAL_STATE_H |
11 | |
12 | #include <KSharedConfig> |
13 | #include <ktexteditor_export.h> |
14 | |
15 | namespace KateVi |
16 | { |
17 | class History; |
18 | class Macros; |
19 | class Mappings; |
20 | class Registers; |
21 | |
22 | class GlobalState |
23 | { |
24 | public: |
25 | explicit GlobalState(); |
26 | ~GlobalState(); |
27 | GlobalState(const GlobalState &) = delete; |
28 | GlobalState &operator=(const GlobalState &) = delete; |
29 | |
30 | KTEXTEDITOR_EXPORT void writeConfig(KConfig *config) const; |
31 | KTEXTEDITOR_EXPORT void readConfig(const KConfig *config); |
32 | |
33 | inline Macros *macros() const |
34 | { |
35 | return m_macros; |
36 | } |
37 | inline Mappings *mappings() const |
38 | { |
39 | return m_mappings; |
40 | } |
41 | inline Registers *registers() const |
42 | { |
43 | return m_registers; |
44 | } |
45 | |
46 | inline History *searchHistory() const |
47 | { |
48 | return m_searchHistory; |
49 | } |
50 | inline History *commandHistory() const |
51 | { |
52 | return m_commandHistory; |
53 | } |
54 | inline History *replaceHistory() const |
55 | { |
56 | return m_replaceHistory; |
57 | } |
58 | |
59 | private: |
60 | static KSharedConfigPtr config(); |
61 | |
62 | private: |
63 | Macros *m_macros; |
64 | Mappings *m_mappings; |
65 | Registers *m_registers; |
66 | |
67 | History *m_searchHistory; |
68 | History *m_commandHistory; |
69 | History *m_replaceHistory; |
70 | }; |
71 | } |
72 | |
73 | #endif |
74 | |