| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef QUTESHEET_H |
| 24 |
#define QUTESHEET_H |
| 25 |
|
| 26 |
#include <QObject> |
| 27 |
#include <QList> |
| 28 |
#include <QVariant> |
| 29 |
|
| 30 |
#include "eventsheet.h" |
| 31 |
|
| 32 |
class QuteCells { |
| 33 |
|
| 34 |
}; |
| 35 |
|
| 36 |
class QuteSheet : public QObject |
| 37 |
{ |
| 38 |
Q_OBJECT |
| 39 |
public: |
| 40 |
QuteSheet(QObject *parent = 0, EventSheet *sheet = 0); |
| 41 |
|
| 42 |
void setSheetPointer(EventSheet *sheet); |
| 43 |
|
| 44 |
public slots: |
| 45 |
|
| 46 |
QuteSheet* new_QuteSheet() { return new QuteSheet(); } |
| 47 |
|
| 48 |
|
| 49 |
void delete_QuteSheet(QuteSheet* o) { delete o; } |
| 50 |
|
| 51 |
QString text(QuteSheet* o) { return o->rowsToText(o->data()); } |
| 52 |
QList<QList <QVariant > > allRows(QuteSheet* o) { return o->data(); } |
| 53 |
|
| 54 |
QString selectionText(QuteSheet* o) { return o->rowsToText(o->selectionRows(o)); } |
| 55 |
QList<QVariant> selection(QuteSheet* o) { return o->getValuesByRow(selectionRows(o)); } |
| 56 |
QList<QList <QVariant > > selectionRows(QuteSheet* o) { return o->someCols(o->data(), startRow, numRows, |
| 57 |
startCol, numCols); } |
| 58 |
QList<QList <QVariant > > selectionFullRows(QuteSheet* o) { return o->allCols(o->data(), startRow, numRows); } |
| 59 |
|
| 60 |
void setCellValue(QuteSheet* o, int row, int column, QVariant data) {return o->setSheetCellValue(row, column, data); } |
| 61 |
bool setRows(QList<QList <QVariant > > new_data, |
| 62 |
int new_startRow = -1, |
| 63 |
int new_startCol = -1, |
| 64 |
int new_numRows = -1, |
| 65 |
int new_numCols = -1); |
| 66 |
|
| 67 |
bool setValues(QList <QVariant > new_data, |
| 68 |
int new_startRow = -1, |
| 69 |
int new_startCol = -1, |
| 70 |
int new_numRows = -1, |
| 71 |
int new_numCols = -1); |
| 72 |
|
| 73 |
bool setText(QString text, |
| 74 |
int new_startRow = -1, |
| 75 |
int new_startCol = -1, |
| 76 |
int new_numRows = -1, |
| 77 |
int new_numCols = -1); |
| 78 |
|
| 79 |
|
| 80 |
QList<QList <QVariant> > sort(QList<QList <QVariant> > vectors, int p_field = 2); |
| 81 |
QList<QList <QVariant > > transpose(QList<QList <QVariant > > mtx); |
| 82 |
QString rowsToText(QList<QList <QVariant > > data); |
| 83 |
|
| 84 |
private: |
| 85 |
|
| 86 |
QList<QList <QVariant > > data(); |
| 87 |
bool testConsistency(); |
| 88 |
|
| 89 |
void setSheetCellValue(int row, int column, QVariant data); |
| 90 |
QList<QVariant> getValuesByRow(QList<QList <QVariant > > data); |
| 91 |
QList<QList <QVariant > > someCols(QList<QList <QVariant > > data, |
| 92 |
int row, |
| 93 |
int numRows, |
| 94 |
int col, |
| 95 |
int numCols); |
| 96 |
|
| 97 |
QList<QList <QVariant > > allCols(QList<QList <QVariant > > data, |
| 98 |
int row, |
| 99 |
int numRows); |
| 100 |
|
| 101 |
bool writeOutFile(QString text); |
| 102 |
|
| 103 |
EventSheet * m_sheet; |
| 104 |
int startRow; |
| 105 |
int startCol; |
| 106 |
int numRows; |
| 107 |
int numCols; |
| 108 |
int totalRows; |
| 109 |
int totalCols; |
| 110 |
}; |
| 111 |
|
| 112 |
#endif |