File indexing completed on 2024-05-05 17:04:25
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2012 Arjen Hiemstra <ahiemstra@heimr.nl> 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 CONSTANTS_H 0021 #define CONSTANTS_H 0022 0023 #include <QObject> 0024 #include <QColor> 0025 0026 class Constants : public QObject 0027 { 0028 Q_OBJECT 0029 Q_PROPERTY(int AnimationDuration READ animationDuration CONSTANT) 0030 Q_PROPERTY(int GridRows READ gridRows NOTIFY gridSizeChanged) 0031 Q_PROPERTY(int GridColumns READ gridColumns CONSTANT) 0032 Q_PROPERTY(bool IsLandscape READ isLandscape NOTIFY gridSizeChanged) 0033 Q_PROPERTY(qreal DefaultMargin READ defaultMargin NOTIFY gridSizeChanged) 0034 Q_PROPERTY(qreal GridHeight READ gridHeight NOTIFY gridSizeChanged) 0035 Q_PROPERTY(qreal GridWidth READ gridWidth NOTIFY gridSizeChanged) 0036 Q_PROPERTY(qreal ToolbarButtonSize READ toolbarButtonSize NOTIFY gridSizeChanged) 0037 Q_PROPERTY(qreal ToolbarHeight READ toolbarHeight NOTIFY gridSizeChanged) 0038 Q_PROPERTY(qreal SmallFontSize READ smallFontSize NOTIFY gridSizeChanged) 0039 Q_PROPERTY(qreal DefaultFontSize READ defaultFontSize NOTIFY gridSizeChanged) 0040 Q_PROPERTY(qreal LargeFontSize READ largeFontSize NOTIFY gridSizeChanged) 0041 Q_PROPERTY(qreal HugeFontSize READ hugeFontSize NOTIFY gridSizeChanged) 0042 0043 public: 0044 explicit Constants(QObject* parent = 0); 0045 0046 int animationDuration() const; 0047 qreal gridHeight() const; 0048 qreal gridWidth() const; 0049 qreal toolbarButtonSize() const; 0050 qreal toolbarHeight() const; 0051 int gridRows() const; 0052 int gridColumns() const; 0053 qreal defaultMargin() const; 0054 qreal smallFontSize() const; 0055 qreal defaultFontSize() const; 0056 qreal largeFontSize() const; 0057 qreal hugeFontSize() const; 0058 bool isLandscape() const; 0059 0060 Q_INVOKABLE void setGridWidth(qreal width); 0061 Q_INVOKABLE void setGridHeight(qreal height); 0062 0063 Q_SIGNALS: 0064 void gridSizeChanged(); 0065 0066 private: 0067 qreal m_gridWidth; 0068 qreal m_gridHeight; 0069 qreal m_toolbarButtonSize; 0070 qreal m_toolbarHeight; 0071 }; 0072 0073 #endif // CONSTANTS_H