File indexing completed on 2024-05-12 05:55:18

0001 // This file is part of the SpeedCrunch project
0002 // Copyright (C) 2004 Ariya Hidayat <ariya@kde.org>
0003 // Copyright (C) 2005-2006 Johan Thelin <e8johan@gmail.com>
0004 // Copyright (C) 2007-2016 @heldercorreia
0005 // Copyright (C) 2015 Pol Welter <polwelter@gmail.com>
0006 //
0007 // This program is free software; you can redistribute it and/or
0008 // modify it under the terms of the GNU General Public License
0009 // as published by the Free Software Foundation; either version 2
0010 // of the License, or (at your option) any later version.
0011 //
0012 // This program is distributed in the hope that it will be useful,
0013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 // GNU General Public License for more details.
0016 //
0017 // You should have received a copy of the GNU General Public License
0018 // along with this program; see the file COPYING.  If not, write to
0019 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020 // Boston, MA 02110-1301, USA.
0021 
0022 #ifndef CORE_SETTINGS_H
0023 #define CORE_SETTINGS_H
0024 
0025 #include <QtCore/QPoint>
0026 #include <QtCore/QSize>
0027 #include <QtCore/QStringList>
0028 #include <QtCore/QList>
0029 
0030 class Settings {
0031 public:
0032     static Settings* instance();
0033     static QString getConfigPath();
0034     static QString getDataPath();
0035     static QString getCachePath();
0036 
0037     void load();
0038     void save();
0039 
0040     char radixCharacter() const; // 0 or '*': Automatic.
0041     void setRadixCharacter(char c = 0);
0042     bool isRadixCharacterAuto() const;
0043     bool isRadixCharacterBoth() const;
0044 
0045     bool complexNumbers;
0046 
0047     char angleUnit; // 'r': radian; 'd': degree; 'g': gradian.
0048 
0049     char resultFormat;
0050     int resultPrecision; // See HMath documentation.
0051     char resultFormatComplex; // 'c' cartesian; 'p' polar.
0052 
0053     bool autoAns;
0054     bool autoCalc;
0055     bool autoCompletion;
0056     int digitGrouping;
0057     bool sessionSave;
0058     bool leaveLastExpression;
0059     bool syntaxHighlighting;
0060     bool windowAlwaysOnTop;
0061     bool autoResultToClipboard;
0062     bool windowPositionSave;
0063 
0064     bool constantsDockVisible;
0065     bool functionsDockVisible;
0066     bool historyDockVisible;
0067     bool keypadVisible;
0068     bool formulaBookDockVisible;
0069     bool statusBarVisible;
0070     bool variablesDockVisible;
0071     bool userFunctionsDockVisible;
0072     bool windowOnfullScreen;
0073     bool bitfieldVisible;
0074 
0075     QString colorScheme;
0076     QString displayFont;
0077 
0078     QString language;
0079 
0080     QByteArray windowState;
0081     QByteArray windowGeometry;
0082     QByteArray manualWindowGeometry;
0083 
0084 private:
0085     Settings();
0086     Q_DISABLE_COPY(Settings)
0087 };
0088 
0089 #endif