]>
vaikene.ee Git - evaf/blob - src/plugins/SdiWindow/sdiwindow.h
0032bc6dafd5986daabb74cc8b11d4f3e4800056
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>
42 class MainWindow
: public QWidget
48 MainWindow(QWidget
* parent
= 0, Qt::WindowFlags flags
= 0);
50 virtual ~MainWindow();
56 void addWidget(QWidget
* widget
);
58 void addLayout(QLayout
* layout
);
67 void restoreSettings();
72 /// The layout of the window
73 QVBoxLayout
* mLayout
;
75 /// Widgets and layouts added to the main window
76 QList
<QWeakPointer
<QObject
> > mItemsAdded
;
81 * iSdiWindow interface implementation
83 class SdiWindowImpl
: public iSdiWindow
91 virtual ~SdiWindowImpl();
93 bool init(const QString
& args
);
97 bool isReady() const { return mReady
; }
99 virtual void addWidget(QWidget
* widget
) { wWindow
->addWidget(widget
); }
101 virtual void addLayout(QLayout
* layout
) { wWindow
->addLayout(layout
); }
109 /// The main window widget
110 MainWindow
* wWindow
;
114 * SdiWindow module's implementation
116 class SdiWindowPlugin
: public Plugins::iPlugin
124 virtual ~SdiWindowPlugin();
126 virtual bool init(const QString
& args
);
130 virtual bool isReady() const { return mWindow
!= 0 && mWindow
->isReady(); }
135 /// iSdiWindow interface implementation
136 SdiWindowImpl
* mWindow
;
139 } // namespace eVaf::SdiWindow::Internal
140 } // namespace eVaf::SdiWindow
143 #endif // sdiwindow.h