File indexing completed on 2024-05-12 15:27:36

0001 /***************************************************************************
0002     File                 : PartMdiView.h
0003     Project              : LabPlot
0004     Description          : QMdiSubWindow wrapper for aspect views.
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2013-2019 by Alexander Semke (alexander.semke@web.de)
0007     Copyright            : (C) 2007,2008 Tilman Benkert (thzs@gmx.net)
0008     Copyright            : (C) 2007,2008 Knut Franke (knut.franke@gmx.de)
0009 
0010  ***************************************************************************/
0011 
0012 /***************************************************************************
0013  *                                                                         *
0014  *  This program is free software; you can redistribute it and/or modify   *
0015  *  it under the terms of the GNU General Public License as published by   *
0016  *  the Free Software Foundation; either version 2 of the License, or      *
0017  *  (at your option) any later version.                                    *
0018  *                                                                         *
0019  *  This program is distributed in the hope that it will be useful,        *
0020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0022  *  GNU General Public License for more details.                           *
0023  *                                                                         *
0024  *   You should have received a copy of the GNU General Public License     *
0025  *   along with this program; if not, write to the Free Software           *
0026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0027  *   Boston, MA  02110-1301  USA                                           *
0028  *                                                                         *
0029  ***************************************************************************/
0030 #ifndef PART_MDI_VIEW_H
0031 #define PART_MDI_VIEW_H
0032 
0033 #include <QMdiSubWindow>
0034 
0035 class AbstractAspect;
0036 class AbstractPart;
0037 
0038 class PartMdiView : public QMdiSubWindow {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit PartMdiView(AbstractPart*);
0043     ~PartMdiView() override;
0044     AbstractPart* part() const;
0045 
0046 private:
0047     void closeEvent(QCloseEvent*) override;
0048     AbstractPart* m_part;
0049     bool m_closing{false};
0050 
0051 private slots:
0052     void handleAspectDescriptionChanged(const AbstractAspect*);
0053     void handleAspectAboutToBeRemoved(const AbstractAspect*);
0054     void slotWindowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
0055 };
0056 
0057 #endif // ifndef PART_MDI_VIEW_H