00001 #ifndef OWNCAPITALCALCULATIONMODEL_H 00002 #define OWNCAPITALCALCULATIONMODEL_H 00003 00004 #include <QStringList> 00005 #include <QAbstractTableModel> 00006 #include <QDomDocument> 00007 00008 class OwnCapitalCalculationModel : public QAbstractTableModel 00009 { 00010 Q_OBJECT; 00011 00012 public: 00013 OwnCapitalCalculationModel(QObject *parent=0); 00014 int rowCount(const QModelIndex &parent) const; 00015 int columnCount(const QModelIndex &parent) const; 00016 QVariant headerData(int section, Qt::Orientation orientation, int role) const; 00017 QVariant data(const QModelIndex &index, int role) const; 00018 Qt::ItemFlags flags(const QModelIndex &index) const; 00019 bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole); 00020 bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex()); 00021 bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex()); 00022 QList<QStringList> getList(); 00023 void clear(); 00024 00025 void addRow(QString positionname, QString result, QString replacementvalue, QString revenues, QString usefullife, QString lifetime); 00026 void refreshSums(); 00027 00028 QDomElement dataNode(); 00029 00030 public slots: 00031 void loadDataNode(const QDomElement file); 00032 00033 private: 00034 QList<QStringList> entries; 00035 00036 signals: 00037 void newTotalAvailable(QString); 00038 }; 00039 00040 00041 #endif // OWNCAPITALCALCULATIONMODEL_H