00001 #ifndef COSTTYPECHILD_H
00002 #define COSTTYPECHILD_H
00003
00004 #include <QItemSelection>
00005 #include <QTableView>
00006 #include <QDomDocument>
00007 #include <QModelIndexList>
00008 #include "../Dialogs/owncapitalcalculationdialog.h"
00009 #include "../Models/owncapitalcalculationmodel.h"
00010 #include "../Models/costtypefiltermodel.h"
00011 #include "childwindow.h"
00012 #include "../Models/costtypemodel.h"
00013
00014 QT_BEGIN_NAMESPACE
00015 class QSortFilterProxyModel;
00016 class QItemSelectionModel;
00017 class QUndoStack;
00018 QT_END_NAMESPACE
00019
00020 class CostTypeChild : public ChildWindow
00021 {
00022 Q_OBJECT
00023
00024 public:
00025 CostTypeChild();
00026
00027 void setModel(CostTypeModel *model);
00028 virtual CostTypeModel* model() const
00029 {
00030 return table;
00031 }
00032
00033 void setProxyModel(CostTypeFilterModel* proxy)
00034 {
00035 filterModel = proxy;
00036 }
00037 CostTypeFilterModel* proxyModel() const
00038 {
00039 return filterModel;
00040 }
00041
00042 QTableView* tableViewWidget() const
00043 {
00044 return tableView;
00045 }
00046
00047 void newFile();
00048 bool loadDocument(const QDomElement document);
00049
00050 void setRevenues(double e);
00051
00052 QAction *deleteAction;
00053 QAction *editAction;
00054
00055 OwnCapitalCalculationDialog *ownCapitalDialog;
00056
00057 public slots:
00058 void reassessValueBased(QString position, int type, QString pal, QString replacementvalue, QString salvagevalue, QString usefuleconomiclife);
00059 void reassessIndexBased(QString position, int type, QString pal, QString decliningbalance, QString usefuleconomiclife, QString purchasePrice, QString purchaseIndex, QString currentIndex);
00060 void delimitAmount(QString position, int type, QString incomestatement, QString amounttodelimit);
00061 void acceptCosts(QString position, int type, QString incomestatement);
00062 void normalize(QString position, int type, QString averagecosts, QString actualcosts);
00063 void wages(QString position, int type, QString wages, QString specialpayment, QString legaltaxes, QString paymentbyresult, QString directcostpart, QString nonwagelaborcosts);
00064 void incidentialInterest(QString position, int type, QString incomestatemment);
00065 void interestOnOwnBoundCapital(QString position, int type, QString incomeStatement, QString interestOnBorrowedCapital, QString ownCapital, QString interestRate);
00066 void interestOnOperatingAssets(QString position, int ty, QString incomeStatement, QString interestRateOwnBoundCapital, QString operatingAssets);
00067 void completeCosts(QString position, int type, QString salarywithouttaxes, QString monthsforcalculation, QString riskpremium);
00068
00069 private:
00070 void createControls();
00071 void createActions();
00072 bool maybeSave();
00073
00074 CostTypeModel *table;
00075 CostTypeFilterModel *filterModel;
00076 QTableView *tableView;
00077
00078 private slots:
00079 void removeEntry();
00080 void editEntry();
00081 void enableEditRemoveActions(bool);
00082
00083 protected:
00084 void closeEvent(QCloseEvent *event);
00085
00086 signals:
00087 void setMdiAreaEnabled(bool);
00088 void editInformationAvailable(const CostTypeModel *table, const QModelIndexList affectedRows);
00089 };
00090
00091 #endif