summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEmulation.h
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/TEmulation.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEmulation.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/core/apps/embeddedkonsole/TEmulation.h b/core/apps/embeddedkonsole/TEmulation.h
new file mode 100644
index 0000000..ec15e7a
--- a/dev/null
+++ b/core/apps/embeddedkonsole/TEmulation.h
@@ -0,0 +1,117 @@
1/* -------------------------------------------------------------------------- */
2/* */
3/* [emulation.h] Fundamental Terminal Emulation */
4/* */
5/* -------------------------------------------------------------------------- */
6/* */
7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
8/* */
9/* This file is part of Konsole - an X terminal for KDE */
10/* */
11/* -------------------------------------------------------------------------- */
12 /* */
13/* Ported Konsole to Qt/Embedded */
14 /* */
15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
16 /* */
17/* -------------------------------------------------------------------------- */
18
19#ifndef EMULATION_H
20#define EMULATION_H
21
22#include "TEWidget.h"
23#include "TEScreen.h"
24#include <qtimer.h>
25#include <stdio.h>
26#include <qtextcodec.h>
27#include "keytrans.h"
28
29class TEmulation : public QObject
30{ Q_OBJECT
31
32public:
33
34 TEmulation(TEWidget* gui);
35 ~TEmulation();
36
37public:
38 virtual void setHistory(bool on);
39 virtual bool history();
40
41public slots: // signals incoming from TEWidget
42
43 virtual void onImageSizeChange(int lines, int columns);
44 virtual void onHistoryCursorChange(int cursor);
45 virtual void onKeyPress(QKeyEvent*);
46
47 virtual void clearSelection();
48 virtual void onSelectionBegin(const int x, const int y);
49 virtual void onSelectionExtend(const int x, const int y);
50 virtual void setSelection(const BOOL preserve_line_breaks);
51
52public slots: // signals incoming from data source
53
54 void onRcvBlock(const char* txt,int len);
55
56signals:
57
58 void sndBlock(const char* txt,int len);
59 void ImageSizeChanged(int lines, int columns);
60 void changeColumns(int columns);
61 void changeTitle(int arg, const char* str);
62
63public:
64
65 virtual void onRcvChar(int);
66
67 virtual void setMode (int) = 0;
68 virtual void resetMode(int) = 0;
69
70 virtual void sendString(const char*) = 0;
71
72 virtual void setConnect(bool r);
73 void setColumns(int columns);
74
75 void setKeytrans(int no);
76 void setKeytrans(const char * no);
77
78protected:
79
80 TEWidget* gui;
81 TEScreen* scr; // referes to one `screen'
82 TEScreen* screen[2]; // 0 = primary, 1 = alternate
83 void setScreen(int n); // set `scr' to `screen[n]'
84
85 bool connected; // communicate with widget
86
87 void setCodec(int c); // codec number, 0 = locale, 1=utf8
88
89 QTextCodec* codec;
90 QTextCodec* localeCodec;
91 QTextDecoder* decoder;
92
93 KeyTrans* keytrans;
94
95// refreshing related material.
96// this is localized in the class.
97private slots: // triggered by timer
98
99 void showBulk();
100
101private:
102
103 void bulkNewline();
104 void bulkStart();
105 void bulkEnd();
106
107private:
108
109 QTimer bulk_timer;
110 int bulk_nlcnt; // bulk newline counter
111 char* SelectedText;
112 int bulk_incnt; // bulk counter
113
114
115};
116
117#endif // ifndef EMULATION_H