1 | /* This file is part of the KDE project |
2 | Copyright 2008 Stefan Nikolaus <stefan.nikolaus@kdemail.net> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef KSPREADAPPLICATIONSETTINGS |
21 | #define KSPREADAPPLICATIONSETTINGS |
22 | |
23 | #include <kglobalsettings.h> |
24 | |
25 | #include <QColor> |
26 | #include <QObject> |
27 | |
28 | #include "Global.h" |
29 | #include "calligra_sheets_export.h" |
30 | |
31 | namespace Calligra |
32 | { |
33 | namespace Sheets |
34 | { |
35 | |
36 | /** |
37 | * Visual settings. |
38 | */ |
39 | class CALLIGRA_SHEETS_ODF_EXPORT ApplicationSettings : public QObject |
40 | { |
41 | Q_OBJECT |
42 | Q_PROPERTY(bool showVerticalScrollBar READ showVerticalScrollBar WRITE setShowVerticalScrollBar) |
43 | Q_PROPERTY(bool showHorizontalScrollBar READ showHorizontalScrollBar WRITE setShowHorizontalScrollBar) |
44 | Q_PROPERTY(bool showColumnHeader READ showColumnHeader WRITE setShowColumnHeader) |
45 | Q_PROPERTY(bool showRowHeader READ showRowHeader WRITE setShowRowHeader) |
46 | Q_PROPERTY(bool showStatusBar READ showStatusBar WRITE setShowStatusBar) |
47 | Q_PROPERTY(bool showTabBar READ showTabBar WRITE setShowTabBar) |
48 | |
49 | public: |
50 | /** |
51 | * Constructor. |
52 | */ |
53 | ApplicationSettings(); |
54 | |
55 | /** |
56 | * Destructor. |
57 | */ |
58 | ~ApplicationSettings(); |
59 | |
60 | void load(); |
61 | void save() const; |
62 | |
63 | /** |
64 | * If \c enable is true, vertical scrollbar is visible, otherwise |
65 | * it will be hidden. |
66 | */ |
67 | void setShowVerticalScrollBar(bool enable); |
68 | |
69 | /** |
70 | * Returns true if vertical scroll bar is visible. |
71 | */ |
72 | bool showVerticalScrollBar() const; |
73 | |
74 | /** |
75 | * If \c enable is true, horizontal scrollbar is visible, otherwise |
76 | * it will be hidden. |
77 | */ |
78 | void setShowHorizontalScrollBar(bool enable); |
79 | |
80 | /** |
81 | * Returns true if horizontal scroll bar is visible. |
82 | */ |
83 | bool showHorizontalScrollBar() const; |
84 | |
85 | /** |
86 | * If \c enable is true, column header is visible, otherwise |
87 | * it will be hidden. |
88 | */ |
89 | void setShowColumnHeader(bool enable); |
90 | |
91 | /** |
92 | * Returns true if column header is visible. |
93 | */ |
94 | bool showColumnHeader() const; |
95 | |
96 | /** |
97 | * If \c enable is true, row header is visible, otherwise |
98 | * it will be hidden. |
99 | */ |
100 | void (bool enable); |
101 | |
102 | /** |
103 | * Returns true if row header is visible. |
104 | */ |
105 | bool () const; |
106 | |
107 | /** |
108 | * Sets the color of the grid. |
109 | */ |
110 | void setGridColor(const QColor& color); |
111 | |
112 | /** |
113 | * Returns the color of the grid. |
114 | */ |
115 | QColor gridColor() const; |
116 | |
117 | /** |
118 | * Sets the indentation value. |
119 | */ |
120 | void setIndentValue(double val); |
121 | |
122 | /** |
123 | * Returns the indentation value. |
124 | */ |
125 | double indentValue() const; |
126 | |
127 | /** |
128 | * If \c enable is true, status bar is visible, otherwise |
129 | * it will be hidden. |
130 | */ |
131 | void setShowStatusBar(bool enable); |
132 | |
133 | /** |
134 | * Returns true if status bar is visible. |
135 | */ |
136 | bool showStatusBar() const; |
137 | |
138 | /** |
139 | * If \c enable is true, tab bar is visible, otherwise |
140 | * it will be hidden. |
141 | */ |
142 | void setShowTabBar(bool enable); |
143 | |
144 | /** |
145 | * Returns true if tab bar is visible. |
146 | */ |
147 | bool showTabBar() const; |
148 | |
149 | /** |
150 | * @return completion mode |
151 | */ |
152 | KGlobalSettings::Completion completionMode() const; |
153 | |
154 | /** |
155 | * Sets the completion mode. |
156 | * @param mode the mode to be set |
157 | */ |
158 | void setCompletionMode(KGlobalSettings::Completion mode); |
159 | |
160 | Calligra::Sheets::MoveTo moveToValue() const; |
161 | void setMoveToValue(Calligra::Sheets::MoveTo moveTo); |
162 | |
163 | /** |
164 | * Method of calc |
165 | */ |
166 | void setTypeOfCalc(MethodOfCalc calc); |
167 | MethodOfCalc getTypeOfCalc() const; |
168 | |
169 | QColor pageOutlineColor() const; |
170 | void changePageOutlineColor(const QColor& color); |
171 | |
172 | void setCaptureAllArrowKeys(bool capture); |
173 | bool captureAllArrowKeys() const; |
174 | |
175 | private: |
176 | class Private; |
177 | Private * const d; |
178 | }; |
179 | |
180 | } // namespace Sheets |
181 | } // namespace Calligra |
182 | |
183 | #endif // KSPREADAPPLICATIONSETTINGS |
184 | |