summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEHistory.h
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/TEHistory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEHistory.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.h b/core/apps/embeddedkonsole/TEHistory.h
new file mode 100644
index 0000000..8339ec6
--- a/dev/null
+++ b/core/apps/embeddedkonsole/TEHistory.h
@@ -0,0 +1,75 @@
1/* -------------------------------------------------------------------------- */
2/* */
3/* [TEHistory.H] History Buffer */
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 TEHISTORY_H
20#define TEHISTORY_H
21
22#include "TECommon.h"
23
24/*
25 An extendable tmpfile(1) based buffer.
26*/
27class HistoryBuffer
28{
29public:
30 HistoryBuffer();
31 ~HistoryBuffer();
32
33public:
34 void setScroll(bool on);
35 bool hasScroll();
36
37public:
38 void add(const unsigned char* bytes, int len);
39 void get(unsigned char* bytes, int len, int loc);
40 int len();
41
42private:
43 int ion;
44 int length;
45};
46
47class HistoryScroll
48{
49public:
50 HistoryScroll();
51 ~HistoryScroll();
52
53public:
54 void setScroll(bool on);
55 bool hasScroll();
56
57public: // access to history
58 int getLines();
59 int getLineLen(int lineno);
60 void getCells(int lineno, int colno, int count, ca res[]);
61
62public: // backward compatibility (obsolete)
63 ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; }
64
65public: // adding lines.
66 void addCells(ca a[], int count);
67 void addLine();
68
69private:
70 int startOfLine(int lineno);
71 HistoryBuffer index; // lines Row(int)
72 HistoryBuffer cells; // text Row(ca)
73};
74
75#endif // TEHISTORY_H