/* * QtQuery.hpp * * Created on: Nov 8, 2010 * Author: heber */ #ifndef QTQUERY_HPP_ #define QTQUERY_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "Qt4/QtDialog.hpp" #include "Parameters/Parameter.hpp" #include "QtQueryList.hpp" class QHBoxLayout; class QBoxLayout; class QDialogButtonBox; class QLabel; class QSpinBox; class QDoubleSpinBox; class QLineEdit; class QListWidget; class QPushButton; class QTableWidget; class QTextEdit; class QComboBox; class QCheckBox; class QFileDialog; template class QtQuery : public Dialog::TQuery { public: QtQuery(Parameter &_param, const std::string &_title, const std::string &_description = "") : Dialog::TQuery(_param, _title, _description) {} // QtQueries are interactive - no need for handle(). virtual bool handle(){ return true; } }; class QtDialog::AtomQtQuery : public QWidget, public QtQuery { Q_OBJECT public: AtomQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~AtomQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QComboBox *inputBox; Dialog *dialog; }; class QtDialog::AtomsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: AtomsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~AtomsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: AtomQtQuery *subQuery; }; class QtDialog::BooleanQtQuery : public QWidget, public QtQuery { Q_OBJECT public: BooleanQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog); virtual ~BooleanQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QCheckBox *booleanCheckBox; Dialog *dialog; }; class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public QtQuery { Q_OBJECT public: RealSpaceMatrixQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~RealSpaceMatrixQtQuery(); public slots: void onUpdate(int, int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QTableWidget *inputTable; Dialog *dialog; }; class QtDialog::DoubleQtQuery : public QWidget, public QtQuery { Q_OBJECT public: DoubleQtQuery(Parameter &, const std::string &_title, const std::string &_description,QBoxLayout *_parent,Dialog *_dialog); virtual ~DoubleQtQuery(); public slots: void onUpdate(double); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QDoubleSpinBox *inputBox; Dialog *dialog; }; class QtDialog::DoublesQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: DoublesQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~DoublesQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: DoubleQtQuery *subQuery; }; class QtDialog::ElementQtQuery : public QWidget, public QtQuery { Q_OBJECT public: ElementQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog); virtual ~ElementQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QComboBox *inputBox; Dialog *dialog; }; class QtDialog::ElementsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: ElementsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~ElementsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: ElementQtQuery *subQuery; }; class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery { public: EmptyQtQuery(const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog); virtual ~EmptyQtQuery(); virtual bool handle(); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; Dialog *dialog; }; class QtDialog::FileQtQuery : public QWidget, public QtQuery { Q_OBJECT public: FileQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog); virtual ~FileQtQuery(); public slots: void onUpdate(); void showFileDialog(); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *filenameLabel; QLineEdit *filenameLineEdit; QPushButton *filedialogButton; QFileDialog *theFileDialog; Dialog *dialog; std::vector suffixes; bool mustBePresent; }; class QtDialog::FilesQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: FilesQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~FilesQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: FileQtQuery *subQuery; }; class QtDialog::IntQtQuery : public QWidget, public QtQuery { Q_OBJECT public: IntQtQuery(Parameter &, const std::string &_title, const std::string &description,QBoxLayout *_parent,Dialog *_dialog); virtual ~IntQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QSpinBox *inputBox; Dialog *dialog; }; class QtDialog::IntsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: IntsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~IntsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: IntQtQuery *subQuery; }; class QtDialog::MoleculeQtQuery : public QWidget, public QtQuery { Q_OBJECT public: MoleculeQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~MoleculeQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QComboBox *inputBox; Dialog *dialog; }; class QtDialog::MoleculesQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: MoleculesQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~MoleculesQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: MoleculeQtQuery *subQuery; }; class QtDialog::StringQtQuery : public QWidget, public QtQuery { Q_OBJECT public: StringQtQuery(Parameter &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~StringQtQuery(); public slots: void onUpdate(const QString&); void onUpdateCombo(int index); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QLineEdit *inputBox; QComboBox *comboBox; Dialog *dialog; }; class QtDialog::StringsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: StringsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~StringsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: StringQtQuery *subQuery; }; class QtDialog::UnsignedIntQtQuery : public QWidget, public QtQuery { Q_OBJECT public: UnsignedIntQtQuery(Parameter &, const std::string &_title, const std::string &description,QBoxLayout *_parent,Dialog *_dialog); virtual ~UnsignedIntQtQuery(); public slots: void onUpdate(int); private: QBoxLayout *parent; QBoxLayout *thisLayout; QLabel *titleLabel; QSpinBox *inputBox; Dialog *dialog; }; class QtDialog::UnsignedIntsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: UnsignedIntsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~UnsignedIntsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: UnsignedIntQtQuery *subQuery; }; class QtDialog::VectorQtQuery : public QWidget, public QtQuery { Q_OBJECT public: VectorQtQuery(Parameter &, const std::string &_title, const std::string &_description,QBoxLayout *,Dialog *); virtual ~VectorQtQuery(); public slots: void onUpdateX(double); void onUpdateY(double); void onUpdateZ(double); private: QBoxLayout *parent; QBoxLayout *mainLayout; QLabel *titleLabel; QBoxLayout *subLayout; QBoxLayout *coordLayout; QLabel *coordLabel; QDoubleSpinBox *coordInputX; QDoubleSpinBox *coordInputY; QDoubleSpinBox *coordInputZ; Dialog *dialog; }; class QtDialog::VectorsQtQuery : public QWidget, public QtQuery >, public QtQueryList { Q_OBJECT public: VectorsQtQuery(Parameter > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog); virtual ~VectorsQtQuery(); virtual void onSubUpdate(); public slots: void onAddElement(); void onRemoveElement(); void onElementSelected(); private: VectorQtQuery *subQuery; }; class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public QtQuery { Q_OBJECT public: RandomNumberDistribution_ParametersQtQuery(Parameter &, const std::string &_title, const std::string &_description,QBoxLayout *,Dialog *); virtual ~RandomNumberDistribution_ParametersQtQuery(); public slots: void onUpdate(); private: QBoxLayout *parent; QHBoxLayout *thisLayout; QLabel *titleLabel; QTextEdit *inputBox; QPushButton *okButton; Dialog *dialog; }; #endif /* QTQUERY_HPP_ */