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., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, 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;
46
namespace KParts { class GUIActivateEvent; }
48
class konsoleFactory : public KParts::Factory
53
virtual ~konsoleFactory();
55
virtual KParts::Part* createPartObject(QWidget *parentWidget = 0, const char *widgetName = 0,
56
QObject* parent = 0, const char* name = 0,
57
const char* classname = "KParts::Part",
58
const QStringList &args = QStringList());
60
static KInstance *instance();
63
static KInstance *s_instance;
64
static KAboutData *s_aboutData;
67
//////////////////////////////////////////////////////////////////////
69
class konsolePart: public KParts::ReadOnlyPart, public TerminalInterface, public ExtTerminalInterface
73
konsolePart(QWidget *parentWidget, const char *widgetName, QObject * parent, const char *name, const char *classname = 0);
74
virtual ~konsolePart();
77
void processExited( KProcess * );
78
void receivedData( const QString& s );
81
virtual bool openURL( const KURL & url );
82
virtual bool openFile() {return false;} // never used
83
virtual bool closeURL() {return true;}
84
virtual void guiActivateEvent( KParts::GUIActivateEvent * event );
89
// void doneSession(TESession*);
90
void sessionDestroyed();
91
// void configureRequest(TEWidget*,int,int x,int y);
92
// void updateTitle(TESession*);
93
void enableMasterModeConnections();
96
void emitOpenURLRequest(const QString &url);
98
void readProperties();
99
void saveProperties();
100
void applyProperties();
101
void setSettingsMenuEnabled( bool );
103
void sendSignal(int n);
104
void closeCurrentSession();
106
void notifySize(int /*columns*/, int /*lines*/);
108
void slotToggleFrame();
109
void slotSelectScrollbar();
110
void slotSelectFont();
111
void schema_menu_check();
112
void keytab_menu_activated(int item);
113
void updateSchemaMenu();
114
void setSchema(int n);
115
void pixmap_menu_activated(int item);
116
void schema_menu_activated(int item);
117
void slotHistoryType();
118
void slotSelectBell();
119
void slotSelectLineSpacing();
120
void slotBlinkingCursor();
121
void slotUseKonsoleSettings();
123
void slotSetEncoding();
127
void autoShowShell();
130
konsoleBrowserExtension *m_extension;
134
void applySettingsToGUI();
136
// void setSchema(ColorSchema* s);
137
void updateKeytabMenu();
139
bool doOpenStream( const QString& );
140
bool doWriteStream( const QByteArray& );
141
bool doCloseStream();
143
QWidget* parentWidget;
146
// ColorSchemaList* colors;
147
KRootPixmap* rootxpm;
149
KActionCollection* actions;
150
KActionCollection* settingsActions;
152
KToggleAction* blinkingCursor;
153
KToggleAction* showFrame;
154
KToggleAction* m_useKonsoleSettings;
156
KSelectAction* selectBell;
157
KSelectAction* selectLineSpacing;
158
KSelectAction* selectScrollbar;
159
KSelectAction* selectSetEncoding;
161
KActionMenu* m_fontsizes;
163
KPopupMenu* m_keytab;
164
KPopupMenu* m_schema;
165
KPopupMenu* m_signals;
166
KPopupMenu* m_options;
167
KPopupMenu* m_popupMenu;
171
QString pmPath; // pixmap path
173
QString s_kconfigSchema;
174
QString s_word_seps; // characters that are considered part of a word
177
bool b_histEnabled:1;
178
bool b_useKonsoleSettings:1;
179
bool b_autoDestroy:1;
180
bool b_autoStartShell:1;
182
int curr_schema; // current schema no
189
bool m_streamEnabled;
193
// these are the implementations for the TermEmuInterface
195
void startProgram( const QString& program,
196
const QStrList& args );
198
void showShellInDir( const QString& dir );
199
void sendInput( const QString& text );
200
void setAutoDestroy( bool );
201
void setAutoStartShell( bool );
204
//////////////////////////////////////////////////////////////////////
206
/*class HistoryTypeDialog : public KDialogBase
210
HistoryTypeDialog(const HistoryType& histType,
211
unsigned int histSize,
216
void slotSetUnlimited();
217
void slotHistEnable(bool);
219
unsigned int nbLines() const;
223
QCheckBox* m_btnEnable;
225
QPushButton* m_setUnlimited;
228
//////////////////////////////////////////////////////////////////////
230
class konsoleBrowserExtension : public KParts::BrowserExtension
233
friend class konsolePart;
235
konsoleBrowserExtension(konsolePart *parent);
236
virtual ~konsoleBrowserExtension();
238
void emitOpenURLRequest(const KURL &url);