ResInsight/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h

146 lines
4.4 KiB
C
Raw Normal View History

2016-06-24 08:10:18 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
2016-06-24 08:10:18 -05: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.
//
2016-06-24 08:10:18 -05: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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
2016-06-24 08:10:18 -05:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiuMainWindowBase.h"
#include "RiuMdiArea.h"
#include "cafPdmPointer.h"
#include "cafPdmUiDragDropInterface.h"
2016-10-04 04:44:31 -05:00
#include <QPointer>
#include <memory>
2020-04-01 05:48:02 -05:00
struct RimMdiWindowGeometry;
2020-04-01 05:48:02 -05:00
class QMdiSubWindow;
2016-06-24 08:10:18 -05:00
class RiuViewer;
class RimViewWindow;
class RicSummaryPlotEditorDialog;
class RicSummaryCurveCalculatorDialog;
2020-04-01 05:48:02 -05:00
class RiuMessagePanel;
2016-06-24 08:10:18 -05:00
namespace caf
{
class PdmUiTreeView;
class PdmObject;
class PdmUiPropertyView;
class PdmUiItem;
class PdmUiToolBarEditor;
} // namespace caf
2016-06-24 08:10:18 -05:00
//==================================================================================================
//
//
2016-06-24 08:10:18 -05:00
//
//==================================================================================================
2018-04-26 23:28:08 -05:00
class RiuPlotMainWindow : public RiuMainWindowBase
2016-06-24 08:10:18 -05:00
{
Q_OBJECT
public:
2018-04-26 23:28:08 -05:00
RiuPlotMainWindow();
~RiuPlotMainWindow();
2016-06-24 08:10:18 -05:00
QString mainWindowName() override;
void initializeGuiNewProjectLoaded();
void cleanupGuiBeforeProjectClose();
void cleanUpTemporaryWidgets();
void removeViewer( QWidget* viewer ) override;
2020-10-07 08:00:26 -05:00
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
void setActiveViewer( QWidget* subWindow ) override;
2016-06-24 08:10:18 -05:00
void setDefaultWindowSize();
2016-06-24 08:10:18 -05:00
void tileSubWindows() override;
void storeSubWindowTiling( bool tiled ) override;
void clearWindowTiling() override;
bool subWindowsAreTiled() const override;
bool isAnyMdiSubWindowVisible();
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* subWindow );
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
2016-06-24 08:10:18 -05:00
void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth );
void addToTemporaryWidgets( QWidget* widget );
2017-03-15 14:15:04 -05:00
void updateWellLogPlotToolBar();
void updateMultiPlotToolBar();
void updateSummaryPlotToolBar( bool forceUpdateUi = false );
void setFocusToLineEditInSummaryToolBar();
RicSummaryPlotEditorDialog* summaryCurveCreatorDialog();
RicSummaryCurveCalculatorDialog* summaryCurveCalculatorDialog();
2020-04-01 05:48:02 -05:00
RiuMessagePanel* messagePanel();
2016-06-24 08:10:18 -05:00
protected:
void closeEvent( QCloseEvent* event ) override;
void keyPressEvent( QKeyEvent* ) override;
2016-06-24 08:10:18 -05:00
private:
void setPdmRoot( caf::PdmObject* pdmRoot );
2016-06-24 08:10:18 -05:00
void createMenus();
void createToolBars();
void createDockPanels();
2016-06-24 08:10:18 -05:00
void restoreTreeViewState();
2016-06-24 08:10:18 -05:00
void refreshToolbars();
static QStringList toolbarCommandIds( const QString& toolbarName = "" );
2016-06-24 08:10:18 -05:00
private slots:
friend class RiuMdiSubWindow;
void slotBuildWindowActions();
2016-06-24 08:10:18 -05:00
void slotSubWindowActivated( QMdiSubWindow* subWindow );
2016-06-24 08:10:18 -05:00
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
2016-06-24 08:10:18 -05:00
private:
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
RiuMdiArea* m_mdiArea;
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
2020-04-01 05:48:02 -05:00
QPointer<RiuMessagePanel> m_messagePanel;
QMenu* m_windowMenu;
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
caf::PdmUiToolBarEditor* m_multiPlotToolBarEditor;
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
2016-06-24 08:10:18 -05:00
caf::PdmUiPropertyView* m_pdmUiPropertyView;
QPointer<RicSummaryPlotEditorDialog> m_summaryCurveCreatorDialog;
QPointer<RicSummaryCurveCalculatorDialog> m_summaryCurveCalculatorDialog;
std::vector<QWidget*> m_temporaryWidgets;
2016-06-24 08:10:18 -05:00
};