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 Q_DECL_HIDDEN ApplicationSettings::Private
25 {
26 public:
27     QColor gridColor;
28     QColor pageOutlineColor;
29     KCompletion::CompletionMode 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 };
40 
ApplicationSettings()41 ApplicationSettings::ApplicationSettings()
42         : d(new Private)
43 {
44     d->gridColor = Qt::lightGray;
45     d->pageOutlineColor = Qt::red;
46     d->completionMode = KCompletion::CompletionAuto;
47     d->moveTo = Bottom;
48     d->calcMethod = SumOfNumber;
49     d->indentValue = 10.0;
50     d->verticalScrollBar = true;
51     d->horizontalScrollBar = true;
52     d->columnHeader = true;
53     d->rowHeader = true;
54     d->showStatusBar = true;
55     d->showTabBar = true;
56 }
57 
~ApplicationSettings()58 ApplicationSettings::~ApplicationSettings()
59 {
60     delete d;
61 }
62 
load()63 void ApplicationSettings::load()
64 {
65 }
66 
save() const67 void ApplicationSettings::save() const
68 {
69 }
70 
setShowVerticalScrollBar(bool show)71 void ApplicationSettings::setShowVerticalScrollBar(bool show)
72 {
73     d->verticalScrollBar = show;
74 }
75 
showVerticalScrollBar() const76 bool ApplicationSettings::showVerticalScrollBar()const
77 {
78     return d->verticalScrollBar;
79 }
80 
setShowHorizontalScrollBar(bool show)81 void ApplicationSettings::setShowHorizontalScrollBar(bool show)
82 {
83     d->horizontalScrollBar = show;
84 }
85 
showHorizontalScrollBar() const86 bool ApplicationSettings::showHorizontalScrollBar()const
87 {
88     return d->horizontalScrollBar;
89 }
90 
completionMode() const91 KCompletion::CompletionMode ApplicationSettings::completionMode() const
92 {
93     return d->completionMode;
94 }
95 
setShowColumnHeader(bool show)96 void ApplicationSettings::setShowColumnHeader(bool show)
97 {
98     d->columnHeader = show;
99 }
100 
showColumnHeader() const101 bool ApplicationSettings::showColumnHeader() const
102 {
103     return d->columnHeader;
104 }
105 
setShowRowHeader(bool show)106 void ApplicationSettings::setShowRowHeader(bool show)
107 {
108     d->rowHeader = show;
109 }
110 
showRowHeader() const111 bool ApplicationSettings::showRowHeader() const
112 {
113     return d->rowHeader;
114 }
115 
setGridColor(const QColor & color)116 void ApplicationSettings::setGridColor(const QColor& color)
117 {
118     d->gridColor = color;
119 }
120 
gridColor() const121 QColor ApplicationSettings::gridColor() const
122 {
123     return d->gridColor;
124 }
125 
setCompletionMode(KCompletion::CompletionMode complMode)126 void ApplicationSettings::setCompletionMode(KCompletion::CompletionMode complMode)
127 {
128     d->completionMode = complMode;
129 }
130 
indentValue() const131 double ApplicationSettings::indentValue() const
132 {
133     return d->indentValue;
134 }
135 
setIndentValue(double val)136 void ApplicationSettings::setIndentValue(double val)
137 {
138     d->indentValue = val;
139 }
140 
setShowStatusBar(bool statusBar)141 void ApplicationSettings::setShowStatusBar(bool statusBar)
142 {
143     d->showStatusBar = statusBar;
144 }
145 
showStatusBar() const146 bool ApplicationSettings::showStatusBar() const
147 {
148     return d->showStatusBar;
149 }
150 
setShowTabBar(bool tabbar)151 void ApplicationSettings::setShowTabBar(bool tabbar)
152 {
153     d->showTabBar = tabbar;
154 }
155 
showTabBar() const156 bool ApplicationSettings::showTabBar()const
157 {
158     return d->showTabBar;
159 }
160 
moveToValue() const161 Calligra::Sheets::MoveTo ApplicationSettings::moveToValue() const
162 {
163     return d->moveTo;
164 }
165 
setMoveToValue(Calligra::Sheets::MoveTo moveTo)166 void ApplicationSettings::setMoveToValue(Calligra::Sheets::MoveTo moveTo)
167 {
168     d->moveTo = moveTo;
169 }
170 
setTypeOfCalc(MethodOfCalc calc)171 void ApplicationSettings::setTypeOfCalc(MethodOfCalc calc)
172 {
173     d->calcMethod = calc;
174 }
175 
getTypeOfCalc() const176 MethodOfCalc ApplicationSettings::getTypeOfCalc() const
177 {
178     return d->calcMethod;
179 }
180 
pageOutlineColor() const181 QColor ApplicationSettings::pageOutlineColor() const
182 {
183     return d->pageOutlineColor;
184 }
185 
changePageOutlineColor(const QColor & color)186 void ApplicationSettings::changePageOutlineColor(const QColor& color)
187 {
188     d->pageOutlineColor = color;
189 }
190 
191