diff options
Diffstat (limited to 'akonadi2_cli/repl/replStates.h')
-rw-r--r-- | akonadi2_cli/repl/replStates.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/akonadi2_cli/repl/replStates.h b/akonadi2_cli/repl/replStates.h new file mode 100644 index 0000000..a019a37 --- /dev/null +++ b/akonadi2_cli/repl/replStates.h | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Aaron Seigo <aseigo@kde.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | |||
20 | #pragma once | ||
21 | |||
22 | #include <QState> | ||
23 | |||
24 | class QSocketNotifier; | ||
25 | |||
26 | class ReadState : public QState | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | |||
30 | public: | ||
31 | ReadState(QState *parent = 0); | ||
32 | |||
33 | Q_SIGNALS: | ||
34 | void command(const QString &command); | ||
35 | void exitRequested(); | ||
36 | |||
37 | protected: | ||
38 | void onEntry(QEvent *event); | ||
39 | virtual const char *prompt() const; | ||
40 | }; | ||
41 | |||
42 | class UnfinishedReadState : public ReadState | ||
43 | { | ||
44 | Q_OBJECT | ||
45 | |||
46 | public: | ||
47 | UnfinishedReadState(QState *parent = 0); | ||
48 | |||
49 | protected: | ||
50 | const char *prompt() const; | ||
51 | }; | ||
52 | |||
53 | class EvalState : public QState | ||
54 | { | ||
55 | Q_OBJECT | ||
56 | |||
57 | public: | ||
58 | EvalState(QState *parent = 0); | ||
59 | |||
60 | Q_SIGNALS: | ||
61 | void completed(); | ||
62 | void continueInput(); | ||
63 | void output(const QString &output); | ||
64 | |||
65 | protected: | ||
66 | void onEntry(QEvent *event); | ||
67 | |||
68 | private: | ||
69 | bool m_complete; | ||
70 | }; | ||
71 | |||
72 | class PrintState : public QState | ||
73 | { | ||
74 | Q_OBJECT | ||
75 | |||
76 | public: | ||
77 | PrintState(QState *parent = 0); | ||
78 | |||
79 | Q_SIGNALS: | ||
80 | void completed(); | ||
81 | |||
82 | protected: | ||
83 | void onEntry(QEvent *event); | ||
84 | }; | ||
85 | |||