| 1 | /* | 
|---|
| 2 | * QtQuery.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Nov 8, 2010 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef QTQUERY_HPP_ | 
|---|
| 9 | #define QTQUERY_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 | // include config.h | 
|---|
| 12 | #ifdef HAVE_CONFIG_H | 
|---|
| 13 | #include <config.h> | 
|---|
| 14 | #endif | 
|---|
| 15 |  | 
|---|
| 16 |  | 
|---|
| 17 | #include "Qt4/QtDialog.hpp" | 
|---|
| 18 |  | 
|---|
| 19 | class QHBoxLayout; | 
|---|
| 20 | class QBoxLayout; | 
|---|
| 21 | class QDialogButtonBox; | 
|---|
| 22 | class QLabel; | 
|---|
| 23 | class QSpinBox; | 
|---|
| 24 | class QDoubleSpinBox; | 
|---|
| 25 | class QLineEdit; | 
|---|
| 26 | class QListWidget; | 
|---|
| 27 | class QPushButton; | 
|---|
| 28 | class QTableWidget; | 
|---|
| 29 | class QTextEdit; | 
|---|
| 30 | class QComboBox; | 
|---|
| 31 |  | 
|---|
| 32 | // Forward declarations for plumbing | 
|---|
| 33 | template<typename T> class QtQueryListPipe; | 
|---|
| 34 | class AtomQtQueryPipe; | 
|---|
| 35 | class AtomsQtQueryPipe; | 
|---|
| 36 | class BooleanQtQueryPipe; | 
|---|
| 37 | class BoxQtQueryPipe; | 
|---|
| 38 | class DoubleQtQueryPipe; | 
|---|
| 39 | class DoublesQtQueryPipe; | 
|---|
| 40 | class ElementQtQueryPipe; | 
|---|
| 41 | class ElementsQtQueryPipe; | 
|---|
| 42 | class EmptyQtQueryPipe; | 
|---|
| 43 | class FileQtQueryPipe; | 
|---|
| 44 | class IntQtQueryPipe; | 
|---|
| 45 | class MoleculeQtQueryPipe; | 
|---|
| 46 | class MoleculesQtQueryPipe; | 
|---|
| 47 | class StringQtQueryPipe; | 
|---|
| 48 | class StringsQtQueryPipe; | 
|---|
| 49 | class VectorQtQueryPipe; | 
|---|
| 50 | class VectorsQtQueryPipe; | 
|---|
| 51 | class RandomNumberDistribution_ParametersQtQueryPipe; | 
|---|
| 52 |  | 
|---|
| 53 | class QtDialog::AtomQtQuery : public Dialog::AtomQuery { | 
|---|
| 54 | public: | 
|---|
| 55 | AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 56 | virtual ~AtomQtQuery(); | 
|---|
| 57 | virtual bool handle(); | 
|---|
| 58 | private: | 
|---|
| 59 | QBoxLayout *parent; | 
|---|
| 60 | QBoxLayout *thisLayout; | 
|---|
| 61 | QLabel *titleLabel; | 
|---|
| 62 | QComboBox *inputBox; | 
|---|
| 63 |  | 
|---|
| 64 | AtomQtQueryPipe *pipe; | 
|---|
| 65 | }; | 
|---|
| 66 |  | 
|---|
| 67 | class QtDialog::AtomsQtQuery : public Dialog::AtomsQuery { | 
|---|
| 68 | public: | 
|---|
| 69 | AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 70 | virtual ~AtomsQtQuery(); | 
|---|
| 71 | virtual bool handle(); | 
|---|
| 72 | private: | 
|---|
| 73 | QBoxLayout *parent; | 
|---|
| 74 | QBoxLayout *thisLayout; | 
|---|
| 75 | QLabel *titleLabel; | 
|---|
| 76 | QLabel *inputLabel; | 
|---|
| 77 | QListWidget *inputList; | 
|---|
| 78 |  | 
|---|
| 79 | AtomsQtQueryPipe *pipe; | 
|---|
| 80 | }; | 
|---|
| 81 |  | 
|---|
| 82 | class QtDialog::BooleanQtQuery : public Dialog::BooleanQuery { | 
|---|
| 83 | public: | 
|---|
| 84 | BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); | 
|---|
| 85 | virtual ~BooleanQtQuery(); | 
|---|
| 86 | virtual bool handle(); | 
|---|
| 87 | private: | 
|---|
| 88 | QBoxLayout *parent; | 
|---|
| 89 | QBoxLayout *thisLayout; | 
|---|
| 90 | QLabel *titleLabel; | 
|---|
| 91 | QComboBox *booleanComboBox; | 
|---|
| 92 |  | 
|---|
| 93 | BooleanQtQueryPipe *pipe; | 
|---|
| 94 | }; | 
|---|
| 95 |  | 
|---|
| 96 | class QtDialog::BoxQtQuery : public Dialog::BoxQuery { | 
|---|
| 97 | public: | 
|---|
| 98 | BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 99 | virtual ~BoxQtQuery(); | 
|---|
| 100 | virtual bool handle(); | 
|---|
| 101 | private: | 
|---|
| 102 | QBoxLayout *parent; | 
|---|
| 103 | QBoxLayout *thisLayout; | 
|---|
| 104 | QLabel *titleLabel; | 
|---|
| 105 | QTableWidget *inputTable; | 
|---|
| 106 |  | 
|---|
| 107 | BoxQtQueryPipe *pipe; | 
|---|
| 108 | }; | 
|---|
| 109 |  | 
|---|
| 110 | class QtDialog::DoubleQtQuery : public Dialog::DoubleQuery { | 
|---|
| 111 | public: | 
|---|
| 112 | DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 113 | virtual ~DoubleQtQuery(); | 
|---|
| 114 | virtual bool handle(); | 
|---|
| 115 | private: | 
|---|
| 116 | QBoxLayout *parent; | 
|---|
| 117 | QBoxLayout *thisLayout; | 
|---|
| 118 | QLabel *titleLabel; | 
|---|
| 119 | QDoubleSpinBox *inputBox; | 
|---|
| 120 |  | 
|---|
| 121 | DoubleQtQueryPipe *pipe; | 
|---|
| 122 | }; | 
|---|
| 123 |  | 
|---|
| 124 | class QtDialog::DoublesQtQuery : public Dialog::DoublesQuery { | 
|---|
| 125 | public: | 
|---|
| 126 | DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 127 | virtual ~DoublesQtQuery(); | 
|---|
| 128 | virtual bool handle(); | 
|---|
| 129 | private: | 
|---|
| 130 | QBoxLayout *parent; | 
|---|
| 131 | QBoxLayout *thisLayout; | 
|---|
| 132 | QLabel *titleLabel; | 
|---|
| 133 | QDoubleSpinBox *inputBox; | 
|---|
| 134 |  | 
|---|
| 135 | QtQueryListPipe<double> *pipe; | 
|---|
| 136 | }; | 
|---|
| 137 |  | 
|---|
| 138 | class QtDialog::ElementQtQuery : public Dialog::ElementQuery { | 
|---|
| 139 | public: | 
|---|
| 140 | ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); | 
|---|
| 141 | virtual ~ElementQtQuery(); | 
|---|
| 142 | virtual bool handle(); | 
|---|
| 143 | private: | 
|---|
| 144 | QBoxLayout *parent; | 
|---|
| 145 | QBoxLayout *thisLayout; | 
|---|
| 146 | QLabel *titleLabel; | 
|---|
| 147 | QComboBox *inputBox; | 
|---|
| 148 |  | 
|---|
| 149 | ElementQtQueryPipe *pipe; | 
|---|
| 150 | }; | 
|---|
| 151 |  | 
|---|
| 152 | class QtDialog::ElementsQtQuery : public Dialog::ElementsQuery { | 
|---|
| 153 | public: | 
|---|
| 154 | ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); | 
|---|
| 155 | virtual ~ElementsQtQuery(); | 
|---|
| 156 | virtual bool handle(); | 
|---|
| 157 | private: | 
|---|
| 158 | QBoxLayout *parent; | 
|---|
| 159 | QBoxLayout *thisLayout; | 
|---|
| 160 | QLabel *titleLabel; | 
|---|
| 161 | QComboBox *inputBox; | 
|---|
| 162 |  | 
|---|
| 163 | ElementsQtQueryPipe *pipe; | 
|---|
| 164 | }; | 
|---|
| 165 |  | 
|---|
| 166 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery { | 
|---|
| 167 | public: | 
|---|
| 168 | EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); | 
|---|
| 169 | virtual ~EmptyQtQuery(); | 
|---|
| 170 | virtual bool handle(); | 
|---|
| 171 | private: | 
|---|
| 172 | QBoxLayout *parent; | 
|---|
| 173 | QBoxLayout *thisLayout; | 
|---|
| 174 | QLabel *titleLabel; | 
|---|
| 175 |  | 
|---|
| 176 | EmptyQtQueryPipe *pipe; | 
|---|
| 177 | }; | 
|---|
| 178 |  | 
|---|
| 179 | class QtDialog::FileQtQuery : public Dialog::FileQuery { | 
|---|
| 180 | public: | 
|---|
| 181 | FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog); | 
|---|
| 182 | virtual ~FileQtQuery(); | 
|---|
| 183 | virtual bool handle(); | 
|---|
| 184 | private: | 
|---|
| 185 | QBoxLayout *parent; | 
|---|
| 186 | QBoxLayout *thisLayout; | 
|---|
| 187 | QLabel *filenameLabel; | 
|---|
| 188 | QLineEdit *filenameLineEdit; | 
|---|
| 189 | QPushButton *filedialogButton; | 
|---|
| 190 |  | 
|---|
| 191 | FileQtQueryPipe *pipe; | 
|---|
| 192 | }; | 
|---|
| 193 |  | 
|---|
| 194 | class QtDialog::IntQtQuery : public Dialog::IntQuery { | 
|---|
| 195 | public: | 
|---|
| 196 | IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 197 | virtual ~IntQtQuery(); | 
|---|
| 198 | virtual bool handle(); | 
|---|
| 199 | private: | 
|---|
| 200 | QBoxLayout *parent; | 
|---|
| 201 | QBoxLayout *thisLayout; | 
|---|
| 202 | QLabel *titleLabel; | 
|---|
| 203 | QSpinBox *inputBox; | 
|---|
| 204 |  | 
|---|
| 205 | IntQtQueryPipe *pipe; | 
|---|
| 206 | }; | 
|---|
| 207 |  | 
|---|
| 208 | class QtDialog::IntsQtQuery : public Dialog::IntsQuery { | 
|---|
| 209 | public: | 
|---|
| 210 | IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 211 | virtual ~IntsQtQuery(); | 
|---|
| 212 | virtual bool handle(); | 
|---|
| 213 | void IntegerEntered(const QString&); | 
|---|
| 214 | void IntegerSelected(); | 
|---|
| 215 | void AddInteger(); | 
|---|
| 216 | void RemoveInteger(); | 
|---|
| 217 | private: | 
|---|
| 218 | QBoxLayout *parent; | 
|---|
| 219 | QBoxLayout *thisLayout; | 
|---|
| 220 | QLabel *titleLabel; | 
|---|
| 221 |  | 
|---|
| 222 | QtQueryListPipe<int> *pipe; | 
|---|
| 223 | }; | 
|---|
| 224 |  | 
|---|
| 225 | class QtDialog::MoleculeQtQuery : public Dialog::MoleculeQuery { | 
|---|
| 226 | public: | 
|---|
| 227 | MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 228 | virtual ~MoleculeQtQuery(); | 
|---|
| 229 | virtual bool handle(); | 
|---|
| 230 | private: | 
|---|
| 231 | QBoxLayout *parent; | 
|---|
| 232 | QBoxLayout *thisLayout; | 
|---|
| 233 | QLabel *titleLabel; | 
|---|
| 234 | QComboBox *inputBox; | 
|---|
| 235 |  | 
|---|
| 236 | MoleculeQtQueryPipe *pipe; | 
|---|
| 237 | }; | 
|---|
| 238 |  | 
|---|
| 239 | class QtDialog::MoleculesQtQuery : public Dialog::MoleculesQuery { | 
|---|
| 240 | public: | 
|---|
| 241 | MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 242 | virtual ~MoleculesQtQuery(); | 
|---|
| 243 | virtual bool handle(); | 
|---|
| 244 | private: | 
|---|
| 245 | QBoxLayout *parent; | 
|---|
| 246 | QBoxLayout *thisLayout; | 
|---|
| 247 | QLabel *titleLabel; | 
|---|
| 248 | QComboBox *inputBox; | 
|---|
| 249 |  | 
|---|
| 250 | MoleculesQtQueryPipe *pipe; | 
|---|
| 251 | }; | 
|---|
| 252 |  | 
|---|
| 253 | class QtDialog::StringQtQuery : public Dialog::StringQuery { | 
|---|
| 254 | public: | 
|---|
| 255 | StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 256 | virtual ~StringQtQuery(); | 
|---|
| 257 | virtual bool handle(); | 
|---|
| 258 | private: | 
|---|
| 259 | QBoxLayout *parent; | 
|---|
| 260 | QBoxLayout *thisLayout; | 
|---|
| 261 | QLabel *titleLabel; | 
|---|
| 262 | QLineEdit *inputBox; | 
|---|
| 263 |  | 
|---|
| 264 | StringQtQueryPipe *pipe; | 
|---|
| 265 | }; | 
|---|
| 266 |  | 
|---|
| 267 | class QtDialog::StringsQtQuery : public Dialog::StringsQuery { | 
|---|
| 268 | public: | 
|---|
| 269 | StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog); | 
|---|
| 270 | virtual ~StringsQtQuery(); | 
|---|
| 271 | virtual bool handle(); | 
|---|
| 272 | private: | 
|---|
| 273 | QBoxLayout *parent; | 
|---|
| 274 | QBoxLayout *thisLayout; | 
|---|
| 275 | QLabel *titleLabel; | 
|---|
| 276 | QLineEdit *inputBox; | 
|---|
| 277 |  | 
|---|
| 278 | QtQueryListPipe<std::string> *pipe; | 
|---|
| 279 | }; | 
|---|
| 280 |  | 
|---|
| 281 | class QtDialog::VectorQtQuery : public Dialog::VectorQuery { | 
|---|
| 282 | public: | 
|---|
| 283 | VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *); | 
|---|
| 284 | virtual ~VectorQtQuery(); | 
|---|
| 285 | virtual bool handle(); | 
|---|
| 286 | private: | 
|---|
| 287 | QBoxLayout *parent; | 
|---|
| 288 | QBoxLayout *mainLayout; | 
|---|
| 289 | QLabel *titleLabel; | 
|---|
| 290 | QBoxLayout *subLayout; | 
|---|
| 291 | QBoxLayout *coordLayout; | 
|---|
| 292 | QLabel *coordLabel; | 
|---|
| 293 | QDoubleSpinBox *coordInput; | 
|---|
| 294 |  | 
|---|
| 295 | VectorQtQueryPipe *pipe; | 
|---|
| 296 | }; | 
|---|
| 297 |  | 
|---|
| 298 | class QtDialog::VectorsQtQuery : public Dialog::VectorsQuery { | 
|---|
| 299 | public: | 
|---|
| 300 | VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *); | 
|---|
| 301 | virtual ~VectorsQtQuery(); | 
|---|
| 302 | virtual bool handle(); | 
|---|
| 303 | private: | 
|---|
| 304 | QBoxLayout *parent; | 
|---|
| 305 | QBoxLayout *mainLayout; | 
|---|
| 306 | QLabel *titleLabel; | 
|---|
| 307 | QBoxLayout *subLayout; | 
|---|
| 308 | QBoxLayout *coordLayout; | 
|---|
| 309 | QLabel *coordLabel; | 
|---|
| 310 | QDoubleSpinBox *coordInput; | 
|---|
| 311 |  | 
|---|
| 312 | VectorsQtQueryPipe *pipe; | 
|---|
| 313 | }; | 
|---|
| 314 |  | 
|---|
| 315 | class QtDialog::RandomNumberDistribution_ParametersQtQuery : public Dialog::RandomNumberDistribution_ParametersQuery { | 
|---|
| 316 | public: | 
|---|
| 317 | RandomNumberDistribution_ParametersQtQuery(std::string title,QBoxLayout *,QtDialog *); | 
|---|
| 318 | virtual ~RandomNumberDistribution_ParametersQtQuery(); | 
|---|
| 319 | virtual bool handle(); | 
|---|
| 320 | private: | 
|---|
| 321 | QBoxLayout *parent; | 
|---|
| 322 | QHBoxLayout *thisLayout; | 
|---|
| 323 | QLabel *titleLabel; | 
|---|
| 324 | QTextEdit *inputBox; | 
|---|
| 325 | QPushButton *okButton; | 
|---|
| 326 |  | 
|---|
| 327 | RandomNumberDistribution_ParametersQtQueryPipe *pipe; | 
|---|
| 328 | }; | 
|---|
| 329 |  | 
|---|
| 330 | #endif /* QTQUERY_HPP_ */ | 
|---|