Daemon mode is now ready to use
[baulk.git] / src / Widgets / BaulkTerm / wrapper / baulkterm.h
blob747f0ee148268a660a5c9cc24130be58e0bfed42
1 // Baulk - qtermwidget Reimplement - BaulkTerm
2 //
3 // Baulk - Copyright (C) 2008 - Jacob Alexander
4 //
5 // Baulk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // any later version, including version 3 of the License.
9 //
10 // Baulk 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
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __BAULKTERM_H
19 #define __BAULKTERM_H
21 #include <iostream>
23 #include <QCloseEvent>
24 #include <QDialog>
25 #include <QEvent>
26 #include <QFont>
27 #include <QMainWindow>
28 #include <QResizeEvent>
29 #include <QTimer>
30 #include <QVBoxLayout>
31 #include <QWidget>
33 #include <baulkwidget.h>
34 #include <baulkwindow.h>
35 #include <baulkxml.h>
36 #include <qtermwidget.h>
38 #include "terminalcolour.h"
40 /**
41 * @author Jacob Alexander (HaaTa)
43 * Additional functionality for qtermwidget
45 class BaulkTerm : public BaulkWidget {
46 Q_OBJECT
48 public:
49 BaulkTerm( int startNow = 1, QWidget *parent = 0 );
52 // Command Line Args
53 virtual bool processCommandArgs();
55 // Start Terminal
56 void startShellProgram();
58 // External Settings
59 bool useDaemon() const { return daemonEnabled; }
60 QString listenName() const { return daemonListenName; }
62 public slots:
63 // New Terminal
64 void newTerminal();
66 private:
67 int startPriority;
69 QTermWidget *term;
70 QTermWidget *mainTerm;
71 QList<QTermWidget*> termList;
73 QVBoxLayout *termLayout;
75 BaulkXML *xmlConfig;
77 // Configuration Settings
78 qreal opacity;
79 qreal fadeOpacity;
81 bool daemonEnabled;
82 QString daemonListenName;
84 int historySize;
85 QString historyType;
87 QFont font;
89 bool useTabBar;
91 QString shellProgram;
92 QStringList environmentVariables;
94 // Normal Colours
95 TerminalColour foreground;
96 TerminalColour background;
97 TerminalColour black;
98 TerminalColour red;
99 TerminalColour green;
100 TerminalColour yellow;
101 TerminalColour blue;
102 TerminalColour magenta;
103 TerminalColour cyan;
104 TerminalColour white;
106 // Intensive Colours
107 TerminalColour intForeground;
108 TerminalColour intBackground;
109 TerminalColour intBlack;
110 TerminalColour intRed;
111 TerminalColour intGreen;
112 TerminalColour intYellow;
113 TerminalColour intBlue;
114 TerminalColour intMagenta;
115 TerminalColour intCyan;
116 TerminalColour intWhite;
119 // Configuration Functions
120 void configurationDefaults();
121 void configurationLoad();
122 void configurationSave();
123 void configurationSet();
125 private slots:
126 void newTab();
127 void closeTab();
129 void xMouseInput( int, int, int, int );
130 void rightClickAction();
132 void updateWindowTitle();
134 void removeTerminalFromList( QTermWidget *terminal = 0 );
135 void removeTerminalViaUserClose();
137 protected:
138 virtual void changeEvent( QEvent *event );
139 virtual void resizeEvent( QResizeEvent *event );
140 virtual void closeEvent( QCloseEvent *event );
142 signals:
143 void finished();
144 void removedTerminal();
147 #endif