]>
vaikene.ee Git - evaf/blob - src/plugins/SdiWindow/sdiwindow.h
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>
31 #include <QWeakPointer>
40 * Main window widget implementing the iSdiWindow interface
42 class MainWindow
: public QWidget
, public iSdiWindow
45 Q_INTERFACES(eVaf::SdiWindow::iSdiWindow
)
49 MainWindow(QWidget
* parent
= 0, Qt::WindowFlags flags
= 0);
51 virtual ~MainWindow();
53 virtual bool init(QString
const & args
);
57 virtual bool isReady() { return mReady
; }
59 virtual void addWidget(QWidget
* widget
);
61 virtual void addLayout(QLayout
* layout
);
70 void restoreSettings();
78 /// The layout of the window
79 QVBoxLayout
* mLayout
;
81 /// Widgets and layouts added to the main window
82 QList
<QWeakPointer
<QObject
> > mItemsAdded
;
87 * SdiWindow module's implementation
89 class SdiWindowPlugin
: public Plugins::iPlugin
97 virtual ~SdiWindowPlugin();
99 virtual bool init(const QString
& args
);
103 virtual bool isReady() const { return mWindow
!= 0 && mWindow
->isReady(); }
108 /// iSdiWindow interface implementation
109 MainWindow
* mWindow
;
112 } // namespace eVaf::SdiWindow::Internal
113 } // namespace eVaf::SdiWindow
116 #endif // sdiwindow.h