ResInsight/ApplicationCode/UserInterface/RiuPlotMainWindow.h

127 lines
3.9 KiB
C
Raw Normal View History

2016-06-24 08:10:18 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
// 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.
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiuMainWindowBase.h"
#include "RiuMdiArea.h"
2016-10-04 04:44:31 -05:00
#include "cafPdmUiDragDropInterface.h"
#include "cafPdmPointer.h"
2016-10-04 04:44:31 -05:00
#include <memory>
2016-06-24 08:10:18 -05:00
class QMdiSubWindow;
2016-06-24 08:10:18 -05:00
class RiuViewer;
2016-06-24 08:10:18 -05:00
struct RimMdiWindowGeometry;
class RimViewWindow;
2016-06-24 08:10:18 -05:00
namespace caf
{
class PdmUiTreeView;
class PdmObject;
class PdmUiPropertyView;
class PdmUiItem;
class PdmUiToolBarEditor;
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();
2016-06-24 08:10:18 -05:00
QString mainWindowName() override;
void initializeGuiNewProjectLoaded();
void cleanupGuiBeforeProjectClose();
void cleanUpTemporaryWidgets();
2016-06-24 08:10:18 -05:00
void removeViewer( QWidget* viewer ) override;
void addViewer(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;
2018-03-12 05:12:39 -05:00
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
2016-06-24 08:10:18 -05:00
void setWidthOfMdiWindow(QWidget* mdiWindowWidget, int newWidth);
2017-03-15 14:15:04 -05:00
void addToTemporaryWidgets(QWidget* widget);
void updateWellLogPlotToolBar();
void updateSummaryPlotToolBar(bool forceUpdateUi = false);
2016-06-24 08:10:18 -05:00
protected:
void closeEvent(QCloseEvent* event) 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();
2016-06-24 08:10:18 -05:00
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;
QMenu* m_windowMenu;
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
2016-06-24 08:10:18 -05:00
caf::PdmUiPropertyView* m_pdmUiPropertyView;
2017-03-15 14:15:04 -05:00
std::vector<QWidget*> m_temporaryWidgets;
2016-06-24 08:10:18 -05:00
};