kspread
ApplicationSettings.cpp
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright 2008 Stefan Nikolaus <stefan.nikolaus@kdemail.net> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "ApplicationSettings.h" 00021 00022 using namespace KSpread; 00023 00024 class ApplicationSettings::Private 00025 { 00026 public: 00027 QColor gridColor; 00028 QColor pageBorderColor; 00029 KGlobalSettings::Completion completionMode; 00030 KSpread::MoveTo moveTo; 00031 MethodOfCalc calcMethod; 00032 double indentValue; 00033 bool verticalScrollBar : 1; 00034 bool horizontalScrollBar : 1; 00035 bool columnHeader : 1; 00036 bool rowHeader : 1; 00037 bool showStatusBar : 1; 00038 bool showTabBar : 1; 00039 bool captureAllArrowKeys : 1; 00040 }; 00041 00042 ApplicationSettings::ApplicationSettings() 00043 : d(new Private) 00044 { 00045 d->gridColor = Qt::lightGray; 00046 d->pageBorderColor = Qt::red; 00047 d->completionMode = KGlobalSettings::CompletionAuto; 00048 d->moveTo = Bottom; 00049 d->calcMethod = SumOfNumber; 00050 d->indentValue = 10.0; 00051 d->verticalScrollBar = true; 00052 d->horizontalScrollBar = true; 00053 d->columnHeader = true; 00054 d->rowHeader = true; 00055 d->showStatusBar = true; 00056 d->showTabBar = true; 00057 d->captureAllArrowKeys = true; 00058 } 00059 00060 ApplicationSettings::~ApplicationSettings() 00061 { 00062 delete d; 00063 } 00064 00065 void ApplicationSettings::load() 00066 { 00067 } 00068 00069 void ApplicationSettings::save() const 00070 { 00071 } 00072 00073 void ApplicationSettings::setShowVerticalScrollBar(bool show) 00074 { 00075 d->verticalScrollBar = show; 00076 } 00077 00078 bool ApplicationSettings::showVerticalScrollBar()const 00079 { 00080 return d->verticalScrollBar; 00081 } 00082 00083 void ApplicationSettings::setShowHorizontalScrollBar(bool show) 00084 { 00085 d->horizontalScrollBar = show; 00086 } 00087 00088 bool ApplicationSettings::showHorizontalScrollBar()const 00089 { 00090 return d->horizontalScrollBar; 00091 } 00092 00093 KGlobalSettings::Completion ApplicationSettings::completionMode() const 00094 { 00095 return d->completionMode; 00096 } 00097 00098 void ApplicationSettings::setShowColumnHeader(bool show) 00099 { 00100 d->columnHeader = show; 00101 } 00102 00103 bool ApplicationSettings::showColumnHeader() const 00104 { 00105 return d->columnHeader; 00106 } 00107 00108 void ApplicationSettings::setShowRowHeader(bool show) 00109 { 00110 d->rowHeader=show; 00111 } 00112 00113 bool ApplicationSettings::showRowHeader() const 00114 { 00115 return d->rowHeader; 00116 } 00117 00118 void ApplicationSettings::setGridColor(const QColor& color) 00119 { 00120 d->gridColor = color; 00121 } 00122 00123 QColor ApplicationSettings::gridColor() const 00124 { 00125 return d->gridColor; 00126 } 00127 00128 void ApplicationSettings::setCompletionMode(KGlobalSettings::Completion complMode) 00129 { 00130 d->completionMode = complMode; 00131 } 00132 00133 double ApplicationSettings::indentValue() const 00134 { 00135 return d->indentValue; 00136 } 00137 00138 void ApplicationSettings::setIndentValue(double val) 00139 { 00140 d->indentValue = val; 00141 } 00142 00143 void ApplicationSettings::setShowStatusBar(bool statusBar) 00144 { 00145 d->showStatusBar = statusBar; 00146 } 00147 00148 bool ApplicationSettings::showStatusBar() const 00149 { 00150 return d->showStatusBar; 00151 } 00152 00153 void ApplicationSettings::setShowTabBar(bool tabbar) 00154 { 00155 d->showTabBar = tabbar; 00156 } 00157 00158 bool ApplicationSettings::showTabBar()const 00159 { 00160 return d->showTabBar; 00161 } 00162 00163 KSpread::MoveTo ApplicationSettings::moveToValue() const 00164 { 00165 return d->moveTo; 00166 } 00167 00168 void ApplicationSettings::setMoveToValue(KSpread::MoveTo moveTo) 00169 { 00170 d->moveTo = moveTo; 00171 } 00172 00173 void ApplicationSettings::setTypeOfCalc(MethodOfCalc calc) 00174 { 00175 d->calcMethod = calc; 00176 } 00177 00178 MethodOfCalc ApplicationSettings::getTypeOfCalc() const 00179 { 00180 return d->calcMethod; 00181 } 00182 00183 QColor ApplicationSettings::pageBorderColor() const 00184 { 00185 return d->pageBorderColor; 00186 } 00187 00188 void ApplicationSettings::changePageBorderColor(const QColor& color) 00189 { 00190 d->pageBorderColor = color; 00191 } 00192 00193 void ApplicationSettings::setCaptureAllArrowKeys(bool capture) 00194 { 00195 d->captureAllArrowKeys = capture; 00196 } 00197 00198 bool ApplicationSettings::captureAllArrowKeys() const 00199 { 00200 return d->captureAllArrowKeys; 00201 }
