3 // Baulk - Copyright (C) 2008 - Jacob Alexander
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.
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/>.
22 #include <QApplication>
23 #include <QCloseEvent>
24 #include <QHBoxLayout>
25 #include <QHeaderView>
28 #include <QStackedWidget>
29 #include <QVBoxLayout>
32 #include <baulkwidget.h>
35 #include <libraryloader.h>
37 #include "interfacedialog.h"
39 //! The main control for Baulk.
41 * Handles most, if not all user interaction for Baulk, minus, what is
42 * provided by each Widget.
44 class BaulkControl
: public BaulkWidget
{
48 //! Default Constructor
49 BaulkControl( QWidget
*parent
= 0 );
51 //! Struct for list of libraries, contains a QStringList of names and QList of library loaders
54 QList
<LibraryLoader
*> library
;
57 LibraryList
libraryList() const { return libList
; }
59 QList
<QAction
*> globalQActions() const { return glbQActions
; }
62 void loadMainWidget( LibraryLoader
*library
);
63 void modifyGlobalKeyShortcut( int key
, QString keyShortcut
);
67 QHBoxLayout
*topHLayout
;
68 QVBoxLayout
*topVLayout
;
71 QStackedWidget
*tabLayer
;
74 QSplitter
*dynTopLayout
;
75 QSplitter
*dynBotLayout
;
76 int lastKnownGoodIndex
;
80 QList
<QAction
*> glbQActions
;
83 BaulkInterfaceDialog
*interfaceDialog
;
88 //! Baulk Config Loader/Saver
93 QAction
*addGlobalAction( QString title
, QString keyShortcut
, bool globalConnect
= false );
96 //! Application Name for Errors
97 QString
errorName() const { return tr("BaulkControl"); }
104 //! Dynamic Librariess
105 void loadLibraries();
107 //! Instanciates Information Client
108 void startInformationClient();
110 //! Tile Manipulation ** Focus
112 void focusDecBorder();
115 void focusIncBorder();
117 void focusLayoutDec();
118 void focusLayoutInc();
121 //! Tile Manipulation ** Moving
123 void moveDecBorder();
126 void moveIncBorder();
128 void moveLayoutDec();
129 void moveLayoutInc();
132 //! Tile Manipulation ** Orientation
133 void swapOrientationBot();
134 void swapOrientationTop();
135 //! Tile Manipulation ** Removal
138 //! Assistive Function
139 void globalActionTriggered();
142 virtual void closeEvent( QCloseEvent
*event
);