[a2ab15] | 1 | /*
|
---|
| 2 | * CommandLineDialog.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: May 8, 2010
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef COMMANDLINEDIALOG_HPP_
|
---|
| 9 | #define COMMANDLINEDIALOG_HPP_
|
---|
| 10 |
|
---|
| 11 | #include <string>
|
---|
| 12 |
|
---|
[97ebf8] | 13 | class atom;
|
---|
| 14 | class element;
|
---|
| 15 | class molecule;
|
---|
| 16 | class Vector;
|
---|
| 17 |
|
---|
[5079a0] | 18 | #include "Dialog.hpp"
|
---|
[a2ab15] | 19 |
|
---|
| 20 | /** CommandLineUIFactory implementation of the Dialog.
|
---|
| 21 | * The idea here is that for each query the parsed command line options are used instead.
|
---|
| 22 | */
|
---|
| 23 | class CommandLineDialog : public Dialog
|
---|
| 24 | {
|
---|
| 25 | public:
|
---|
| 26 | CommandLineDialog();
|
---|
| 27 | virtual ~CommandLineDialog();
|
---|
| 28 |
|
---|
[86466e] | 29 | virtual void queryEmpty(const char *, std::string = "");
|
---|
[75dc28] | 30 | virtual void queryInt(const char *, std::string = "");
|
---|
| 31 | virtual void queryBoolean(const char *, std::string = "");
|
---|
| 32 | virtual void queryString(const char*, std::string = "");
|
---|
| 33 | virtual void queryStrings(const char*, std::string = "");
|
---|
| 34 | virtual void queryDouble(const char*, std::string = "");
|
---|
| 35 | virtual void queryAtom(const char*, std::string = "");
|
---|
| 36 | virtual void queryMolecule(const char*, std::string = "");
|
---|
| 37 | virtual void queryVector(const char*, bool, std::string = "");
|
---|
| 38 | virtual void queryBox(const char*, std::string = "");
|
---|
| 39 | virtual void queryElement(const char*, std::string = "");
|
---|
[a2ab15] | 40 |
|
---|
| 41 | protected:
|
---|
| 42 | // specialized stuff for text queries
|
---|
[86466e] | 43 | class EmptyCommandLineQuery : public Dialog::EmptyQuery {
|
---|
[a2ab15] | 44 | public:
|
---|
[86466e] | 45 | EmptyCommandLineQuery(std::string title, std::string _description = "");
|
---|
| 46 | virtual ~EmptyCommandLineQuery();
|
---|
[a2ab15] | 47 | virtual bool handle();
|
---|
| 48 | };
|
---|
| 49 |
|
---|
[86466e] | 50 | class IntCommandLineQuery : public Dialog::IntQuery {
|
---|
[a2ab15] | 51 | public:
|
---|
[75dc28] | 52 | IntCommandLineQuery(std::string title, std::string _description = "");
|
---|
[86466e] | 53 | virtual ~IntCommandLineQuery();
|
---|
[a2ab15] | 54 | virtual bool handle();
|
---|
| 55 | };
|
---|
| 56 |
|
---|
[97ebf8] | 57 | class BooleanCommandLineQuery : public Dialog::BooleanQuery {
|
---|
| 58 | public:
|
---|
[75dc28] | 59 | BooleanCommandLineQuery(std::string title, std::string _description = "");
|
---|
[97ebf8] | 60 | virtual ~BooleanCommandLineQuery();
|
---|
| 61 | virtual bool handle();
|
---|
| 62 | };
|
---|
| 63 |
|
---|
[86466e] | 64 | class DoubleCommandLineQuery : public Dialog::DoubleQuery {
|
---|
[a2ab15] | 65 | public:
|
---|
[75dc28] | 66 | DoubleCommandLineQuery(std::string title, std::string _description = "");
|
---|
[86466e] | 67 | virtual ~DoubleCommandLineQuery();
|
---|
[a2ab15] | 68 | virtual bool handle();
|
---|
| 69 | };
|
---|
| 70 |
|
---|
[86466e] | 71 | class StringCommandLineQuery : public Dialog::StringQuery {
|
---|
[a2ab15] | 72 | public:
|
---|
[75dc28] | 73 | StringCommandLineQuery(std::string title, std::string _description = "");
|
---|
[86466e] | 74 | virtual ~StringCommandLineQuery();
|
---|
[a2ab15] | 75 | virtual bool handle();
|
---|
| 76 | };
|
---|
| 77 |
|
---|
[cd8e55] | 78 | class StringsCommandLineQuery : public Dialog::StringsQuery {
|
---|
| 79 | public:
|
---|
[75dc28] | 80 | StringsCommandLineQuery(std::string title, std::string _description = "");
|
---|
[cd8e55] | 81 | virtual ~StringsCommandLineQuery();
|
---|
| 82 | virtual bool handle();
|
---|
| 83 | };
|
---|
| 84 |
|
---|
[97ebf8] | 85 | class AtomCommandLineQuery : public Dialog::AtomQuery {
|
---|
| 86 | public:
|
---|
[75dc28] | 87 | AtomCommandLineQuery(std::string title, std::string _description = "");
|
---|
[97ebf8] | 88 | virtual ~AtomCommandLineQuery();
|
---|
| 89 | virtual bool handle();
|
---|
| 90 | };
|
---|
| 91 |
|
---|
[86466e] | 92 | class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
|
---|
[a2ab15] | 93 | public:
|
---|
[75dc28] | 94 | MoleculeCommandLineQuery(std::string title, std::string _description = "");
|
---|
[86466e] | 95 | virtual ~MoleculeCommandLineQuery();
|
---|
[a2ab15] | 96 | virtual bool handle();
|
---|
| 97 | };
|
---|
| 98 |
|
---|
[86466e] | 99 | class VectorCommandLineQuery : public Dialog::VectorQuery {
|
---|
[a2ab15] | 100 | public:
|
---|
[75dc28] | 101 | VectorCommandLineQuery(std::string title,bool _check, std::string _description = "");
|
---|
[86466e] | 102 | virtual ~VectorCommandLineQuery();
|
---|
| 103 | virtual bool handle();
|
---|
| 104 | };
|
---|
| 105 |
|
---|
[97ebf8] | 106 | class BoxCommandLineQuery : public Dialog::BoxQuery {
|
---|
| 107 | public:
|
---|
[75dc28] | 108 | BoxCommandLineQuery(std::string title, std::string _description = "");
|
---|
[97ebf8] | 109 | virtual ~BoxCommandLineQuery();
|
---|
| 110 | virtual bool handle();
|
---|
| 111 | };
|
---|
| 112 |
|
---|
[86466e] | 113 | class ElementCommandLineQuery : public Dialog::ElementQuery {
|
---|
| 114 | public:
|
---|
[75dc28] | 115 | ElementCommandLineQuery(std::string title, std::string _description = "");
|
---|
[86466e] | 116 | virtual ~ElementCommandLineQuery();
|
---|
[a2ab15] | 117 | virtual bool handle();
|
---|
| 118 | };
|
---|
| 119 | };
|
---|
| 120 |
|
---|
| 121 | #endif /* COMMANDLINEDIALOG_HPP_ */
|
---|