00001
00002
00003
00004
00005
00006
00007 #ifndef WINDOW_MODEL_BASE_H
00008 #define WINDOW_MODEL_BASE_H
00009
00010 #include "ExportDelimiter.h"
00011 #include <QStandardItemModel>
00012 #include <QString>
00013 #include <QVector>
00014
00015 class WindowTable;
00016
00018 class WindowModelBase : public QStandardItemModel
00019 {
00020 public:
00022 WindowModelBase ();
00023 virtual ~WindowModelBase ();
00024
00027 QMimeData *mimeData (const QModelIndexList &indexes) const;
00028
00030 QString selectionAsHtml () const;
00031
00033 QString selectionAsText (ExportDelimiter delimiter) const;
00034
00036 void setDelimiter (ExportDelimiter delimiter);
00037
00039 void setView (WindowTable &view);
00040
00041 private:
00042 int fold2dIndexes (int row,
00043 int col,
00044 int rowLow,
00045 int colLow,
00046 int colHigh) const;
00047 void selectionAsTable (int &rowLow,
00048 int &colLow,
00049 int &rowHigh,
00050 int &colHigh,
00051 QVector<QString> &table) const;
00052
00053 ExportDelimiter m_delimiter;
00054 WindowTable *m_view;
00055 };
00056
00057 #endif // WINDOW_MODEL_BASE_H