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