File indexing completed on 2024-04-28 16:21:16
0001 /* This file is part of the KDE project 0002 Copyright 2008 Stefan Nikolaus <stefan.nikolaus@kdemail.net> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #include "ApplicationSettings.h" 0021 0022 using namespace Calligra::Sheets; 0023 0024 class Q_DECL_HIDDEN ApplicationSettings::Private 0025 { 0026 public: 0027 QColor gridColor; 0028 QColor pageOutlineColor; 0029 KCompletion::CompletionMode completionMode; 0030 Calligra::Sheets::MoveTo moveTo; 0031 MethodOfCalc calcMethod; 0032 double indentValue; 0033 bool verticalScrollBar : 1; 0034 bool horizontalScrollBar : 1; 0035 bool columnHeader : 1; 0036 bool rowHeader : 1; 0037 bool showStatusBar : 1; 0038 bool showTabBar : 1; 0039 }; 0040 0041 ApplicationSettings::ApplicationSettings() 0042 : d(new Private) 0043 { 0044 d->gridColor = Qt::lightGray; 0045 d->pageOutlineColor = Qt::red; 0046 d->completionMode = KCompletion::CompletionAuto; 0047 d->moveTo = Bottom; 0048 d->calcMethod = SumOfNumber; 0049 d->indentValue = 10.0; 0050 d->verticalScrollBar = true; 0051 d->horizontalScrollBar = true; 0052 d->columnHeader = true; 0053 d->rowHeader = true; 0054 d->showStatusBar = true; 0055 d->showTabBar = true; 0056 } 0057 0058 ApplicationSettings::~ApplicationSettings() 0059 { 0060 delete d; 0061 } 0062 0063 void ApplicationSettings::load() 0064 { 0065 } 0066 0067 void ApplicationSettings::save() const 0068 { 0069 } 0070 0071 void ApplicationSettings::setShowVerticalScrollBar(bool show) 0072 { 0073 d->verticalScrollBar = show; 0074 } 0075 0076 bool ApplicationSettings::showVerticalScrollBar()const 0077 { 0078 return d->verticalScrollBar; 0079 } 0080 0081 void ApplicationSettings::setShowHorizontalScrollBar(bool show) 0082 { 0083 d->horizontalScrollBar = show; 0084 } 0085 0086 bool ApplicationSettings::showHorizontalScrollBar()const 0087 { 0088 return d->horizontalScrollBar; 0089 } 0090 0091 KCompletion::CompletionMode ApplicationSettings::completionMode() const 0092 { 0093 return d->completionMode; 0094 } 0095 0096 void ApplicationSettings::setShowColumnHeader(bool show) 0097 { 0098 d->columnHeader = show; 0099 } 0100 0101 bool ApplicationSettings::showColumnHeader() const 0102 { 0103 return d->columnHeader; 0104 } 0105 0106 void ApplicationSettings::setShowRowHeader(bool show) 0107 { 0108 d->rowHeader = show; 0109 } 0110 0111 bool ApplicationSettings::showRowHeader() const 0112 { 0113 return d->rowHeader; 0114 } 0115 0116 void ApplicationSettings::setGridColor(const QColor& color) 0117 { 0118 d->gridColor = color; 0119 } 0120 0121 QColor ApplicationSettings::gridColor() const 0122 { 0123 return d->gridColor; 0124 } 0125 0126 void ApplicationSettings::setCompletionMode(KCompletion::CompletionMode complMode) 0127 { 0128 d->completionMode = complMode; 0129 } 0130 0131 double ApplicationSettings::indentValue() const 0132 { 0133 return d->indentValue; 0134 } 0135 0136 void ApplicationSettings::setIndentValue(double val) 0137 { 0138 d->indentValue = val; 0139 } 0140 0141 void ApplicationSettings::setShowStatusBar(bool statusBar) 0142 { 0143 d->showStatusBar = statusBar; 0144 } 0145 0146 bool ApplicationSettings::showStatusBar() const 0147 { 0148 return d->showStatusBar; 0149 } 0150 0151 void ApplicationSettings::setShowTabBar(bool tabbar) 0152 { 0153 d->showTabBar = tabbar; 0154 } 0155 0156 bool ApplicationSettings::showTabBar()const 0157 { 0158 return d->showTabBar; 0159 } 0160 0161 Calligra::Sheets::MoveTo ApplicationSettings::moveToValue() const 0162 { 0163 return d->moveTo; 0164 } 0165 0166 void ApplicationSettings::setMoveToValue(Calligra::Sheets::MoveTo moveTo) 0167 { 0168 d->moveTo = moveTo; 0169 } 0170 0171 void ApplicationSettings::setTypeOfCalc(MethodOfCalc calc) 0172 { 0173 d->calcMethod = calc; 0174 } 0175 0176 MethodOfCalc ApplicationSettings::getTypeOfCalc() const 0177 { 0178 return d->calcMethod; 0179 } 0180 0181 QColor ApplicationSettings::pageOutlineColor() const 0182 { 0183 return d->pageOutlineColor; 0184 } 0185 0186 void ApplicationSettings::changePageOutlineColor(const QColor& color) 0187 { 0188 d->pageOutlineColor = color; 0189 } 0190