Frapper  1.0a
Window.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 WINDOW_H
35 #define WINDOW_H
36 
37 #include "FrapperPrerequisites.h"
38 #include "PanelFrame.h"
39 #include "ui_Window.h"
40 #include <QtCore/QSettings>
41 
42 
43 namespace Frapper {
44 
65 class FRAPPER_GUI_EXPORT Window : public QMainWindow, protected Ui::Window
66 {
67 
68  Q_OBJECT
69 
70 public: // static constants
71 
75  static const QString DefaultLayout;
76 
80  static const QString SingleViewLayout;
81 
85  static const QString FullscreenViewLayout;
86 
87 public: // constructors and destructors
88 
100  Window ( QObject *parent, const QString &applicationName, const QString &title, const QString &layoutName, bool isMainWindow = false );
101 
109  virtual ~Window ();
110 
111 public: // functions
112 
119  void getLayoutSettings (QSettings &settings, QObject *rootChild) const;
120 
127  QWidget * setLayoutSettings (QSettings &settings, QString index = "0");
128 
132  void setLayoutIds (QObject *rootChild);
133 
139  bool isMainWindow ();
140 
146  bool hasDocumentation ();
147 
152  void showDocumentationMainPage ();
153 
159  QString title ();
160 
166  void setTitle ( const QString &title );
167 
171  void setFullscreen ( bool fullscreen );
172 
176  void clearLayout ();
177 
178 public slots: //
179 
186  void updateWindowTitle ( const QString &panelTypeName );
187 
193  void duplicatePanelFrame ( PanelFrame *panelFrame );
194 
200  void extractPanelFrame ( PanelFrame *panelFrame );
201 
207  void closePanelFrame ( PanelFrame *panelFrame );
208 
209 signals: //
210 
216  void windowActivated ( Window *window );
217 
223  void windowRenamed ( Window *window );
224 
231  void windowClosed ( Window *window, QCloseEvent *event );
232 
240  void createWindowRequested ( const QString &panelTypeName, const QPoint &position, const QSize &panelSize );
241 
248  void viewPanelCreated ( ViewPanel *viewPanel );
249 
256  void nodeContextMenuRequested ( const QPoint &position );
257 
258 protected: // events
259 
265  void contextMenuEvent ( QContextMenuEvent *event );
266 
272  void changeEvent ( QEvent *event );
273 
279  void closeEvent ( QCloseEvent *event );
280 
281 private: // functions
282 
290  void applyLayout ( const QString &layoutName, Panel::Type panelType = Panel::T_Viewport );
291 
292 private slots:
293 
294  // window menu actions
295 
299  void applyDefaultLayout ();
300 
305  void applyViewportOnlyLayout ();
306 
307 private: // data
308 
313 
318 
322  QString m_title;
323 
324 };
325 
326 } // end namespace Frapper
327 
328 #endif