QtiPlot  0.9.8.2
TableStatistics.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : TableStatistics.h
3  Project : QtiPlot
4 --------------------------------------------------------------------
5  Copyright : (C) 2006 by Knut Franke
6  Email (use @ for *) : knut.franke*gmx.de
7  Description : Table subclass that displays statistics on
8  columns or rows of another table
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef TABLE_STATISTICS_H
31 #define TABLE_STATISTICS_H
32 
33 #include "Table.h"
34 
40 class TableStatistics : public Table
41 {
42  Q_OBJECT
43 
44  public:
46  enum Type { row, column };
48  TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList<int> targets, int start = 0, int end = -1);
50  Type type() const { return d_type; }
52  Table *base() const { return d_base; }
53  void setBase(Table *t);
54  // saving
55  virtual void save(const QString&, const QString &geometry, bool = false);
56  void setColumnStatsTypes(const QList<int>& colStatTypes);
57  void setRange(int start, int end);
58 
59  QString baseName(){return d_base_name;}
60  void setBaseName(const QString& name){d_base_name = name;}
61 
62  public slots:
64  void update();
66  void update(Table*, const QString& colName);
68  void renameCol(const QString&, const QString&);
70  void removeCol(const QString&);
71 
72  private slots:
73  void closedBase();
74  void removeStatsCol(int);
75  void moveColumn(int, int, int);
76  void changeColIndex(int, int);
77  void insertCols(int start, int count);
78  void addCol(PlotDesignation pd = Y);
79 
80  private:
83  QList<int> d_targets;
84  QList<int> d_stats_col_type;
85  int d_start, d_end;
86  QString d_base_name;
87 };
88 
89 #endif