abstractchartlayout_p.h
82 lines
| 2.9 KiB
| text/x-c
|
CLexer
Michal Klocek
|
r1535 | /**************************************************************************** | ||
** | ||||
Miikka Heikkinen
|
r2432 | ** Copyright (C) 2013 Digia Plc | ||
Michal Klocek
|
r1535 | ** 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$ | ||||
** | ||||
****************************************************************************/ | ||||
Miikka Heikkinen
|
r2435 | // 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. | ||||
Miikka Heikkinen
|
r2483 | #ifndef ABSTRACTCHARTLAYOUT_H | ||
#define ABSTRACTCHARTLAYOUT_H | ||||
Michal Klocek
|
r1534 | #include <QGraphicsLayout> | ||
Michal Klocek
|
r1883 | #include <QMargins> | ||
Michal Klocek
|
r1534 | #include "qchartglobal.h" | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Michal Klocek
|
r1965 | class ChartTitle; | ||
Miikka Heikkinen
|
r2483 | class ChartAxisElement; | ||
class ChartPresenter; | ||||
Michal Klocek
|
r1965 | class QLegend; | ||
class ChartBackground; | ||||
Michal Klocek
|
r1534 | |||
Miikka Heikkinen
|
r2483 | class AbstractChartLayout : public QGraphicsLayout | ||
Michal Klocek
|
r1534 | { | ||
public: | ||||
Miikka Heikkinen
|
r2483 | AbstractChartLayout(ChartPresenter *presenter); | ||
virtual ~AbstractChartLayout(); | ||||
Michal Klocek
|
r1534 | |||
Miikka Heikkinen
|
r2483 | virtual void setMargins(const QMargins &margins); | ||
virtual QMargins margins() const; | ||||
virtual void setGeometry(const QRectF &rect); | ||||
Michal Klocek
|
r1534 | |||
Miikka Heikkinen
|
r2483 | protected: | ||
virtual QRectF calculateBackgroundGeometry(const QRectF &geometry, ChartBackground *background) const; | ||||
virtual QRectF calculateBackgroundMinimum(const QRectF &minimum) const; | ||||
virtual QRectF calculateContentGeometry(const QRectF &geometry) const; | ||||
virtual QRectF calculateContentMinimum(const QRectF &minimum) const; | ||||
virtual QRectF calculateTitleGeometry(const QRectF &geometry, ChartTitle *title) const; | ||||
virtual QRectF calculateTitleMinimum(const QRectF &minimum, ChartTitle *title) const; | ||||
virtual QRectF calculateLegendGeometry(const QRectF &geometry, QLegend *legend) const; | ||||
virtual QRectF calculateLegendMinimum(const QRectF &minimum, QLegend *legend) const; | ||||
Michal Klocek
|
r1534 | |||
Miikka Heikkinen
|
r2483 | virtual QRectF calculateAxisGeometry(const QRectF &geometry, const QList<ChartAxisElement *>& axes) const = 0; | ||
virtual QRectF calculateAxisMinimum(const QRectF &minimum, const QList<ChartAxisElement *>& axes) const = 0; | ||||
Michal Klocek
|
r1534 | |||
Miikka Heikkinen
|
r2483 | // from QGraphicsLayout | ||
Jani Honkonen
|
r2131 | QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; | ||
Michal Klocek
|
r1534 | int count() const { return 0; } | ||
Jani Honkonen
|
r2131 | QGraphicsLayoutItem *itemAt(int) const { return 0; }; | ||
void removeAt(int) {}; | ||||
Michal Klocek
|
r1534 | |||
Jani Honkonen
|
r2131 | ChartPresenter *m_presenter; | ||
Michal Klocek
|
r1965 | QMargins m_margins; | ||
QRectF m_minChartRect; | ||||
QRectF m_minAxisRect; | ||||
Michal Klocek
|
r1534 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
Miikka Heikkinen
|
r2483 | #endif // ABSTRACTCHARTLAYOUT_H | ||