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 #ifndef KSPREADAPPLICATIONSETTINGS 0021 #define KSPREADAPPLICATIONSETTINGS 0022 0023 #include <KCompletion> 0024 0025 #include <QColor> 0026 #include <QObject> 0027 0028 #include "Global.h" 0029 #include "sheets_odf_export.h" 0030 0031 namespace Calligra 0032 { 0033 namespace Sheets 0034 { 0035 0036 /** 0037 * Visual settings. 0038 */ 0039 class CALLIGRA_SHEETS_ODF_EXPORT ApplicationSettings : public QObject 0040 { 0041 Q_OBJECT 0042 Q_PROPERTY(bool showVerticalScrollBar READ showVerticalScrollBar WRITE setShowVerticalScrollBar) 0043 Q_PROPERTY(bool showHorizontalScrollBar READ showHorizontalScrollBar WRITE setShowHorizontalScrollBar) 0044 Q_PROPERTY(bool showColumnHeader READ showColumnHeader WRITE setShowColumnHeader) 0045 Q_PROPERTY(bool showRowHeader READ showRowHeader WRITE setShowRowHeader) 0046 Q_PROPERTY(bool showStatusBar READ showStatusBar WRITE setShowStatusBar) 0047 Q_PROPERTY(bool showTabBar READ showTabBar WRITE setShowTabBar) 0048 0049 public: 0050 /** 0051 * Constructor. 0052 */ 0053 ApplicationSettings(); 0054 0055 /** 0056 * Destructor. 0057 */ 0058 ~ApplicationSettings() override; 0059 0060 void load(); 0061 void save() const; 0062 0063 /** 0064 * If \c enable is true, vertical scrollbar is visible, otherwise 0065 * it will be hidden. 0066 */ 0067 void setShowVerticalScrollBar(bool enable); 0068 0069 /** 0070 * Returns true if vertical scroll bar is visible. 0071 */ 0072 bool showVerticalScrollBar() const; 0073 0074 /** 0075 * If \c enable is true, horizontal scrollbar is visible, otherwise 0076 * it will be hidden. 0077 */ 0078 void setShowHorizontalScrollBar(bool enable); 0079 0080 /** 0081 * Returns true if horizontal scroll bar is visible. 0082 */ 0083 bool showHorizontalScrollBar() const; 0084 0085 /** 0086 * If \c enable is true, column header is visible, otherwise 0087 * it will be hidden. 0088 */ 0089 void setShowColumnHeader(bool enable); 0090 0091 /** 0092 * Returns true if column header is visible. 0093 */ 0094 bool showColumnHeader() const; 0095 0096 /** 0097 * If \c enable is true, row header is visible, otherwise 0098 * it will be hidden. 0099 */ 0100 void setShowRowHeader(bool enable); 0101 0102 /** 0103 * Returns true if row header is visible. 0104 */ 0105 bool showRowHeader() const; 0106 0107 /** 0108 * Sets the color of the grid. 0109 */ 0110 void setGridColor(const QColor& color); 0111 0112 /** 0113 * Returns the color of the grid. 0114 */ 0115 QColor gridColor() const; 0116 0117 /** 0118 * Sets the indentation value. 0119 */ 0120 void setIndentValue(double val); 0121 0122 /** 0123 * Returns the indentation value. 0124 */ 0125 double indentValue() const; 0126 0127 /** 0128 * If \c enable is true, status bar is visible, otherwise 0129 * it will be hidden. 0130 */ 0131 void setShowStatusBar(bool enable); 0132 0133 /** 0134 * Returns true if status bar is visible. 0135 */ 0136 bool showStatusBar() const; 0137 0138 /** 0139 * If \c enable is true, tab bar is visible, otherwise 0140 * it will be hidden. 0141 */ 0142 void setShowTabBar(bool enable); 0143 0144 /** 0145 * Returns true if tab bar is visible. 0146 */ 0147 bool showTabBar() const; 0148 0149 /** 0150 * @return completion mode 0151 */ 0152 KCompletion::CompletionMode completionMode() const; 0153 0154 /** 0155 * Sets the completion mode. 0156 * @param mode the mode to be set 0157 */ 0158 void setCompletionMode(KCompletion::CompletionMode mode); 0159 0160 Calligra::Sheets::MoveTo moveToValue() const; 0161 void setMoveToValue(Calligra::Sheets::MoveTo moveTo); 0162 0163 /** 0164 * Method of calc 0165 */ 0166 void setTypeOfCalc(MethodOfCalc calc); 0167 MethodOfCalc getTypeOfCalc() const; 0168 0169 QColor pageOutlineColor() const; 0170 void changePageOutlineColor(const QColor& color); 0171 0172 private: 0173 class Private; 0174 Private * const d; 0175 }; 0176 0177 } // namespace Sheets 0178 } // namespace Calligra 0179 0180 #endif // KSPREADAPPLICATIONSETTINGS