1
/* Copyright (C) 2008 e_k (e_k@users.sourceforge.net)
3
This library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Library General Public
5
License as published by the Free Software Foundation; either
6
version 2 of the License, or (at your option) any later version.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
20
#ifndef _Q_TERM_WIDGET
21
#define _Q_TERM_WIDGET
25
struct TermWidgetImpl;
27
enum COLOR_SCHEME { COLOR_SCHEME_WHITE_ON_BLACK = 1,
28
COLOR_SCHEME_GREEN_ON_BLACK,
29
COLOR_SCHEME_BLACK_ON_LIGHT_YELLOW };
31
class QTermWidget : public QWidget
36
enum ScrollBarPosition
38
/** Do not show the scroll bar. */
40
/** Show the scroll bar on the left side of the display. */
42
/** Show the scroll bar on the right side of the display. */
48
QTermWidget(int startnow = 1, //start shell programm immediatelly
52
//start shell program if it was not started in constructor
53
void startShellProgram();
55
//look-n-feel, if you don`t like defaults
58
// Default is application font with family Monospace, size 10
59
// USE ONLY FIXED-PITCH FONT!
60
// otherwise symbols' position could be incorrect
61
void setTerminalFont(QFont &font);
64
void setEnvironment(const QStringList& environment);
66
// Shell program, default is /bin/bash
67
void setShellProgram(const QString &progname);
70
void setWorkingDirectory(const QString& dir);
72
// Shell program args, default is none
73
void setArgs(QStringList &args);
75
//Text codec, default is UTF-8
76
void setTextCodec(QTextCodec *codec);
78
//Color scheme, default is white on black
79
void setColorScheme(int scheme);
82
void setSize(int h, int v);
84
// History size for scrolling
85
void setHistorySize(int lines); //infinite if lines < 0
87
// Presence of scrollbar
88
void setScrollBarPosition(ScrollBarPosition);
90
// Send some text to terminal
91
void sendText(QString &text);
93
// Sets whether flow control is enabled
94
void setFlowControlEnabled(bool enabled);
96
// Returns whether flow control is enabled
97
bool flowControlEnabled(void);
100
* Sets whether the flow control warning box should be shown
101
* when the flow control stop key (Ctrl+S) is pressed.
103
void setFlowControlWarningEnabled(bool enabled);
109
// Paste clipboard content to terminal
110
void copyClipboard();
112
// Copies selection to clipboard
113
void pasteClipboard();
116
virtual void resizeEvent(QResizeEvent *);
119
void sessionFinished();
123
TermWidgetImpl *m_impl;
127
//Maybe useful, maybe not
132
void *createTermWidget(int startnow, void *parent);