/** * @file SdiWindow/sdiwindow.h * @brief SdiWindow module's implementation * @author Enar Vaikene * * Copyright (c) 2011 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * * This file can be used under the terms of the GNU General Public License * version 3.0 as published by the Free Software Foundation and appearing in * the file LICENSE included in the packaging of this file. Please review the * the following information to ensure the GNU General Public License version * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. * * Alternatively, this file may be used in accordance with the Commercial License * Agreement provided with the Software. */ #ifndef __SDIWINDOW_SDIWINDOW_H # define __SDIWINDOW_SDIWINDOW_H #include "isdiwindow.h" #include #include #include #include #include class QVBoxLayout; namespace eVaf { namespace SdiWindow { namespace Internal { /** * Main window widget */ class MainWindow : public QWidget { Q_OBJECT public: MainWindow(QWidget * parent = 0, Qt::WindowFlags flags = 0); virtual ~MainWindow(); bool init(); void done(); void addWidget(QWidget * widget); void addLayout(QLayout * layout); private: // Methods void setWindowSize(); void saveSettings(); void restoreSettings(); private: // Members /// The layout of the window QVBoxLayout * mLayout; /// Widgets and layouts added to the main window QList mItemsAdded; }; /** * iSdiWindow interface implementation */ class SdiWindowImpl : public iSdiWindow { Q_OBJECT public: SdiWindowImpl(); virtual ~SdiWindowImpl(); bool init(const QString & args); void done(); bool isReady() const { return mReady; } virtual void addWidget(QWidget * widget) { wWindow->addWidget(widget); } virtual void addLayout(QLayout * layout) { wWindow->addLayout(layout); } private: // Members /// Ready flag bool mReady; /// The main window widget MainWindow * wWindow; }; /** * SdiWindow module's implementation */ class SdiWindowPlugin : public Plugins::iPlugin { Q_OBJECT public: SdiWindowPlugin(); virtual ~SdiWindowPlugin(); virtual bool init(const QString & args); virtual void done(); virtual bool isReady() const { return mWindow != 0 && mWindow->isReady(); } private: /// iSdiWindow interface implementation SdiWindowImpl * mWindow; }; } // namespace eVaf::SdiWindow::Internal } // namespace eVaf::SdiWindow } // namespace eVaf #endif // sdiwindow.h