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

history.h

Go to the documentation of this file.
00001 /* -------------------------------------------------------------------------- */
00002 /*                                                                            */
00003 /* [history.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 /*                                                                            */
00014 /* Ported Konsole to Qt/Embedded                                              */
00015 /*                                                                            */
00016 /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com>                  */
00017 /*                                                                            */
00018 /* -------------------------------------------------------------------------- */
00019 /*                                                                            */
00020 /* ported embedded_konsole to opie-console                                    */
00021 /*                                                                            */
00022 /* Copyright (C) 2002 by opie developers <opie@handhelds.org>                 */
00023 /*                                                                            */
00024 /* -------------------------------------------------------------------------- */
00025 
00026 #ifndef HISTORY_H
00027 #define HISTORY_H
00028 
00029 #include "common.h"
00030 
00031 /*
00032    An extendable tmpfile(1) based buffer.
00033 */
00034 class HistoryBuffer
00035 {
00036 public:
00037   HistoryBuffer();
00038  ~HistoryBuffer();
00039 
00040 public:
00041   void setScroll(bool on);
00042   bool hasScroll();
00043 
00044 public:
00045   void add(const unsigned char* bytes, int len);
00046   void get(unsigned char* bytes, int len, int loc);
00047   int  len();
00048 
00049 private:
00050   int  ion;
00051   int  length;
00052 };
00053 
00054 class HistoryScroll
00055 {
00056 public:
00057   HistoryScroll();
00058  ~HistoryScroll();
00059 
00060 public:
00061   void setScroll(bool on);
00062   bool hasScroll();
00063 
00064 public: // access to history
00065   int  getLines();
00066   int  getLineLen(int lineno);
00067   void getCells(int lineno, int colno, int count, Character res[]);
00068 
00069 public: // backward compatibility (obsolete)
00070   Character   getCell(int lineno, int colno) { Character res; getCells(lineno,colno,1,&res); return res; }
00071 
00072 public: // adding lines.
00073   void addCells(Character a[], int count);
00074   void addLine();
00075 
00076 private:
00077   int startOfLine(int lineno);
00078   HistoryBuffer index; // lines Row(int)
00079   HistoryBuffer cells; // text  Row(Character)
00080 };
00081 
00082 #endif // HISTORY_H

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