summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEHistory.h
blob: fcf6496341e12ba1faa59e8336a3e1f01058f651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* -------------------------------------------------------------------------- */
/*                                                                            */
/* [TEHistory.H]                   History Buffer                             */
/*                                                                            */
/* -------------------------------------------------------------------------- */
/*                                                                            */
/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de>            */
/*                                                                            */
/* This file is part of Konsole - an X terminal for KDE                       */
/*                                                                            */
/* -------------------------------------------------------------------------- */
/*                        */
/* Ported Konsole to Qt/Embedded                                              */
/*                        */
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com>                  */
/*                        */
/* -------------------------------------------------------------------------- */

#ifndef TEHISTORY_H
#define TEHISTORY_H

#include "TECommon.h"

class HistoryScroll
{
public:
  HistoryScroll();
 ~HistoryScroll();

public:
 void setSize(int lines, int cells);
 void setScroll(bool on);
 bool hasScroll();

 int  getLines();
 int  getLineLen(int lineno);
 void getCells(int lineno, int colno, int count, ca *res);

  ca   getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; }

  void addCells(ca *text, int count);
  void addLine();

private:
  int startOfLine(int lineno);

  int m_max_lines;
  int *m_lines;
  int m_max_cells;
  ca *m_cells;
  int m_first_line;
  int m_last_cell;
  int m_num_lines;
  int m_start_line;
};

#endif // TEHISTORY_H