Debian Codegraph @

src/Gui/PreferencePages/DlgSettingsEditor.h

raw
1 /***************************************************************************
2 * Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.net> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library 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 Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23
24 #ifndef GUI_DIALOG_DLGSETTINGSEDITOR_H
25 #define GUI_DIALOG_DLGSETTINGSEDITOR_H
26
27 #include <Gui/PropertyPage.h>
28 #include <memory>
29
30 class QTreeWidgetItem;
31
32 namespace Gui
33 {
34 class PythonSyntaxHighlighter;
35
36 namespace Dialog
37 {
38 class Ui_DlgSettingsEditor;
39
40 /** This class implements a preferences page for the editor settings.
41 * Here you can change different color settings and font for editors.
42 * @author Werner Mayer
43 */
44 struct DlgSettingsEditorP;
45 class DlgSettingsEditor: public PreferencePage
46 {
47 Q_OBJECT
48
49 public:
50 explicit DlgSettingsEditor(QWidget* parent = nullptr);
51 ~DlgSettingsEditor() override;
52
53 public:
54 void saveSettings() override;
55 void loadSettings() override;
56 void resetSettingsToDefaults() override;
57
58 private:
59 void setupConnections();
60 void onDisplayItemsCurrentItemChanged(QTreeWidgetItem* i);
61 void onColorButtonChanged();
62 void onFontFamilyActivated(const QString&);
63 void onFontSizeValueChanged(const QString&);
64
65 protected:
66 void changeEvent(QEvent* e) override;
67 void setEditorTabWidth(int);
68
69 private:
70 std::unique_ptr<Ui_DlgSettingsEditor> ui;
71 DlgSettingsEditorP* d;
72 Gui::PythonSyntaxHighlighter* pythonSyntax;
73
74 DlgSettingsEditor(const DlgSettingsEditor&);
75 DlgSettingsEditor& operator=(const DlgSettingsEditor&);
76 };
77
78 } // namespace Dialog
79 } // namespace Gui
80
81 #endif // GUI_DIALOG_DLGSETTINGSEDITOR_H