Frapper  1.0a
PanelFrame.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; version 2.1 of the License.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
21 -----------------------------------------------------------------------------
22 */
23 
33 
34 #ifndef PANELFRAME_H
35 #define PANELFRAME_H
36 
37 #include "FrapperPrerequisites.h"
38 #include "Panel.h"
39 #include "ViewPanel.h"
40 #include "ui_PanelFrame.h"
41 #include <QtGui/QFrame>
42 #include <QtGui/QToolBar>
43 #include <QtGui/QLabel>
44 
45 
46 namespace Frapper {
47 
77 class FRAPPER_GUI_EXPORT PanelFrame : public QFrame, protected Ui::PanelFrame
78 {
79 
80  Q_OBJECT
81 
82 public: // constructors and destructors
83 
92  PanelFrame (Frapper::Panel::Type panelType, QWidget *parent = 0, Qt::WindowFlags flags = 0, bool showToolBars = true );
93 
101  virtual ~PanelFrame ();
102 
103 public: // functions
104 
110  Frapper::Panel * getPanel ();
111 
117  Panel::Type getPanelType ();
118 
124  void toggleToolBars ( bool visible );
125 
126 signals: //
127 
133  void panelTypeChanged ( const QString &panelTypeName );
134 
140  void duplicateRequested ( PanelFrame *panelFrame );
141 
148  void extractRequested ( PanelFrame *panelFrame );
149 
155  void closeRequested ( PanelFrame *panelFrame );
156 
163  void viewPanelCreated ( ViewPanel *viewPanel );
164 
165 protected: // event handlers
166 
172  virtual void focusInEvent ( QFocusEvent *event );
173 
179  virtual void resizeEvent ( QResizeEvent *event );
180 
181 private: // functions
182 
188  void setPanelType (Frapper::Panel::Type panelType );
189 
195  void split ( Qt::Orientation orientation );
196 
204  void maximizeWidget ( QWidget *widget );
205 
213  void minimizeWidget ( QWidget *widget );
214 
215 private slots: //
216 
223  void on_ui_panelTypeComboBox_currentIndexChanged ( int index );
224 
230  void on_ui_splitHorizontallyAction_triggered ();
231 
237  void on_ui_splitVerticallyAction_triggered ();
238 
242  void on_ui_maximizeAction_triggered ();
243 
247  void on_ui_maximizeHorizontallyAction_triggered ();
248 
252  void on_ui_maximizeVerticallyAction_triggered ();
253 
257  void on_ui_minimizeAction_triggered ();
258 
265  void on_ui_duplicateAction_triggered ();
266 
273  void on_ui_extractAction_triggered ();
274 
281  void on_ui_closeAction_triggered ();
282 
283 private: // data
284 
288  QToolBar *m_mainToolBar;
289 
293  QToolBar *m_panelToolBar;
294 
299 
304 
308  QLabel *m_label;
309 
310 };
311 
312 } // end namespace Frapper
313 
314 #endif