| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | // |
| 5 | // W A R N I N G |
| 6 | // ------------- |
| 7 | // |
| 8 | // This file is not part of the QtDataVisualization API. It exists purely as an |
| 9 | // implementation detail. This header file may change from version to |
| 10 | // version without notice, or even be removed. |
| 11 | // |
| 12 | // We mean it. |
| 13 | |
| 14 | #ifndef THEMEMANAGER_P_H |
| 15 | #define THEMEMANAGER_P_H |
| 16 | |
| 17 | #include "datavisualizationglobal_p.h" |
| 18 | #include "abstract3dcontroller_p.h" |
| 19 | #include "q3dtheme.h" |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class ThemeManager : public QObject |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | public: |
| 27 | ThemeManager(Abstract3DController *controller); |
| 28 | ~ThemeManager(); |
| 29 | |
| 30 | void addTheme(Q3DTheme *theme); |
| 31 | void releaseTheme(Q3DTheme *theme); |
| 32 | void setActiveTheme(Q3DTheme *theme); |
| 33 | Q3DTheme *activeTheme() const; |
| 34 | QList<Q3DTheme *> themes() const; |
| 35 | |
| 36 | static void setPredefinedPropertiesToTheme(Q3DTheme *theme, Q3DTheme::Theme type); |
| 37 | |
| 38 | protected: |
| 39 | void connectThemeSignals(); |
| 40 | static QLinearGradient createGradient(const QColor &color, float colorLevel); |
| 41 | static void setBaseColors(Q3DTheme *theme, const QList<QColor> &colors); |
| 42 | static void setBackgroundColor(Q3DTheme *theme, const QColor &color); |
| 43 | static void setWindowColor(Q3DTheme *theme, const QColor &color); |
| 44 | static void setTextColor(Q3DTheme *theme, const QColor &color); |
| 45 | static void setTextBackgroundColor(Q3DTheme *theme, const QColor &color); |
| 46 | static void setGridLineColor(Q3DTheme *theme, const QColor &color); |
| 47 | static void setSingleHighlightColor(Q3DTheme *theme, const QColor &color); |
| 48 | static void setMultiHighlightColor(Q3DTheme *theme, const QColor &color); |
| 49 | static void setLightColor(Q3DTheme *theme, const QColor &color); |
| 50 | static void setBaseGradients(Q3DTheme *theme, const QList<QLinearGradient> &gradients); |
| 51 | static void setSingleHighlightGradient(Q3DTheme *theme, const QLinearGradient &gradient); |
| 52 | static void setMultiHighlightGradient(Q3DTheme *theme, const QLinearGradient &gradient); |
| 53 | static void setLightStrength(Q3DTheme *theme, float strength); |
| 54 | static void setAmbientLightStrength(Q3DTheme *theme, float strength); |
| 55 | static void setHighlightLightStrength(Q3DTheme *theme, float strength); |
| 56 | static void setLabelBorderEnabled(Q3DTheme *theme, bool enabled); |
| 57 | static void setFont(Q3DTheme *theme, const QFont &font); |
| 58 | static void setBackgroundEnabled(Q3DTheme *theme, bool enabled); |
| 59 | static void setGridEnabled(Q3DTheme *theme, bool enabled); |
| 60 | static void setLabelBackgroundEnabled(Q3DTheme *theme, bool enabled); |
| 61 | static void setColorStyle(Q3DTheme *theme, Q3DTheme::ColorStyle style); |
| 62 | |
| 63 | private: |
| 64 | Q3DTheme *m_activeTheme; |
| 65 | QList<Q3DTheme *> m_themes; // List of all added themes |
| 66 | Abstract3DController *m_controller; |
| 67 | }; |
| 68 | |
| 69 | QT_END_NAMESPACE |
| 70 | |
| 71 | #endif |
| 72 | |