1 /*
2  configuration.h     M8r configuration management
3 
4  Copyright (C) 2016-2020 Martin Dvorak <martin.dvorak@mindforger.com>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef M8R_CONFIGURATION_H_
20 #define M8R_CONFIGURATION_H_
21 
22 #include <set>
23 #include <string>
24 #include <cstdlib>
25 #include <cstdio>
26 #include <vector>
27 
28 #include "repository.h"
29 #include "time_scope.h"
30 #include "../repository_indexer.h"
31 #include "../gear/lang_utils.h"
32 #include "../gear/file_utils.h"
33 #include "../exceptions.h"
34 #include "../model/tag.h"
35 #include "../install/installer.h"
36 #include "../representations/markdown/markdown_transcoder.h"
37 
38 namespace m8r {
39 
40 // const in constexpr makes value const
41 constexpr const auto ENV_VAR_HOME = "HOME";
42 constexpr const auto ENV_VAR_DISPLAY = "DISPLAY";
43 constexpr const auto ENV_VAR_M8R_REPOSITORY = "MINDFORGER_REPOSITORY";
44 constexpr const auto ENV_VAR_M8R_EDITOR = "MINDFORGER_EDITOR";
45 
46 constexpr const auto DIRNAME_M8R_REPOSITORY = "mindforger-repository";
47 // IMPROVE :-Z C++
48 constexpr const auto FILE_PATH_M8R_REPOSITORY = "~/mindforger-repository";
49 
50 constexpr const auto FILENAME_M8R_CONFIGURATION = ".mindforger.md";
51 constexpr const auto FILE_PATH_MEMORY = "memory";
52 constexpr const auto FILE_PATH_MIND = "mind";
53 constexpr const auto FILE_PATH_LIMBO = "limbo";
54 constexpr const auto FILE_PATH_STENCILS = "stencils";
55 constexpr const auto FILE_PATH_OUTLINES = "notebooks";
56 constexpr const auto FILE_PATH_NOTES = "notes";
57 
58 constexpr const auto FILE_EXTENSION_HTML = ".html";
59 constexpr const auto FILE_EXTENSION_CSV= ".csv";
60 
61 constexpr const auto FILE_EXTENSION_MD_MD = ".md";
62 constexpr const auto FILE_EXTENSION_MD_MARKDOWN = ".markdown";
63 constexpr const auto FILE_EXTENSION_MD_MDOWN = ".mdown";
64 constexpr const auto FILE_EXTENSION_MD_MKDN = ".mkdn";
65 
66 constexpr const auto UI_THEME_DARK = "dark";
67 constexpr const auto UI_THEME_LIGHT = "light";
68 constexpr const auto UI_THEME_BLACK = "black";
69 constexpr const auto UI_THEME_NATIVE = "native";
70 
71 constexpr const auto START_TO_DASHBOARD = "dashboard";
72 constexpr const auto START_TO_OUTLINES = "outlines";
73 constexpr const auto START_TO_TAGS = "tags";
74 constexpr const auto START_TO_RECENT = "recent";
75 constexpr const auto START_TO_EISENHOWER_MATRIX = "Eisehower";
76 constexpr const auto START_TO_HOME_OUTLINE = "home";
77 constexpr const auto DEFAULT_STARTUP_VIEW = START_TO_OUTLINES;
78 
79 constexpr const auto UI_HTML_THEME_CSS_LIGHT = "qrc:/html-css/light.css";
80 constexpr const auto UI_HTML_THEME_CSS_LIGHT_COMPACT = "qrc:/html-css/light-compact.css";
81 constexpr const auto UI_HTML_THEME_CSS_DARK = "qrc:/html-css/dark.css";
82 constexpr const auto UI_HTML_THEME_CSS_RAW = "raw";
83 
84 constexpr const auto UI_EDITOR_KEY_BINDING_EMACS = "emacs";
85 constexpr const auto UI_EDITOR_KEY_BINDING_VIM = "vim";
86 constexpr const auto UI_EDITOR_KEY_BINDING_WIN = "windows";
87 
88 constexpr const auto UI_JS_LIB_ONLINE = "online";
89 constexpr const auto UI_JS_LIB_OFFLINE = "offline";
90 constexpr const auto UI_JS_LIB_NO = "no";
91 
92 constexpr const auto UI_OS_TABLE_SORT_ORDER_ASC = "ascending";
93 constexpr const auto UI_OS_TABLE_SORT_ORDER_DESC = "descending";
94 
95 constexpr const auto UI_DEFAULT_THEME = UI_THEME_DARK;
96 constexpr const auto UI_DEFAULT_HTML_CSS_THEME = UI_HTML_THEME_CSS_LIGHT;
97 constexpr const auto UI_DEFAULT_EDITOR_FONT = "Monospace,10";
98 constexpr const auto UI_DEFAULT_FONT_POINT_SIZE = 10;
99 
100 // improve platform/language specific
101 constexpr const auto DEFAULT_NEW_OUTLINE = "# New Markdown File\n\nThis is a new Markdown file created by MindForger.\n\n#Section 1\nThe first section.\n\n";
102 
103 class Installer;
104 
105 /**
106  * @brief MindForger configuration.
107  *
108  * Configuration file (Markdown-based DSL) maintained by this class contains
109  * location of repositories, active repository and user preferences (for GUI
110  * and library).
111  *
112  * MindForger configuration file is stored in ~/.mindforger.md by default.
113  *
114  * This class is singleton. The reason to make it singleton is that it's used
115  * through lib and GUI instances. Therefore passing of the configuration instance
116  * to (almost) each and every application's component would be inefficient i.e. worse
117  * than the use of singleton pattern.
118  */
119 class Configuration {
120 public:
getInstance()121     static Configuration& getInstance()
122     {
123         static Configuration SINGLETON{};
124         return SINGLETON;
125     }
126 
127     enum MindState {
128         THINKING, // 0
129         DREAMING, // 1
130         SLEEPING  // 2
131     };
132 
133     enum AssociationAssessmentAlgorithm {
134         BOW,
135         WEIGHTED_FTS
136     };
137 
138     enum JavaScriptLibSupport {
139         NO,         // 0
140         ONLINE,     // 2
141         OFFLINE     // 1
142     };
143 
144     enum EditorKeyBindingMode {
145         EMACS,
146         VIM,
147         WINDOWS
148     };
149 
150     static constexpr const int DEFAULT_ASYNC_MIND_THRESHOLD_BOW = 200;
151     static constexpr const int DEFAULT_ASYNC_MIND_THRESHOLD_WEIGHTED_FTS = 10000;
152     static constexpr const int DEFAULT_DISTRIBUTOR_SLEEP_INTERVAL = 500;
153 
154     static const std::string DEFAULT_ACTIVE_REPOSITORY_PATH;
155     static const std::string DEFAULT_TIME_SCOPE;
156 
157     static constexpr const bool DEFAULT_AUTOLINKING = false;
158     static constexpr const bool DEFAULT_AUTOLINKING_COLON_SPLIT = true;
159     static constexpr const bool DEFAULT_AUTOLINKING_CASE_INSENSITIVE = true;
160     static constexpr const bool DEFAULT_SAVE_READS_METADATA = true;
161 
162     static constexpr const bool UI_DEFAULT_NERD_TARGET_AUDIENCE = true;
163     static const std::string DEFAULT_STARTUP_VIEW_NAME;
164     static const std::string DEFAULT_UI_THEME_NAME;
165     static constexpr const bool DEFAULT_UI_SHOW_TOOLBAR = true;
166     static constexpr const bool DEFAULT_UI_EXPERT_MODE = false;
167     static constexpr const bool DEFAULT_UI_LIVE_NOTE_PREVIEW = true;
168     static constexpr const bool DEFAULT_UI_NERD_MENU = false;
169     static const std::string DEFAULT_UI_HTML_CSS_THEME;
170     static constexpr const int DEFAULT_UI_HTML_ZOOM = 100;
171     static const std::string DEFAULT_EDITOR_FONT;
172     static constexpr const int DEFAULT_EDITOR_TAB_WIDTH = 4;
173     static constexpr const int DEFAULT_NAVIGATOR_MAX_GRAPH_NODES = 150;
174     static constexpr const bool DEFAULT_EDITOR_SYNTAX_HIGHLIGHT = true;
175     static constexpr const bool DEFAULT_EDITOR_AUTOCOMPLETE = true;
176     static constexpr const bool DEFAULT_EDITOR_TABS_AS_SPACES = true;
177     static constexpr const bool DEFAULT_EDITOR_AUTOSAVE = false;
178     static constexpr const bool DEFAULT_FULL_O_PREVIEW = false;
179     static constexpr const bool DEFAULT_MD_QUOTE_SECTIONS = true;
180     static constexpr const bool DEFAULT_MD_HIGHLIGHT = true;
181     static constexpr const bool DEFAULT_MD_MATH = false;
182     static constexpr const bool DEFAULT_ALLOW_ONLINE_JS_LIBS = false;
183     static constexpr const bool DEFAULT_NAVIGATOR_SHOW_LEGEND = false;
184     static constexpr const int DEFAULT_OS_TABLE_SORT_COLUMN = 7;
185     static constexpr const bool DEFAULT_OS_TABLE_SORT_ORDER = false;
186 
187     static constexpr int EDITOR_MAX_AUTOCOMPLETE_LINES = 1000;
188 
189 private:
190     explicit Configuration();
191 
192 private:
193     // configured Mind state where user wants Mind to be
194     MindState desiredMindState;
195     // current Mind state on the way to desired state
196     MindState mindState;
197     // if count(N) > asyncMindTreshold then long-running mind computations should be run in async
198     unsigned int asyncMindThreshold;
199 
200     std::string userHomePath;
201     // Some platforms, e.g. Windows, distinquishes user home and user documents
202     std::string userDocPath;
203     std::string configFilePath;
204 
205     Repository* activeRepository;
206     std::map<const std::string, Repository*> repositories;
207 
208     // active repository memory, limbo, ... paths (efficiency)
209     std::string memoryPath;
210     std::string limboPath;
211 
212     // lib configuration
213     bool writeMetadata; // write metadata to MD - enabled in case of MINDFORGER_REPO only by default (can be disabled for all repository types)
214     bool saveReadsMetadata; // persist count of Outline and Note reads (requires write to disc on every O/N view)
215     bool autolinking; // enable MD autolinking
216     bool autolinkingColonSplit;
217     bool autolinkingCaseInsensitive;
218     TimeScope timeScope;
219     std::string timeScopeAsString;
220     std::vector<std::string> tagsScope;
221     unsigned int md2HtmlOptions;
222     AssociationAssessmentAlgorithm aaAlgorithm;
223     int distributorSleepInterval;
224     bool markdownQuoteSections;
225 
226     // GUI configuration
227     bool uiNerdTargetAudience;
228     std::string startupView;
229     std::string uiThemeName;
230     std::string uiHtmlCssPath; // use a CSS (size>0) or render raw MD (size==0)
231     int uiHtmlZoom;
232     EditorKeyBindingMode uiEditorKeyBinding;
233     std::string editorFont;
234     int uiFontPointSize;
235     bool uiShowBreadcrump; // show breadcrump path
236     bool uiViewerShowMetadata; // show reads/writes/... when viewing Outlines and/or Notes.
237     int uiEditorTabWidth;
238     bool uiEditorLineNumbers; // show line numbers
239     bool uiEditorSyntaxHighlighting; // toggle syntax highlighting
240     bool uiEditorAutocomplete; // toggle autocompletion
241     JavaScriptLibSupport uiEnableDiagramsInMd; // MD: diagrams
242     int navigatorMaxNodes;
243     bool uiEditorTabsAsSpaces;
244     bool uiEditorAutosave;
245     bool uiFullOPreview;
246     bool uiShowToolbar;
247     bool uiExpertMode;
248     bool uiDistractionFreeMode; // fullscreen, no split, hidden toolbar + menu
249     bool uiHoistedMode; // no split
250     bool uiLiveNotePreview;
251     int uiOsTableSortColumn;
252     bool uiOsTableSortOrder; // true if ascending, else descending
253 
254 private:
255     Installer* installer;
256 
257 public:
258     Configuration(const Configuration&) = delete;
259     Configuration(const Configuration&&) = delete;
260     Configuration &operator=(const Configuration&) = delete;
261     Configuration &operator=(const Configuration&&) = delete;
262     virtual ~Configuration();
263 
264     void clear();
265 
getInstaller()266     Installer* getInstaller() const { return installer; }
getMindState()267     MindState getMindState() const { return mindState; }
setMindState(MindState mindState)268     void setMindState(MindState mindState) { this->mindState = mindState; }
getDesiredMindState()269     MindState getDesiredMindState() const { return desiredMindState; }
setDesiredMindState(MindState mindState)270     void setDesiredMindState(MindState mindState) { this->desiredMindState = mindState; }
getAsyncMindThreshold()271     unsigned int getAsyncMindThreshold() const { return asyncMindThreshold; }
272 
getConfigFilePath()273     std::string& getConfigFilePath() { return configFilePath; }
setConfigFilePath(const std::string customConfigFilePath)274     void setConfigFilePath(const std::string customConfigFilePath) { configFilePath = customConfigFilePath; }
getMemoryPath()275     const std::string& getMemoryPath() const { return memoryPath; }
getLimboPath()276     const std::string& getLimboPath() const { return limboPath; }
277     const char* getRepositoryPathFromEnv();
278     /**
279      * @brief Create empty Markdown file.
280      *
281      * Create empty Markdown file if its name was given on command line - no dirs and a supported MD extension.
282      */
283     bool createEmptyMarkdownFile(const std::string& file);
284     /**
285      * @brief Find or create default MindForger repository.
286      *
287      * On MF start active repository location is determined as follows:
288      *
289      * 1) if application has single arg which is dir OR --repository, then use it, else 2)
290      * 2) if configuration file exist w/ repository specified, then use it, else 3)
291      * 3) if environment variable MINDFORGER_REPOSITORY is set, then use it, else 4)
292      * 4) if repository exist in default location ~/mindforger-repository, then use it, else start W/O repository
293      */
294     void findOrCreateDefaultRepository();
295     Repository* addRepository(Repository* repository);
296     std::map<const std::string, Repository*>& getRepositories();
297     /**
298      * @brief Set active repository
299      *
300      * Note that activeRepository parameter must be one of the known repositories.
301      */
302     void setActiveRepository(Repository* activeRepository);
isActiveRepository()303     bool isActiveRepository() const { return activeRepository!=nullptr; }
304     Repository* getActiveRepository() const;
305 
306     /*
307      * lib
308      */
309 
310     const char* getEditorFromEnv();
setTimeScope(const TimeScope & timeScope)311     void setTimeScope(const TimeScope& timeScope) { this->timeScope = timeScope; }
getTimeScope()312     TimeScope& getTimeScope() { return timeScope; }
setTagsScope(const std::vector<std::string> & tags)313     void setTagsScope(const std::vector<std::string>& tags) { tagsScope.assign(tags.begin(), tags.end()); }
setTagsScope(const std::vector<const Tag * > & tags)314     void setTagsScope(const std::vector<const Tag*>& tags) { tagsScope.clear(); if(tags.size()) for(const Tag* t:tags) tagsScope.push_back(t->getName()); }
getTagsScope()315     std::vector<std::string>& getTagsScope() { return tagsScope; }
isSaveReadsMetadata()316     bool isSaveReadsMetadata() const { return saveReadsMetadata; }
setSaveReadsMetadata(bool saveReadsMetadata)317     void setSaveReadsMetadata(bool saveReadsMetadata) { this->saveReadsMetadata=saveReadsMetadata; }
isAutolinking()318     bool isAutolinking() const { return autolinking; }
setAutolinking(bool autolinking)319     void setAutolinking(bool autolinking) { this->autolinking=autolinking; }
isAutolinkingColonSplit()320     bool isAutolinkingColonSplit() const { return autolinkingColonSplit; }
setAutolinkingColonSplit(bool autolinkingColonSplit)321     void setAutolinkingColonSplit(bool autolinkingColonSplit) { this->autolinkingColonSplit=autolinkingColonSplit; }
isAutolinkingCaseInsensitive()322     bool isAutolinkingCaseInsensitive() const { return autolinkingCaseInsensitive; }
setAutolinkingCaseInsensitive(bool autolinkingCaseInsensitive)323     void setAutolinkingCaseInsensitive(bool autolinkingCaseInsensitive) { this->autolinkingCaseInsensitive=autolinkingCaseInsensitive; }
getMd2HtmlOptions()324     unsigned int getMd2HtmlOptions() const { return md2HtmlOptions; }
getAaAlgorithm()325     AssociationAssessmentAlgorithm getAaAlgorithm() const { return aaAlgorithm; }
setAaAlgorithm(AssociationAssessmentAlgorithm aaa)326     void setAaAlgorithm(AssociationAssessmentAlgorithm aaa) { aaAlgorithm = aaa; }
getDistributorSleepInterval()327     int getDistributorSleepInterval() const { return distributorSleepInterval; }
setDistributorSleepInterval(int sleepInterval)328     void setDistributorSleepInterval(int sleepInterval) { distributorSleepInterval = sleepInterval; }
isMarkdownQuoteSections()329     bool isMarkdownQuoteSections() const { return markdownQuoteSections; }
setMarkdownQuoteSections(bool markdownQuoteSections)330     void setMarkdownQuoteSections(bool markdownQuoteSections) { this->markdownQuoteSections = markdownQuoteSections; }
331 
332     /*
333      * GUI
334      */
335 
getEditorKeyBinding()336     EditorKeyBindingMode getEditorKeyBinding() const { return uiEditorKeyBinding; }
editorKeyBindingToString(EditorKeyBindingMode keyBinding)337     static const char* editorKeyBindingToString(EditorKeyBindingMode keyBinding) {
338         if(keyBinding==EditorKeyBindingMode::EMACS) return UI_EDITOR_KEY_BINDING_EMACS; else
339             if(keyBinding==EditorKeyBindingMode::WINDOWS) return UI_EDITOR_KEY_BINDING_WIN; else return UI_EDITOR_KEY_BINDING_VIM;
340     }
getEditorKeyBindingAsString()341     const char* getEditorKeyBindingAsString() const {
342         return editorKeyBindingToString(uiEditorKeyBinding);
343     }
setEditorKeyBinding(EditorKeyBindingMode keyBinding)344     void setEditorKeyBinding(EditorKeyBindingMode keyBinding) { this->uiEditorKeyBinding=keyBinding; }
setEditorKeyBindingByString(const std::string & binding)345     void setEditorKeyBindingByString(const std::string& binding) {
346         if(!binding.compare(UI_EDITOR_KEY_BINDING_WIN)) uiEditorKeyBinding=EditorKeyBindingMode::WINDOWS;
347         else if (!binding.compare(UI_EDITOR_KEY_BINDING_VIM)) uiEditorKeyBinding=EditorKeyBindingMode::VIM;
348         else uiEditorKeyBinding=EditorKeyBindingMode::EMACS;
349     }
setEditorFont(std::string font)350     void setEditorFont(std::string font) { this->editorFont = font; }
getEditorFont()351     std::string getEditorFont() { return this->editorFont; }
getUiFontPointSize()352     int getUiFontPointSize() const { return uiFontPointSize; }
isUiNerdTargetAudience()353     bool isUiNerdTargetAudience() const { return uiNerdTargetAudience; }
setUiNerdTargetAudience(bool nerdAudience)354     void setUiNerdTargetAudience(bool nerdAudience) { uiNerdTargetAudience = nerdAudience; }
getStartupView()355     const std::string& getStartupView() const { return startupView; }
setStartupView(const std::string view)356     void setStartupView(const std::string view) { startupView = view; }
getUiThemeName()357     const std::string& getUiThemeName() const { return uiThemeName; }
setUiThemeName(const std::string theme)358     void setUiThemeName(const std::string theme) { uiThemeName = theme; }
isUiEditorShowLineNumbers()359     bool isUiEditorShowLineNumbers() const { return uiEditorLineNumbers; }
setUiEditorShowLineNumbers(bool show)360     void setUiEditorShowLineNumbers(bool show) { uiEditorLineNumbers = show; }
isUiEditorEnableSyntaxHighlighting()361     bool isUiEditorEnableSyntaxHighlighting() const { return uiEditorSyntaxHighlighting; }
setUiEditorEnableSyntaxHighlighting(bool enable)362     void setUiEditorEnableSyntaxHighlighting(bool enable) { uiEditorSyntaxHighlighting = enable; }
isUiEditorEnableAutocomplete()363     bool isUiEditorEnableAutocomplete() const { return uiEditorAutocomplete; }
setUiEditorEnableAutocomplete(bool enable)364     void setUiEditorEnableAutocomplete(bool enable) { uiEditorAutocomplete = enable; }
getUiEditorTabWidth()365     int getUiEditorTabWidth() const { return uiEditorTabWidth; }
setUiEditorTabWidth(int tabWidth)366     void setUiEditorTabWidth(int tabWidth) { uiEditorTabWidth = tabWidth; }
getRecentNotesUiLimit()367     int getRecentNotesUiLimit() const { return 150; }
isUiShowBreadcrump()368     bool isUiShowBreadcrump() const { return uiShowBreadcrump; }
isUiHtmlTheme()369     bool isUiHtmlTheme() const { return !uiHtmlCssPath.empty(); }
getUiHtmlCssPath()370     const char* getUiHtmlCssPath() const {
371         return uiHtmlCssPath.size()?uiHtmlCssPath.c_str():UI_HTML_THEME_CSS_RAW;
372     }
setUiHtmlCssPath(const std::string path)373     void setUiHtmlCssPath(const std::string path) {
374         if(!path.compare(UI_HTML_THEME_CSS_RAW)) uiHtmlCssPath.clear(); else uiHtmlCssPath = path;
375     }
getUiHtmlZoom()376     int getUiHtmlZoom() const { return uiHtmlZoom; }
incUiHtmlZoom()377     void incUiHtmlZoom() { if(uiHtmlZoom<500) uiHtmlZoom += 10; }
decUiHtmlZoom()378     void decUiHtmlZoom() { if(uiHtmlZoom>40) uiHtmlZoom-= 10; }
getUiHtmlZoomFactor()379     float getUiHtmlZoomFactor() const {
380         return static_cast<float>(uiHtmlZoom)/100.f;
381     }
382     /**
383      * @brief Set HTML zoom of Markdown viewer.
384      * @param zoom  value between 25% and 500%
385      */
setUiHtmlZoom(int zoom)386     void setUiHtmlZoom(int zoom) { uiHtmlZoom = zoom; }
387 
getJsLibSupportAsString(JavaScriptLibSupport s)388     const char* getJsLibSupportAsString(JavaScriptLibSupport s) const {
389         if(s==JavaScriptLibSupport::ONLINE) return UI_JS_LIB_ONLINE; else
390             if(s==JavaScriptLibSupport::OFFLINE) return UI_JS_LIB_OFFLINE; else return UI_JS_LIB_NO;
391     }
392 
isUiEnableSrcHighlightInMd()393     bool isUiEnableSrcHighlightInMd() {
394         return (md2HtmlOptions&MdToHtmlOption::CodeHighlighting)>0?true:false;
395     }
setUiEnableSrcHighlightInMd(bool enable)396     void setUiEnableSrcHighlightInMd(bool enable) {
397         if(enable) {
398             md2HtmlOptions |= MdToHtmlOption::CodeHighlighting;
399         } else {
400             md2HtmlOptions &= ~MdToHtmlOption::CodeHighlighting;
401         }
402     }
isUiEnableMathInMd()403     bool isUiEnableMathInMd() {
404         return (md2HtmlOptions&MdToHtmlOption::MathSupport)>0?true:false;
405     }
setUiEnableMathInMd(bool enable)406     void setUiEnableMathInMd(bool enable) {
407         if(enable) {
408             md2HtmlOptions |= MdToHtmlOption::MathSupport;
409         } else {
410             md2HtmlOptions &= ~MdToHtmlOption::MathSupport;
411         }
412     }
413 
getUiEnableDiagramsInMd()414     JavaScriptLibSupport getUiEnableDiagramsInMd() { return uiEnableDiagramsInMd; }
setUiEnableDiagramsInMd(JavaScriptLibSupport mode)415     void setUiEnableDiagramsInMd(JavaScriptLibSupport mode) { uiEnableDiagramsInMd = mode; }
416 
getNavigatorMaxNodes()417     int getNavigatorMaxNodes() const { return navigatorMaxNodes; }
setNavigatorMaxNodes(int navigatorMaxNodes)418     void setNavigatorMaxNodes(int navigatorMaxNodes) { this->navigatorMaxNodes = navigatorMaxNodes; }
isUiEditorTabsAsSpaces()419     bool isUiEditorTabsAsSpaces() const { return uiEditorTabsAsSpaces; }
setUiEditorTabsAsSpaces(bool uiEditorTabsAsSpaces)420     void setUiEditorTabsAsSpaces(bool uiEditorTabsAsSpaces){ this->uiEditorTabsAsSpaces = uiEditorTabsAsSpaces; }
isUiEditorAutosave()421     bool isUiEditorAutosave() const { return uiEditorAutosave; }
setUiEditorAutosave(bool uiEditorAutosave)422     void setUiEditorAutosave(bool uiEditorAutosave){ this->uiEditorAutosave = uiEditorAutosave; }
isUiFullOPreview()423     bool isUiFullOPreview() const { return uiFullOPreview; }
setUiFullOPreview(bool fullPreview)424     void setUiFullOPreview(bool fullPreview){ this->uiFullOPreview = fullPreview; }
isUiShowToolbar()425     bool isUiShowToolbar() const { return uiShowToolbar; }
setUiShowToolbar(bool showToolbar)426     void setUiShowToolbar(bool showToolbar){ this->uiShowToolbar = showToolbar; }
isUiExpertMode()427     bool isUiExpertMode() const { return uiExpertMode; }
setUiExpertMode(bool uiExpertMode)428     void setUiExpertMode(bool uiExpertMode){ this->uiExpertMode= uiExpertMode; }
isUiDistractionFreeMode()429     bool isUiDistractionFreeMode() const { return uiDistractionFreeMode; }
setUiDistractionFreeMode(bool distractionFreeMode)430     void setUiDistractionFreeMode(bool distractionFreeMode){ this->uiDistractionFreeMode = distractionFreeMode; }
isUiHoistedMode()431     bool isUiHoistedMode() const { return uiHoistedMode; }
setUiHoistedMode(bool hoisted)432     void setUiHoistedMode(bool hoisted){ this->uiHoistedMode = hoisted; }
isUiLiveNotePreview()433     bool isUiLiveNotePreview() const { return uiLiveNotePreview; }
setUiLiveNotePreview(bool isPreview)434     void setUiLiveNotePreview(bool isPreview){ this->uiLiveNotePreview = isPreview; }
getUiOsTableSortColumn()435     int getUiOsTableSortColumn() const { return uiOsTableSortColumn; }
setUiOsTableSortColumn(const int column)436     void setUiOsTableSortColumn(const int column) { this->uiOsTableSortColumn = column; }
isUiOsTableSortOrder()437     bool isUiOsTableSortOrder() const { return uiOsTableSortOrder; }
setUiOsTableSortOrder(const bool ascending)438     void setUiOsTableSortOrder(const bool ascending) { this->uiOsTableSortOrder = ascending; }
439 };
440 
441 } // namespace
442 
443 #endif /* M8R_CONFIGURATION_H_ */
444