2
This file is part of the KDE system
3
Copyright (C) 1999,2000 Boloni Laszlo
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#ifndef __KONSOLE_PART_H__
22
#define __KONSOLE_PART_H__
24
#include <kparts/browserextension.h>
25
#include <kparts/factory.h>
28
#include <kdialogbase.h>
30
#include <kde_terminal_interface.h>
33
//#include "session.h"
36
class konsoleBrowserExtension;
45
namespace KParts { class GUIActivateEvent; }
47
class konsoleFactory : public KParts::Factory
52
virtual ~konsoleFactory();
54
virtual KParts::Part* createPartObject(QWidget *parentWidget = 0, const char *widgetName = 0,
55
QObject* parent = 0, const char* name = 0,
56
const char* classname = "KParts::Part",
57
const QStringList &args = QStringList());
59
static KInstance *instance();
62
static KInstance *s_instance;
63
static KAboutData *s_aboutData;
66
//////////////////////////////////////////////////////////////////////
68
class konsolePart: public KParts::ReadOnlyPart, public TerminalInterface
72
konsolePart(QWidget *parentWidget, const char *widgetName, QObject * parent, const char *name, const char *classname = 0);
73
virtual ~konsolePart();
77
void receivedData( const QString& s );
79
virtual bool openURL( const KURL & url );
80
virtual bool openFile() {return false;} // never used
81
virtual bool closeURL() {return true;}
82
virtual void guiActivateEvent( KParts::GUIActivateEvent * event );
86
void slotProcessExited();
87
void slotReceivedData( const QString& s );
89
// void doneSession(TESession*);
90
void sessionDestroyed();
91
// void configureRequest(TEWidget*,int,int x,int y);
93
void enableMasterModeConnections();
96
void emitOpenURLRequest(const QString &url);
98
void readProperties();
99
void saveProperties();
101
void sendSignal(int n);
102
void closeCurrentSession();
104
void notifySize(int,int);
106
void slotToggleFrame();
107
void slotSelectScrollbar();
108
void slotSelectFont();
109
void schema_menu_check();
110
void keytab_menu_activated(int item);
111
void updateSchemaMenu();
112
void setSchema(int n);
113
void pixmap_menu_activated(int item);
114
void schema_menu_activated(int item);
115
void slotHistoryType();
116
void slotSelectBell();
117
void slotSelectLineSpacing();
118
void slotBlinkingCursor();
123
konsoleBrowserExtension *m_extension;
127
void applySettingsToGUI();
129
void setFont(int fontno);
130
// void setSchema(ColorSchema* s);
131
void updateKeytabMenu();
133
bool doOpenStream( const QString& );
134
bool doWriteStream( const QByteArray& );
135
bool doCloseStream();
137
QWidget* parentWidget;
140
// ColorSchemaList* colors;
141
KRootPixmap* rootxpm;
143
KToggleAction* blinkingCursor;
144
KToggleAction* showFrame;
146
KSelectAction* selectBell;
147
KSelectAction* selectFont;
148
KSelectAction* selectLineSpacing;
149
KSelectAction* selectScrollbar;
151
KPopupMenu* m_keytab;
152
KPopupMenu* m_schema;
153
KPopupMenu* m_signals;
154
KPopupMenu* m_options;
155
KPopupMenu* m_popupMenu;
159
QString pmPath; // pixmap path
161
QString s_kconfigSchema;
162
QString s_word_seps; // characters that are considered part of a word
163
QString fontNotFound_par;
166
bool b_histEnabled:1;
168
int curr_schema; // current schema no
176
bool m_streamEnabled;
178
// these are the implementations for the TermEmuInterface
180
void startProgram( const QString& program,
181
const QStrList& args );
182
void showShellInDir( const QString& dir );
183
void sendInput( const QString& text );
186
//////////////////////////////////////////////////////////////////////
188
/*class HistoryTypeDialog : public KDialogBase
192
HistoryTypeDialog(const HistoryType& histType,
193
unsigned int histSize,
198
void slotSetUnlimited();
199
void slotHistEnable(bool);
201
unsigned int nbLines() const;
205
QCheckBox* m_btnEnable;
207
QPushButton* m_setUnlimited;
210
//////////////////////////////////////////////////////////////////////
212
class konsoleBrowserExtension : public KParts::BrowserExtension
215
friend class konsolePart;
217
konsoleBrowserExtension(konsolePart *parent);
218
virtual ~konsoleBrowserExtension();
220
void emitOpenURLRequest(const KURL &url);