kchart
kchartDataEditor.h00001 #ifndef KCHART_DATA_EDITOR_H
00002 #define KCHART_DATA_EDITOR_H
00003
00004
00005 #include <qstrlist.h>
00006 #include <qspinbox.h>
00007
00008 #include <kdialogbase.h>
00009
00010 #include "kchart_part.h"
00011
00012 class QLabel;
00013 class QSpinBox;
00014 class QCheckBox;
00015
00016
00017 namespace KChart
00018 {
00019
00020
00021 class KChartParams;
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class kchartDataSpinBox : public QSpinBox
00042 {
00043 Q_OBJECT
00044 public:
00045 kchartDataSpinBox(QWidget *);
00046 ~kchartDataSpinBox();
00047
00048 public slots:
00049
00050 void stepUp();
00051
00052 void stepDown();
00053
00054 protected:
00055 void interpretText(){;};
00056 bool eventFilter( QObject *obj, QEvent *ev );
00057
00058 signals:
00059
00060 void valueChangedSpecial(int);
00061
00062 private:
00063
00064 bool m_ignore;
00065 };
00066
00067
00068
00069
00070
00071
00072
00073
00074 class kchartDataTable : public QTable
00075 {
00076 Q_OBJECT
00077 public:
00078 kchartDataTable(QWidget *);
00079 ~kchartDataTable();
00080
00081 protected:
00082
00083 bool eventFilter( QObject *obj, QEvent *ev );
00084 };
00085
00086
00087
00088
00089
00090 class kchartDataEditor : public KDialogBase
00091 {
00092 Q_OBJECT
00093 public:
00094 kchartDataEditor(QWidget* parent = 0);
00095 void setData(KChartParams *params, KDChartTableData *dat);
00096 void getData(KChartParams *params, KDChartTableData *dat);
00097 void setRowLabels(const QStringList &rowLabels);
00098 void getRowLabels(QStringList &rowLabels);
00099 void setColLabels(const QStringList &colLabels);
00100 void getColLabels(QStringList &colLabels);
00101
00102 bool modified() const { return m_modified; }
00103
00104 protected:
00109 int headerRows();
00114 int headerCols();
00115
00120 void updateRowHeaders();
00121
00126 void updateColHeaders();
00127
00128 private:
00129 void addDocs();
00130
00131 signals:
00132 void applyClicked(kchartDataEditor *ed);
00133
00134 private slots:
00135 void slotApply();
00136
00138 void removeCurrentRow();
00140 void removeCurrentColumn();
00142 void insertRow();
00144 void insertColumn();
00145
00146 void setRows(int rows);
00147 void setCols(int cols);
00148
00149
00150 void tableChanged(int row, int col);
00151
00152
00153 private:
00154
00155 kchartDataTable *m_table;
00156 QLabel *m_rowsLA;
00157 kchartDataSpinBox *m_rowsSB;
00158 QLabel *m_colsLA;
00159 kchartDataSpinBox *m_colsSB;
00160 QCheckBox *m_firstRowAsLabel;
00161 QCheckBox *m_firstColAsLabel;
00162
00163
00164
00165 bool m_userWantsToShrink;
00166
00167 bool m_modified;
00168 };
00169
00170 }
00171
00172 #endif
|