/usr/include/Wt/Chart/WStandardChartProxyModel is in libwt-dev 3.3.6+dfsg-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2016 Emweb bvba, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WSTANDARD_CHART_PROXY_MODEL_H_
#define WSTANDARD_CHART_PROXY_MODEL_H_
#include "Wt/Chart/WAbstractChartModel"
#include "Wt/WLink"
namespace Wt {
class WAbstractItemModel;
namespace Chart {
/*! \class WStandardChartProxyModel Wt/Chart/WStandardChartProxyModel Wt/Chart/WStandardChartProxyModel
* \brief A WAbstractChartModel implementation that wraps a WAbstractItemModel
*
* This model delegates all functions to an underlying WAbstractItemModel,
* using the appropriate roles.
*
* This model also triggers the changed() signal whenever the underlying WAbstractItemModel
* is changed.
*
* \ingroup charts
*/
class WT_API WStandardChartProxyModel : public WAbstractChartModel {
public:
/*! \brief Creates a new WStandardChartProxyModel that wraps the given source model.
*/
WStandardChartProxyModel(WAbstractItemModel *sourceModel, WObject *parent = 0);
virtual ~WStandardChartProxyModel();
/*! \brief Returns data at a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole DisplayRole\endlink as a double.
*
* \sa WAbstractItemModel::data()
*/
virtual double data(int row, int column) const WT_CXX11ONLY(override);
/*! \brief Returns display data at a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole DisplayRole\endlink as a WString.
*
* \sa WAbstractItemModel::data()
*/
virtual WString displayData(int row, int column) const WT_CXX11ONLY(override);
/*! \brief Returns the given column's header data.
*
* Returns the result of WAbstractItemModel::headerData() for the
* given column with the \link ItemDataRole DisplayRole\endlink as a WString.
*
* \sa WAbstractItemModel::headerData()
*/
virtual WString headerData(int column) const WT_CXX11ONLY(override);
/*! \brief Returns the tooltip text to use on a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole ToolTipRole\endlink as a WString.
*
* \sa WAbstractItemModel::data()
*/
virtual WString toolTip(int row, int column) const WT_CXX11ONLY(override);
/*! \brief Returns the item flags for the given row and column.
*
* Returns the result of WAbstractItemModel::index(row, column).flags()
* for the given row and column.
*
* \sa WModelIndex::flags()
*/
virtual WFlags<ItemFlag> flags(int row, int column) const WT_CXX11ONLY(override);
/*! \brief Returns the link to use on a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole LinkRole\endlink as a WLink.
*
* \sa WAbstractItemModel::data()
*/
virtual WLink *link(int row, int column) const WT_CXX11ONLY(override);
/*!\brief Returns the marker pen color to use for a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole MarkerPenColorRole\endlink, or null if no color
* is defined.
*
* \sa WAbstractItemModel::data()
*/
virtual const WColor *markerPenColor(int row, int column) const WT_CXX11ONLY(override);
/*!\brief Returns the marker brush color to use for a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole MarkerBrushColorRole\endlink, or null if no color
* is defined.
*
* \sa WAbstractItemModel::data()
*/
virtual const WColor *markerBrushColor(int row, int column) const WT_CXX11ONLY(override);
/*!\brief Returns the bar pen color to use for a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole BarPenColorRole\endlink, or null if no color
* is defined.
*
* \sa WAbstractItemModel::data()
*/
virtual const WColor *barPenColor(int row, int column) const WT_CXX11ONLY(override);
/*!\brief Returns the bar brush color to use for a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole BarBrushColorRole\endlink, or null if no color
* is defined.
*
* \sa WAbstractItemModel::data()
*/
virtual const WColor *barBrushColor(int row, int column) const WT_CXX11ONLY(override);
/*!\brief Returns the marker scale factor to use for a given row and column.
*
* Returns the result of WAbstractItemModel::data() for the given
* row and column with the \link ItemDataRole MarkerScaleFactorRole\endlink, or null if no color
* is defined.
*
* \sa WAbstractItemModel::data()
*/
virtual const double *markerScaleFactor(int row, int column) const WT_CXX11ONLY(override);
/*! \brief Returns the number of columns.
*
* \sa WAbstractItemModel::columnCount()
*/
virtual int columnCount() const WT_CXX11ONLY(override);
/*! \brief Returns the number of rows.
*
* \sa WAbstractItemModel::rowCount()
*/
virtual int rowCount() const WT_CXX11ONLY(override);
/*! \brief Returns the wrapped source model.
*/
WAbstractItemModel *sourceModel() const { return sourceModel_; }
private:
WAbstractItemModel *sourceModel_;
#ifndef WT_TARGET_JAVA
mutable WColor color_;
mutable WLink link_;
#endif
void sourceModelModified();
const WColor *color(int row, int column, int colorRole) const;
};
}
}
#endif // WSTANDARD_CHART_PROXY_MODEL_H_
|