File indexing completed on 2024-04-14 03:55:48
0001 /* 0002 SPDX-FileCopyrightText: 2008 Erlend Hamberg <ehamberg@gmail.com> 0003 SPDX-FileCopyrightText: 2011 Svyatoslav Kuzmich <svatoslav1@gmail.com> 0004 SPDX-FileCopyrightText: 2012-2013 Simon St James <kdedevel@etotheipiplusone.com> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef KATEVI_GLOBAL_STATE_H 0010 #define KATEVI_GLOBAL_STATE_H 0011 0012 #include <KSharedConfig> 0013 #include <ktexteditor_export.h> 0014 0015 namespace KateVi 0016 { 0017 class History; 0018 class Macros; 0019 class Mappings; 0020 class Registers; 0021 0022 class GlobalState 0023 { 0024 public: 0025 explicit GlobalState(); 0026 ~GlobalState(); 0027 GlobalState(const GlobalState &) = delete; 0028 GlobalState &operator=(const GlobalState &) = delete; 0029 0030 KTEXTEDITOR_EXPORT void writeConfig(KConfig *config) const; 0031 KTEXTEDITOR_EXPORT void readConfig(const KConfig *config); 0032 0033 inline Macros *macros() const 0034 { 0035 return m_macros; 0036 } 0037 inline Mappings *mappings() const 0038 { 0039 return m_mappings; 0040 } 0041 inline Registers *registers() const 0042 { 0043 return m_registers; 0044 } 0045 0046 inline History *searchHistory() const 0047 { 0048 return m_searchHistory; 0049 } 0050 inline History *commandHistory() const 0051 { 0052 return m_commandHistory; 0053 } 0054 inline History *replaceHistory() const 0055 { 0056 return m_replaceHistory; 0057 } 0058 0059 private: 0060 static KSharedConfigPtr config(); 0061 0062 private: 0063 Macros *m_macros; 0064 Mappings *m_mappings; 0065 Registers *m_registers; 0066 0067 History *m_searchHistory; 0068 History *m_commandHistory; 0069 History *m_replaceHistory; 0070 }; 0071 } 0072 0073 #endif