summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/emulation_layer.h
authorwazlaf <wazlaf>2002-10-13 13:49:11 (UTC)
committer wazlaf <wazlaf>2002-10-13 13:49:11 (UTC)
commit68c37a3412ef4609ba0209318ef2b06f7dd1aaf1 (patch) (unidiff)
treef81ee5460dd49c4fcb8a61bf50911c5036742bed /noncore/apps/opie-console/emulation_layer.h
parent0e6d241e26211a8ffff07ba8e23f4a3cec9065be (diff)
downloadopie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.zip
opie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.tar.gz
opie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.tar.bz2
Scripting functionality added. What this currently does is catch keys in the emulation_layer
and store them in a "Script" instance. This can later be saved to a file and on request "replayed" by sending the typed keys to the associated IOLayer
Diffstat (limited to 'noncore/apps/opie-console/emulation_layer.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_layer.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/emulation_layer.h b/noncore/apps/opie-console/emulation_layer.h
index 91a4856..928ad04 100644
--- a/noncore/apps/opie-console/emulation_layer.h
+++ b/noncore/apps/opie-console/emulation_layer.h
@@ -32,6 +32,7 @@
32#include <stdio.h> 32#include <stdio.h>
33#include <qtextcodec.h> 33#include <qtextcodec.h>
34#include "keytrans.h" 34#include "keytrans.h"
35#include "script.h"
35 36
36class EmulationLayer : public QObject 37class EmulationLayer : public QObject
37{ Q_OBJECT 38{ Q_OBJECT
@@ -104,6 +105,22 @@ public:
104 void setKeytrans(int no); 105 void setKeytrans(int no);
105 void setKeytrans(const char * no); 106 void setKeytrans(const char * no);
106 107
108 /* Scripts */
109
110 /* Create a new script and record all typed characters */
111 void startRecording();
112
113 /* Return whether we are currently recording a script */
114 bool isRecording();
115
116 /* Return the current script (or NULL) */
117 Script *script();
118
119 /* Stop recording and remove the current script from memory */
120 void clearScript();
121
122 /* Run a script by forwarding its keys to the EmulationLayer */
123 void runScript(const Script *);
107protected: 124protected:
108 125
109 WidgetLayer* gui; 126 WidgetLayer* gui;
@@ -139,7 +156,7 @@ private:
139 int bulk_nlcnt; // bulk newline counter 156 int bulk_nlcnt; // bulk newline counter
140 char* SelectedText; 157 char* SelectedText;
141 int bulk_incnt; // bulk counter 158 int bulk_incnt; // bulk counter
142 159 Script *m_script;
143 160
144}; 161};
145 162