00001 #ifndef KDCHARTPARAMSWRAPPER_H
00002 #define KDCHARTPARAMSWRAPPER_H
00003 #include <qobject.h>
00004 #include <KDFrame.h>
00005 #include <KDChartParams.h>
00006 #include <qvariant.h>
00007 class KDChartAxisParams;
00008
00009 class KDChartParamsWrapper :public QObject
00010 {
00011 Q_OBJECT
00012
00013 public:
00014 KDChartParamsWrapper( KDChartParams* );
00015 public slots:
00016 const KDChartAxisParams* axisParams( uint n ) const;
00017 void setExplodeValues( QVariant explodeList );
00018 void setExplodeFactors( QVariant factors );
00019 void setAxisLabelStringParams( uint n,
00020 QVariant axisLabelStringList,
00021 QVariant axisShortLabelStringList,
00022 const QString& valueStart = QString::null,
00023 const QString& valueEnd = QString::null );
00024
00025
00026 void setSimpleFrame( uint area,
00027 int outerGapX = 0,
00028 int outerGapY = 0,
00029 int innerGapX = 0,
00030 int innerGapY = 0,
00031 bool addFrameWidthToLayout = true,
00032 bool addFrameHeightToLayout = true,
00033 int simpleFrame = KDFrame::FrameFlat,
00034 int lineWidth = 1,
00035 int midLineWidth = 0,
00036 QPen pen = QPen(),
00037 QBrush background = QBrush( Qt::NoBrush ),
00038 const QPixmap* backPixmap = 0,
00039 int backPixmapMode = KDFrame::PixStretched,
00040 int shadowWidth = 0,
00041 int sunPos = KDFrame::CornerTopLeft )
00042 {
00043 _data->setSimpleFrame(area, outerGapX, outerGapY, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
00044 (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, background, backPixmap,
00045 (KDFrame::BackPixmapMode) backPixmapMode, shadowWidth, (KDFrame::CornerName) sunPos );
00046 }
00047
00048 void setDataRegionFrame( uint dataRow,
00049 uint dataCol,
00050 uint data3rd,
00051 int innerGapX = 0,
00052 int innerGapY = 0,
00053 bool addFrameWidthToLayout = true,
00054 bool addFrameHeightToLayout = true,
00055 int simpleFrame = KDFrame::FrameFlat,
00056 int lineWidth = 1,
00057 int midLineWidth = 0,
00058 QPen pen = QPen(),
00059 int shadowWidth = 0,
00060 int sunPos = KDFrame::CornerTopLeft )
00061 {
00062 _data->setDataRegionFrame( dataRow, dataCol,
00063 data3rd, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
00064 (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, shadowWidth, (KDFrame::CornerName) sunPos );
00065 }
00066
00067 bool moveDataRegionFrame( uint oldDataRow,
00068 uint oldDataCol,
00069 uint oldData3rd,
00070 uint newDataRow,
00071 uint newDataCol,
00072 uint newData3rd
00073 )
00074 {
00075 return _data->moveDataRegionFrame(
00076 oldDataRow, oldDataCol, oldData3rd, newDataRow, newDataCol, newData3rd );
00077 }
00078
00079 void setPrintDataValues( bool active,
00080 uint chart = KDCHART_ALL_CHARTS,
00081 int divPow10 = 0,
00082 int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
00083 QFont* font = 0,
00084 uint size = UINT_MAX,
00085
00086
00087 const QColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
00088 int negativePosition = KDChartEnums::PosCenter,
00089 uint negativeAlign = Qt::AlignCenter,
00090 int negativeDeltaX = 0,
00091 int negativeDeltaY = 0,
00092 int negativeRotation = 0,
00093 int positivePosition = KDChartEnums::PosCenter,
00094 uint positiveAlign = Qt::AlignCenter,
00095 int positiveDeltaX = 0,
00096 int positiveDeltaY = 0,
00097 int positiveRotation = 0,
00098 int policy = KDChartEnums::LayoutPolicyRotate )
00099 {
00100 _data->setPrintDataValues( active, chart, divPow10, digitsBehindComma,font, size, color, (KDChartEnums::PositionFlag) negativePosition,
00101 negativeAlign, negativeDeltaX, negativeDeltaY, negativeRotation, (KDChartEnums::PositionFlag) positivePosition,
00102 positiveAlign, positiveDeltaX, positiveDeltaY, positiveRotation, (KDChartEnums::TextLayoutPolicy) policy );
00103 }
00104
00105
00106 void setDataValuesPlacing( int position,
00107 uint align,
00108 int deltaX,
00109 int deltaY,
00110 int rotation,
00111 bool specifyingPositiveValues = true,
00112 uint chart = KDCHART_ALL_CHARTS )
00113 {
00114 _data->setDataValuesPlacing( (KDChartEnums::PositionFlag) position, align, deltaX, deltaY, rotation, specifyingPositiveValues, chart );
00115 }
00116
00117
00118 void setDataValuesPolicy( int policy = KDChartEnums::LayoutPolicyRotate,
00119 uint chart = KDCHART_ALL_CHARTS )
00120 {
00121 _data->setDataValuesPolicy( (KDChartEnums::TextLayoutPolicy) policy, chart );
00122 }
00123
00124
00125 void setPolarDelimsAndLabelsAtPos( int pos,
00126 bool showDelimiters,
00127 bool showLabels )
00128 {
00129 _data->setPolarDelimsAndLabelsAtPos( (KDChartEnums::PositionFlag) pos, showDelimiters, showLabels );
00130 }
00131
00132
00133 bool polarDelimAtPos( int pos ) const
00134 {
00135 return _data->polarDelimAtPos( (KDChartEnums::PositionFlag) pos );
00136 }
00137
00138
00139
00140 bool polarLabelsAtPos( int pos ) const
00141 {
00142 return _data->polarLabelsAtPos( (KDChartEnums::PositionFlag) pos );
00143 }
00144
00145
00146 void setAxisType( uint n, int axisType )
00147 {
00148 _data->setAxisType( n, (KDChartAxisParams::AxisType) axisType );
00149 }
00150
00151
00152 void setAxisLabelTextParams( uint n,
00153 bool axisSteadyValueCalc = true,
00154 QVariant axisValueStart = KDCHART_AXIS_LABELS_AUTO_LIMIT,
00155 QVariant axisValueEnd = KDCHART_AXIS_LABELS_AUTO_LIMIT,
00156 double axisValueDelta = KDCHART_AXIS_LABELS_AUTO_DELTA,
00157 int axisDigitsBehindComma = KDCHART_AXIS_LABELS_AUTO_DIGITS,
00158 int axisMaxEmptyInnerSpan = 67,
00159 int takeLabelsFromDataRow = KDChartAxisParams::LabelsFromDataRowNo,
00160 int labelTextsDataRow = 0,
00161 const QVariant& axisLabelStringList = QStringList(),
00162 const QVariant& axisShortLabelsStringList = QStringList(),
00163 int axisValueLeaveOut = KDCHART_AXIS_LABELS_AUTO_LEAVEOUT,
00164 int axisValueDeltaScale = KDChartAxisParams::ValueScaleNumerical );
00165
00166
00167
00168 private:
00169 KDChartParams* _data;
00170 };
00171
00172
00173
00174 #endif
00175