Updating Doxygen styling and Licenses
[baulk.git] / src / Baulk / Control / control.h
blob8f7b4caa93a9c1eca96584dd5d7d69d5df1a06a9
1 // Baulk - Control
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 __CONTROL_H
19 #define __CONTROL_H
21 #include <QAction>
22 #include <QApplication>
23 #include <QCloseEvent>
24 #include <QHBoxLayout>
25 #include <QHeaderView>
26 #include <QRegExp>
27 #include <QSplitter>
28 #include <QStackedWidget>
29 #include <QVBoxLayout>
30 #include <QWidget>
32 #include <baulkwidget.h>
33 #include <baulkxml.h>
34 #include <client.h>
35 #include <libraryloader.h>
37 #include "interfacedialog.h"
39 //! The main control for Baulk.
40 /**
41 * Handles most, if not all user interaction for Baulk, minus, what is
42 * provided by each Widget.
44 class BaulkControl : public BaulkWidget {
45 Q_OBJECT
47 public:
48 //! Default Constructor
49 BaulkControl( QWidget *parent = 0 );
51 //! Struct for list of libraries, contains a QStringList of names and QList of library loaders
52 struct LibraryList {
53 QStringList name;
54 QList<LibraryLoader*> library;
57 LibraryList libraryList() const { return libList; }
59 QList<QAction*> globalQActions() const { return glbQActions; }
61 public slots:
62 void loadMainWidget( LibraryLoader *library );
63 void modifyGlobalKeyShortcut( int key, QString keyShortcut );
65 private:
66 //! Main Layouts
67 QHBoxLayout *topHLayout;
68 QVBoxLayout *topVLayout;
70 //! Tab Layer
71 QStackedWidget *tabLayer;
73 //! Dynamic Layout
74 QSplitter *dynTopLayout;
75 QSplitter *dynBotLayout;
76 int lastKnownGoodIndex;
77 bool invertIndex;
79 //! Global QActions
80 QList<QAction*> glbQActions;
82 //! Interface Dialog
83 BaulkInterfaceDialog *interfaceDialog;
85 //! Library List
86 LibraryList libList;
88 //! Baulk Config Loader/Saver
89 BaulkXML *xmlConfig;
92 //! QAction Setup
93 QAction *addGlobalAction( QString title, QString keyShortcut, bool globalConnect = false );
94 void setupQActions();
96 //! Application Name for Errors
97 QString errorName() const { return tr("BaulkControl"); }
99 //! Widget Finders
100 int dynBotIndex();
101 int dynTopIndex();
103 private slots:
104 //! Dynamic Librariess
105 void loadLibraries();
107 //! Instanciates Information Client
108 void startInformationClient();
110 //! Tile Manipulation ** Focus
111 void focusDec();
112 void focusDecBorder();
113 void focusDown();
114 void focusInc();
115 void focusIncBorder();
116 void focusLeft();
117 void focusLayoutDec();
118 void focusLayoutInc();
119 void focusRight();
120 void focusUp();
121 //! Tile Manipulation ** Moving
122 void moveDec();
123 void moveDecBorder();
124 void moveDown();
125 void moveInc();
126 void moveIncBorder();
127 void moveLeft();
128 void moveLayoutDec();
129 void moveLayoutInc();
130 void moveRight();
131 void moveUp();
132 //! Tile Manipulation ** Orientation
133 void swapOrientationBot();
134 void swapOrientationTop();
135 //! Tile Manipulation ** Removal
136 void removeWidget();
138 //! Assistive Function
139 void globalActionTriggered();
141 protected:
142 virtual void closeEvent( QCloseEvent *event );
146 #endif