Updating Doxygen styling and Licenses
[baulk.git] / src / Widgets / BaulkTerm / wrapper / baulkterm.h
blob4f020ce72894f56962c208b8dbcaf64e5b2cca7c
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 <builddefines.h>
37 #include <qtermwidget.h>
39 #include "rightclickmenu.h"
40 #include "terminalcolour.h"
42 //! Additional functionality for qtermwidget
43 class BaulkTerm : public BaulkWidget {
44 Q_OBJECT
46 public:
47 //! Default Constructor
48 /*!
49 * \param startNow 1 for starting the terminal right away, 0 for starting later
50 * \see startShellProgram
51 * \param standalone true if the terminal is started in standalone mode, false if used as a library
53 BaulkTerm( int startNow = 1, bool standalone = false, QWidget *parent = 0 );
56 //! Command Line Args
57 virtual bool processCommandArgs();
59 //! Start Terminal
60 void startShellProgram();
62 //! External Settings
63 bool useDaemon() const { return daemonEnabled; }
64 QString listenName() const { return daemonListenName; }
66 public slots:
67 //! New Terminal
68 void newTerminal( bool useMainWindow = false );
70 private:
71 int startPriority;
73 //! Terminal
74 QTermWidget *term;
75 QTermWidget *mainTerm;
76 QList<QTermWidget*> termList;
78 QVBoxLayout *termLayout;
80 //! Terminal Right Click Menu
81 BaulkTermRightClickMenu *rightClickMenu;
83 //! Configuration File Pointer
84 BaulkXML *xmlConfig;
86 //! Configuration Settings
87 qreal opacity;
88 qreal fadeOpacity;
90 int windowHeight;
91 int windowWidth;
92 int windowXpos;
93 int windowYpos;
95 bool daemonEnabled;
96 QString daemonListenName;
98 int historySize;
99 QString historyType;
101 QFont font;
103 bool useTabBar;
105 QString shellProgram;
106 QStringList environmentVariables;
108 //! Normal Colours
109 TerminalColour foreground;
110 TerminalColour background;
111 TerminalColour black;
112 TerminalColour red;
113 TerminalColour green;
114 TerminalColour yellow;
115 TerminalColour blue;
116 TerminalColour magenta;
117 TerminalColour cyan;
118 TerminalColour white;
120 //! Intensive Colours
121 TerminalColour intForeground;
122 TerminalColour intBackground;
123 TerminalColour intBlack;
124 TerminalColour intRed;
125 TerminalColour intGreen;
126 TerminalColour intYellow;
127 TerminalColour intBlue;
128 TerminalColour intMagenta;
129 TerminalColour intCyan;
130 TerminalColour intWhite;
133 //! Configuration Functions
134 void configurationDefaults();
135 void configurationLoad();
136 void configurationSave();
137 void configurationSet();
139 private slots:
140 void newTab();
141 void closeTab();
143 void xMouseInput( int, int, int, int );
144 void rightClickAction();
146 void updateMainWindowTitle( QString title );
148 void removeTerminalFromList( QTermWidget *terminal = 0 );
149 void removeTerminalViaUserClose();
151 void changeTransparency( qreal opacity, qreal fadeOpacity );
153 protected:
154 virtual void changeEvent( QEvent *event );
155 virtual void resizeEvent( QResizeEvent *event );
156 virtual void closeEvent( QCloseEvent *event );
158 signals:
159 void finished();
160 void removedTerminal();
163 #endif