2016-06-24 15:53:04 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-06-24 15:53:04 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-06-24 15:53:04 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-06-24 15:53:04 +02:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2017-10-19 07:39:16 +02:00
|
|
|
|
2019-04-02 19:18:00 +02:00
|
|
|
class QMdiArea;
|
2017-01-17 13:06:57 +01:00
|
|
|
struct RimMdiWindowGeometry;
|
2016-06-24 15:53:04 +02:00
|
|
|
|
2018-02-27 11:23:43 +01:00
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
class PdmObject;
|
|
|
|
class PdmUiTreeView;
|
|
|
|
class PdmUiItem;
|
|
|
|
} // namespace caf
|
2019-04-02 19:18:00 +02:00
|
|
|
|
2019-04-16 10:41:03 +02:00
|
|
|
class QMdiArea;
|
2019-03-29 12:00:29 +01:00
|
|
|
class QMdiSubWindow;
|
2019-03-28 18:30:55 +01:00
|
|
|
|
2017-10-19 07:39:16 +02:00
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-19 07:39:16 +02:00
|
|
|
//==================================================================================================
|
2016-06-24 15:53:04 +02:00
|
|
|
class RiuMainWindowBase : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RiuMainWindowBase();
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
virtual QString mainWindowName() = 0;
|
|
|
|
|
|
|
|
virtual void removeViewer( QWidget* viewer ) = 0;
|
|
|
|
virtual void addViewer( QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) = 0;
|
|
|
|
virtual void setActiveViewer( QWidget* subWindow ) = 0;
|
2016-06-24 15:53:04 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
virtual QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) = 0;
|
2017-01-17 13:06:57 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RimMdiWindowGeometry windowGeometryForViewer( QWidget* viewer );
|
|
|
|
void loadWinGeoAndDockToolBarLayout();
|
|
|
|
void saveWinGeoAndDockToolBarLayout();
|
|
|
|
void storeDefaultDockWidgetVisibilitiesIfRequired();
|
|
|
|
void restoreDockWidgetVisibilities();
|
|
|
|
void showWindow();
|
2017-01-17 13:06:57 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void hideAllDockWidgets();
|
2017-10-19 07:39:16 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmUiTreeView* projectTreeView()
|
|
|
|
{
|
|
|
|
return m_projectTreeView;
|
|
|
|
}
|
|
|
|
void setExpanded( const caf::PdmUiItem* uiItem, bool expanded = true );
|
2019-05-15 10:47:30 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void selectAsCurrentItem( const caf::PdmObject* object, bool allowActiveViewChange = true );
|
2018-02-27 11:23:43 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void enableShowFirstVisibleMdiWindowMaximized( bool enable );
|
2018-04-26 20:05:42 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
virtual void tileSubWindows() = 0;
|
|
|
|
virtual void storeSubWindowTiling( bool tiled ) = 0;
|
|
|
|
virtual void clearWindowTiling() = 0;
|
|
|
|
virtual bool subWindowsAreTiled() const = 0;
|
|
|
|
|
|
|
|
void setBlockSlotSubWindowActivated( bool block );
|
|
|
|
bool blockSlotSubWindowActivated() const;
|
2019-04-04 19:19:13 +02:00
|
|
|
|
2019-04-16 10:41:03 +02:00
|
|
|
protected:
|
2019-09-06 10:40:57 +02:00
|
|
|
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );
|
2019-04-16 10:41:03 +02:00
|
|
|
|
2018-04-26 20:05:42 +02:00
|
|
|
protected slots:
|
2019-09-06 10:40:57 +02:00
|
|
|
void slotDockWidgetToggleViewActionTriggered();
|
|
|
|
void addViewerToMdiArea( QMdiArea* mdiArea, QWidget* viewer, const QPoint& subWindowPos, const QSize& subWindowSize );
|
2018-02-27 11:23:43 +01:00
|
|
|
|
|
|
|
protected:
|
2018-04-26 20:05:42 +02:00
|
|
|
caf::PdmUiTreeView* m_projectTreeView;
|
2019-09-06 10:40:57 +02:00
|
|
|
bool m_allowActiveViewChangeFromSelection; // To be used in selectedObjectsChanged() to control
|
|
|
|
// whether to select the corresponding active view or not
|
2016-08-03 14:05:55 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
QString registryFolderName();
|
2019-03-28 18:30:55 +01:00
|
|
|
|
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
bool m_showFirstVisibleWindowMaximized;
|
|
|
|
bool m_blockSlotSubWindowActivated;
|
2016-06-24 15:53:04 +02:00
|
|
|
};
|