]>
vaikene.ee Git - evaf/blob - src/plugins/SdiWindow/sdiwindow.h
4c46eea83617e083813905eae322f5e80cbcbe63
2 * @file SdiWindow/sdiwindow.h
3 * @brief SdiWindow module's implementation
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __SDIWINDOW_SDIWINDOW_H
21 # define __SDIWINDOW_SDIWINDOW_H
23 #include "isdiwindow.h"
25 #include <Plugins/iPlugin>
42 * Main window widget implementing the iSdiWindow interface
44 class MainWindow
: public QWidget
, public iSdiWindow
47 Q_INTERFACES(eVaf::SdiWindow::iSdiWindow
)
51 MainWindow(QWidget
* parent
= 0, Qt::WindowFlags flags
= 0);
53 virtual ~MainWindow();
55 virtual bool init(QString
const & args
);
59 virtual bool isReady() { return mReady
; }
61 virtual void addPanel(QString
const & name
, Gui::Panel
* panel
);
63 virtual Gui::Panel
* panel(QString
const & name
) const;
65 virtual bool showPanel(QString
const & name
);
67 virtual void changeEvent(QEvent
* e
);
69 virtual void closeEvent(QCloseEvent
* e
);
81 void restoreSettings();
89 /// The layout of the main window
90 QVBoxLayout
* mLayout
;
92 /// Name of the main panel that becomes part of this window
93 QString mMainPanelName
;
95 /// List of GUI::Panel objects added to the manager
96 QList
<Gui::Panel
*> mPanels
;
98 /// List of minimized GUI::Panel objects
99 QVector
<Gui::Panel
*> mMinimizedPanels
;
101 /// Hash with panel names
102 QHash
<QString
, Gui::Panel
*> mPanelNames
;
104 /// Current main panel added to this window
105 Gui::Panel
* mMainPanel
;
110 /// Gets the main panel name from module attributes
111 QString
getMainPanelName(QString
const & args
) const;
116 /// Panel destroyed signal. We need to remove the panel from all the
118 void panelDestroyed(QObject
* obj
= 0);
123 * SdiWindow module's implementation
125 class SdiWindowPlugin
: public Plugins::iPlugin
128 Q_INTERFACES(eVaf::Plugins::iPlugin
)
134 virtual ~SdiWindowPlugin();
136 virtual bool init(const QString
& args
);
140 virtual bool isReady() const { return mWindow
!= 0 && mWindow
->isReady(); }
145 /// iSdiWindow interface implementation
146 MainWindow
* mWindow
;
149 } // namespace eVaf::SdiWindow::Internal
150 } // namespace eVaf::SdiWindow
153 #endif // sdiwindow.h