#ifndef QT_INPUT_HPP
#define QT_INPUT_HPP

#include <QTabWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QMessageBox>
#include <QFileDialog>
#include <fstream>

#include "input_physics.hpp"
#include "input_time.hpp"
#include "input_geometry.hpp"
#include "input_initial_state.hpp"
#include "input_sources.hpp"
#include "input_view.hpp"
#include "geometry.hpp"

using namespace std;

class QtInput:public QWidget{
  Q_OBJECT
private:
  int previous_index;
  Geometry* geometry;
  
  QVBoxLayout* main_layout;
  QHBoxLayout* button_layout;
  QTabWidget* tab_widget;
  QWidget* button_widget;
  QPushButton* button_save;
  QPushButton* button_run;
  QPushButton* button_cancel;
  QtInputPhysics* input_physics;
  QtInputTime* input_time;
  QtInputGeometry* input_geometry;
  QtInputInitialState* input_initial_state;
  QtInputSources* input_sources;
  QtInputView* input_view;
 
  bool validate();
  void load(string filename);
public:
  QtInput();
  QtInput(QString filename);
  ~QtInput();
  void save_input(string filename);

signals:
  void run_signal();
  void exit_signal();
private slots:
  void run();
  void save();
  void cancel();
  void changeTabIndex(int index);
  void updateGeometry();
};


#endif
