Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TEHistory.h

Go to the documentation of this file.
00001 /* -------------------------------------------------------------------------- */
00002 /*                                                                            */
00003 /* [TEHistory.H]                   History Buffer                             */
00004 /*                                                                            */
00005 /* -------------------------------------------------------------------------- */
00006 /*                                                                            */
00007 /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de>            */
00008 /*                                                                            */
00009 /* This file is part of Konsole - an X terminal for KDE                       */
00010 /*                                                                            */
00011 /* -------------------------------------------------------------------------- */
00012 /*                                                                            */
00013 /* Ported Konsole to Qt/Embedded                                              */
00014 /*                                                                            */
00015 /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com>                  */
00016 /*                                                                            */
00017 /* -------------------------------------------------------------------------- */
00018 
00019 #ifndef TEHISTORY_H
00020 #define TEHISTORY_H
00021 
00022 #include "TECommon.h"
00023 
00024 /*
00025    An extendable tmpfile(1) based buffer.
00026 */
00027 class HistoryBuffer
00028 {
00029 public:
00030   HistoryBuffer();
00031  ~HistoryBuffer();
00032 
00033 public:
00034   void setScroll(bool on);
00035   bool hasScroll();
00036 
00037 public:
00038   void add(const unsigned char* bytes, int len);
00039   void get(unsigned char* bytes, int len, int loc);
00040   int  len();
00041 
00042 private:
00043   int  ion;
00044   int  length;
00045 };
00046 
00047 class HistoryScroll
00048 {
00049 public:
00050   HistoryScroll();
00051  ~HistoryScroll();
00052 
00053 public:
00054   void setScroll(bool on);
00055   bool hasScroll();
00056 
00057 public: // access to history
00058   int  getLines();
00059   int  getLineLen(int lineno);
00060   void getCells(int lineno, int colno, int count, ca res[]);
00061 
00062 public: // backward compatibility (obsolete)
00063   ca   getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; }
00064 
00065 public: // adding lines.
00066   void addCells(ca a[], int count);
00067   void addLine();
00068 
00069 private:
00070   int startOfLine(int lineno);
00071   HistoryBuffer index; // lines Row(int)
00072   HistoryBuffer cells; // text  Row(ca)
00073 };
00074 
00075 #endif // TEHISTORY_H

Generated on Sat Nov 5 16:15:27 2005 for OPIE by  doxygen 1.4.2