charttheme_p.h
110 lines
| 3.1 KiB
| text/x-c
|
CLexer
/ src / charttheme_p.h
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1366 | // W A R N I N G | ||
// ------------- | ||||
// | ||||
// This file is not part of the QtCommercial Chart API. It exists purely as an | ||||
// implementation detail. This header file may change from version to | ||||
// version without notice, or even be removed. | ||||
// | ||||
// We mean it. | ||||
|
r103 | #ifndef CHARTTHEME_H | ||
#define CHARTTHEME_H | ||||
#include "qchartglobal.h" | ||||
|
r143 | #include "qchart.h" | ||
|
r103 | #include <QColor> | ||
|
r494 | #include <QGradientStops> | ||
|
r103 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r143 | class ChartItem; | ||
|
r145 | class LineChartItem; | ||
|
r349 | class QLineSeries; | ||
|
r1674 | class AbstractBarChartItem; | ||
|
r1584 | class QAbstractBarSeries; | ||
|
r666 | class StackedBarChartItem; | ||
|
r338 | class QStackedBarSeries; | ||
class QPercentBarSeries; | ||||
|
r666 | class PercentBarChartItem; | ||
|
r182 | class QScatterSeries; | ||
|
r470 | class ScatterChartItem; | ||
|
r568 | class PieChartItem; | ||
|
r163 | class QPieSeries; | ||
|
r460 | class SplineChartItem; | ||
|
r401 | class QSplineSeries; | ||
|
r421 | class AreaChartItem; | ||
class QAreaSeries; | ||||
|
r143 | |||
class ChartTheme | ||||
|
r103 | { | ||
|
r548 | public: | ||
enum BackgroundShadesMode { | ||||
BackgroundShadesNone = 0, | ||||
BackgroundShadesVertical, | ||||
BackgroundShadesHorizontal, | ||||
BackgroundShadesBoth | ||||
}; | ||||
|
r143 | protected: | ||
|
r853 | explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeLight); | ||
|
r103 | public: | ||
|
r948 | static ChartTheme *createTheme(QChart::ChartTheme theme); | ||
|
r153 | QChart::ChartTheme id() const {return m_id;} | ||
|
r948 | void decorate(QChart *chart); | ||
void decorate(QLegend *legend); | ||||
|
r1584 | void decorate(QAbstractBarSeries *series, int index); | ||
|
r948 | void decorate(QLineSeries *series, int index); | ||
void decorate(QAreaSeries *series, int index); | ||||
void decorate(QScatterSeries *series, int index); | ||||
void decorate(QPieSeries *series, int index); | ||||
void decorate(QSplineSeries *series, int index); | ||||
|
r1541 | void decorate(QAbstractAxis *axis, bool axisX); | ||
|
r943 | void setForced(bool enabled); | ||
bool isForced() { return m_force; } | ||||
|
r143 | |||
|
r494 | public: // utils | ||
|
r507 | void generateSeriesGradients(); | ||
|
r494 | static QColor colorAt(const QColor &start, const QColor &end, qreal pos); | ||
static QColor colorAt(const QGradient &gradient, qreal pos); | ||||
|
r143 | protected: | ||
|
r153 | QChart::ChartTheme m_id; | ||
|
r494 | QList<QColor> m_seriesColors; | ||
QList<QGradient> m_seriesGradients; | ||||
|
r584 | QLinearGradient m_chartBackgroundGradient; | ||
|
r507 | |||
|
r548 | QFont m_masterFont; | ||
|
r717 | QFont m_labelFont; | ||
|
r1528 | QBrush m_labelBrush; | ||
|
r548 | QPen m_axisLinePen; | ||
QPen m_backgroundShadesPen; | ||||
QBrush m_backgroundShadesBrush; | ||||
BackgroundShadesMode m_backgroundShades; | ||||
|
r1001 | bool m_backgroundDropShadowEnabled; | ||
|
r548 | QPen m_gridLinePen; | ||
|
r943 | bool m_force; | ||
|
r103 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // CHARTTHEME_H | ||||