kchart
kchart_params.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KCHART_PARAMS_H
00022 #define KCHART_PARAMS_H
00023
00024
00025 class KoXmlWriter;
00026 class KoGenStyles;
00027 class KoOasisLoadingContext;
00028 class KoStore;
00029 class KDChartParams;
00030 class DCOPObject;
00031
00032
00033 #include "kdchart/KDChartParams.h"
00034
00035
00036 namespace KChart
00037 {
00038
00039 class KChartPart;
00040
00041 class KChartParams : public KDChartParams
00042 {
00043 public:
00044 typedef enum {
00045
00046 NoType = KDChartParams::NoType,
00047 Bar = KDChartParams::Bar,
00048 Line = KDChartParams::Line,
00049 Area = KDChartParams::Area,
00050 Pie = KDChartParams::Pie,
00051 HiLo = KDChartParams::HiLo,
00052 Ring = KDChartParams::Ring,
00053 Polar = KDChartParams::Polar,
00054 BoxWhisker = KDChartParams::BoxWhisker
00055
00056 } ChartType;
00057
00058
00059 typedef enum {
00060 DataRows = 0,
00061 DataColumns = 1
00062 } DataDirection;
00063
00064
00065 KChartParams( KChartPart *_part );
00066 ~KChartParams();
00067
00068 ChartType chartType() const { return m_chartType; }
00069 void setChartType( ChartType _type ) {
00070 m_chartType = _type;
00071 KDChartParams::setChartType( (KDChartParams::ChartType) _type );
00072 }
00073
00074
00075 DataDirection dataDirection() const { return m_dataDirection; }
00076 void setDataDirection( DataDirection _dir ) {
00077 m_dataDirection = _dir;
00078 }
00079
00080 QString chartTypeToString( ChartType _type) const;
00081 ChartType stringToChartType( const QString& string );
00082
00083
00084 bool firstRowAsLabel() const { return m_firstRowAsLabel; }
00085 void setFirstRowAsLabel( bool _val );
00086 bool firstColAsLabel() const { return m_firstColAsLabel; }
00087 void setFirstColAsLabel( bool _val );
00088
00089
00090
00091
00092 public slots:
00093
00094 void setBarNumLines( int _numLines ) {
00095 m_barNumLines = _numLines;
00096 emit changed();
00097 }
00098
00099 int barNumLines() const {
00100 return m_barNumLines;
00101 }
00102
00103
00104
00105 public:
00106
00107 DCOPObject *dcopObject();
00108
00109 bool loadOasis( const QDomElement &chartElem,
00110 KoOasisLoadingContext &loadingContext,
00111 QString &errorMessage,
00112 KoStore *store );
00113 void saveOasis( KoXmlWriter* bodyWriter, KoGenStyles& mainStyles ) const;
00114
00115 private:
00116 bool loadOasisPlotarea( const QDomElement &plotareaElem,
00117 KoOasisLoadingContext &loadingContext,
00118 QString &errorMessage );
00119 bool loadOasisAxis( const QDomElement &axisElem,
00120 KoOasisLoadingContext &loadingContext,
00121 QString &errorMessage,
00122 KDChartAxisParams::AxisPos axisPos );
00123 void loadOasisFont( KoOasisLoadingContext& context, QFont& font, QColor& color );
00124
00125 void saveOasisPlotArea( KoXmlWriter* bodyWriter, KoGenStyles& mainStyles ) const;
00126 void saveOasisAxis( KoXmlWriter* bodyWriter, KoGenStyles& mainStyles,
00127 KDChartAxisParams::AxisPos axisPos, const char* axisName ) const;
00128
00129 QString saveOasisFont( KoGenStyles& mainStyles, const QFont& font, const QColor& color ) const;
00130
00131 private:
00132 KChartPart *m_part;
00133
00134
00135 ChartType m_chartType;
00136
00137
00138 DataDirection m_dataDirection;
00139 bool m_firstRowAsLabel;
00140 bool m_firstColAsLabel;
00141
00142
00143 int m_barNumLines;
00144
00145 DCOPObject *m_dcop;
00146 };
00147
00148 }
00149
00150 #endif
|