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 | #include "ApplicationSettings.h" |
21 | |
22 | using namespace Calligra::Sheets; |
23 | |
24 | class ApplicationSettings::Private |
25 | { |
26 | public: |
27 | QColor gridColor; |
28 | QColor pageOutlineColor; |
29 | KGlobalSettings::Completion completionMode; |
30 | Calligra::Sheets::MoveTo moveTo; |
31 | MethodOfCalc calcMethod; |
32 | double indentValue; |
33 | bool verticalScrollBar : 1; |
34 | bool horizontalScrollBar : 1; |
35 | bool columnHeader : 1; |
36 | bool rowHeader : 1; |
37 | bool showStatusBar : 1; |
38 | bool showTabBar : 1; |
39 | bool captureAllArrowKeys : 1; |
40 | }; |
41 | |
42 | ApplicationSettings::ApplicationSettings() |
43 | : d(new Private) |
44 | { |
45 | d->gridColor = Qt::lightGray; |
46 | d->pageOutlineColor = Qt::red; |
47 | d->completionMode = KGlobalSettings::CompletionAuto; |
48 | d->moveTo = Bottom; |
49 | d->calcMethod = SumOfNumber; |
50 | d->indentValue = 10.0; |
51 | d->verticalScrollBar = true; |
52 | d->horizontalScrollBar = true; |
53 | d->columnHeader = true; |
54 | d->rowHeader = true; |
55 | d->showStatusBar = true; |
56 | d->showTabBar = true; |
57 | d->captureAllArrowKeys = true; |
58 | } |
59 | |
60 | ApplicationSettings::~ApplicationSettings() |
61 | { |
62 | delete d; |
63 | } |
64 | |
65 | void ApplicationSettings::load() |
66 | { |
67 | } |
68 | |
69 | void ApplicationSettings::save() const |
70 | { |
71 | } |
72 | |
73 | void ApplicationSettings::setShowVerticalScrollBar(bool show) |
74 | { |
75 | d->verticalScrollBar = show; |
76 | } |
77 | |
78 | bool ApplicationSettings::showVerticalScrollBar()const |
79 | { |
80 | return d->verticalScrollBar; |
81 | } |
82 | |
83 | void ApplicationSettings::setShowHorizontalScrollBar(bool show) |
84 | { |
85 | d->horizontalScrollBar = show; |
86 | } |
87 | |
88 | bool ApplicationSettings::showHorizontalScrollBar()const |
89 | { |
90 | return d->horizontalScrollBar; |
91 | } |
92 | |
93 | KGlobalSettings::Completion ApplicationSettings::completionMode() const |
94 | { |
95 | return d->completionMode; |
96 | } |
97 | |
98 | void ApplicationSettings::setShowColumnHeader(bool show) |
99 | { |
100 | d->columnHeader = show; |
101 | } |
102 | |
103 | bool ApplicationSettings::showColumnHeader() const |
104 | { |
105 | return d->columnHeader; |
106 | } |
107 | |
108 | void ApplicationSettings::setShowRowHeader(bool show) |
109 | { |
110 | d->rowHeader = show; |
111 | } |
112 | |
113 | bool ApplicationSettings::showRowHeader() const |
114 | { |
115 | return d->rowHeader; |
116 | } |
117 | |
118 | void ApplicationSettings::setGridColor(const QColor& color) |
119 | { |
120 | d->gridColor = color; |
121 | } |
122 | |
123 | QColor ApplicationSettings::gridColor() const |
124 | { |
125 | return d->gridColor; |
126 | } |
127 | |
128 | void ApplicationSettings::setCompletionMode(KGlobalSettings::Completion complMode) |
129 | { |
130 | d->completionMode = complMode; |
131 | } |
132 | |
133 | double ApplicationSettings::indentValue() const |
134 | { |
135 | return d->indentValue; |
136 | } |
137 | |
138 | void ApplicationSettings::setIndentValue(double val) |
139 | { |
140 | d->indentValue = val; |
141 | } |
142 | |
143 | void ApplicationSettings::setShowStatusBar(bool statusBar) |
144 | { |
145 | d->showStatusBar = statusBar; |
146 | } |
147 | |
148 | bool ApplicationSettings::showStatusBar() const |
149 | { |
150 | return d->showStatusBar; |
151 | } |
152 | |
153 | void ApplicationSettings::setShowTabBar(bool tabbar) |
154 | { |
155 | d->showTabBar = tabbar; |
156 | } |
157 | |
158 | bool ApplicationSettings::showTabBar()const |
159 | { |
160 | return d->showTabBar; |
161 | } |
162 | |
163 | Calligra::Sheets::MoveTo ApplicationSettings::moveToValue() const |
164 | { |
165 | return d->moveTo; |
166 | } |
167 | |
168 | void ApplicationSettings::setMoveToValue(Calligra::Sheets::MoveTo moveTo) |
169 | { |
170 | d->moveTo = moveTo; |
171 | } |
172 | |
173 | void ApplicationSettings::setTypeOfCalc(MethodOfCalc calc) |
174 | { |
175 | d->calcMethod = calc; |
176 | } |
177 | |
178 | MethodOfCalc ApplicationSettings::getTypeOfCalc() const |
179 | { |
180 | return d->calcMethod; |
181 | } |
182 | |
183 | QColor ApplicationSettings::pageOutlineColor() const |
184 | { |
185 | return d->pageOutlineColor; |
186 | } |
187 | |
188 | void ApplicationSettings::changePageOutlineColor(const QColor& color) |
189 | { |
190 | d->pageOutlineColor = color; |
191 | } |
192 | |
193 | void ApplicationSettings::setCaptureAllArrowKeys(bool capture) |
194 | { |
195 | d->captureAllArrowKeys = capture; |
196 | } |
197 | |
198 | bool ApplicationSettings::captureAllArrowKeys() const |
199 | { |
200 | return d->captureAllArrowKeys; |
201 | } |
202 |