00001 #ifndef OPIE_EMULATION_HANDLER_H 00002 #define OPIE_EMULATION_HANDLER_H 00003 00004 #include <qobject.h> 00005 #include <qcolor.h> 00006 #include <qcstring.h> 00007 00008 /* 00009 * Badly ibotty lacks the time to finish 00010 * his widget in time.. 00011 * Never the less we've to have an EmulationWidget 00012 * This is why I'm taking the inferior not cleaned 00013 * up TE* KDE STUFF 00014 */ 00015 00026 class Profile; 00027 class QWidget; 00028 class QPushButton; 00029 class TEWidget; 00030 class QFile; 00031 class TEmulation; 00032 class QFont; 00033 class QTextStream; 00034 class Script; 00035 class Logger; 00036 00037 class EmulationHandler : public QObject { 00038 Q_OBJECT 00039 public: 00045 EmulationHandler( const Profile&, QWidget* parent, const char* name = 0l ); 00046 00050 ~EmulationHandler(); 00051 00052 void load( const Profile& ); 00053 QWidget* widget(); 00054 TEmulation *emulation(); 00055 void setColor( const QColor& fore, const QColor& back ); 00056 QPushButton* cornerButton(); 00057 00058 /* Scripts */ 00059 /* Create a new script and record all typed characters */ 00060 void startRecording(); 00061 00062 void startLogging(const QString); 00063 00064 /* Return whether we are currently recording a script */ 00065 bool isRecording(); 00066 00067 /* Return whether we are currently recording a log */ 00068 bool isLogging(); 00069 00070 QString logFileName(); 00071 00072 /* Return the current script (or NULL) */ 00073 Script *script(); 00074 00075 /* Stop recording and remove the current script from memory */ 00076 void clearScript(); 00077 00078 /* Stop logging and remove the current log from memory */ 00079 void clearLog(); 00080 00081 /* Run a script by forwarding its keys to the EmulationLayer */ 00082 void runScript(const Script *); 00083 00084 /* Propagate change to widget */ 00085 void setWrap(int columns); 00086 void setScrollbarLocation(int index); 00087 signals: 00088 void send( const QByteArray& ); 00089 void changeSize(int rows, int cols ); 00090 00091 00092 public slots: 00093 void recv( const QByteArray& ); 00094 void paste(); 00095 void copy(); 00096 00097 private slots: 00098 void recvEmulation( const char*, int len ); 00099 private: 00100 QFont font( int ); 00101 QColor foreColor(int ); 00102 QColor backColor(int ); 00103 00104 private: 00105 TEWidget* m_teWid; 00106 TEmulation* m_teEmu; 00107 Script * m_script; 00108 Logger *m_log; 00109 QString m_logFileName; 00110 }; 00111 00112 #endif
1.4.2