Salome HOME
Remove unnecessary trace from CMake.
[modules/gui.git] / src / PyEditor / PyEditor_Settings.h
1 // Copyright (C) 2015-2016  OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // File   : PyEditor_Settings.h
20 // Author : Maxim GLIBIN, Open CASCADE S.A.S. (maxim.glibin@opencascade.com)
21 //
22
23 #ifndef PYEDITOR_SETTINGS_H
24 #define PYEDITOR_SETTINGS_H
25
26 #include <QFont>
27 #include "PyEditor.h"
28
29 class QSettings;
30 class QtxResourceMgr;
31
32 const char* const PY_EDITOR          = "PythonEditor";
33 const char* const HIGHLIGHT_CURRLINE = "HighlightCurrentLine";
34 const char* const LINE_NUMBER_AREA   = "LineNumberArea";
35 const char* const TEXT_WRAP          = "TextWrapping";
36 const char* const CURSOR_SCROLL      = "CenterCursorOnScroll";
37 const char* const TAB_WHITESPACES    = "TabSpaceVisible";
38 const char* const TAB_SIZE           = "TabSize";
39 const char* const VERTICAL_EDGE      = "VerticalEdge";
40 const char* const NUM_COLUMNS        = "NumberColumns";
41 const char* const FONT_FAMILY        = "FontFamily";
42 const char* const FONT_SIZE          = "FontSize";
43
44 class PYEDITOR_EXPORT PyEditor_Settings
45 {
46 public:
47   PyEditor_Settings( QtxResourceMgr* = 0 ,  bool isSingle = true );
48
49   void readSettings();
50   void writeSettings();
51
52   void fromSettings( const QString& );
53   void toSettings( const QString& ) const;
54
55   void readPreferences();
56   void writePreferences();
57
58   bool isSingle();
59   
60   // Display settings
61   bool p_HighlightCurrentLine;
62   bool p_TextWrapping;
63   bool p_CenterCursorOnScroll;
64   bool p_LineNumberArea;
65   
66   // Vertical edge settings
67   bool p_VerticalEdge;
68   int  p_NumberColumns;
69   
70   // Tab settings
71   bool p_TabSpaceVisible;
72   int  p_TabSize;
73   
74   // Font settings
75   QFont p_Font;
76
77 private:
78   QSettings*      m_Settings;
79   QtxResourceMgr* m_ResourceMgr;
80   bool            m_Single;
81 };
82
83 #endif // PYEDITOR_SETTINGS_H