File indexing completed on 2024-05-19 03:49:37

0001 /*
0002     File                 : WorksheetPrivate.h
0003     Project              : LabPlot
0004     Description          : Private members of Worksheet.
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2012-2022 Alexander Semke <alexander.semke@web.de>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef WORKSHEETPRIVATE_H
0011 #define WORKSHEETPRIVATE_H
0012 
0013 #include <backend/worksheet/Worksheet.h>
0014 
0015 #include <QColor>
0016 
0017 class Background;
0018 class TreeModel;
0019 class Worksheet;
0020 class WorksheetElementContainer;
0021 
0022 class QBrush;
0023 class QGraphicsScene;
0024 
0025 class WorksheetPrivate {
0026 public:
0027     explicit WorksheetPrivate(Worksheet*);
0028     virtual ~WorksheetPrivate();
0029 
0030     Worksheet* const q;
0031     QRectF pageRect;
0032     QGraphicsScene* m_scene;
0033     Worksheet::ZoomFit zoomFit{Worksheet::ZoomFit::None};
0034     bool useViewSize{false};
0035     bool scaleContent{false};
0036 
0037     QString name() const;
0038     void update();
0039     void updateLayout(bool undoable = true);
0040     void setContainerRect(WorksheetElementContainer*, double x, double y, double h, double w, bool undoable);
0041     void updatePageRect();
0042 
0043     Background* background{nullptr};
0044     Worksheet::Layout layout{Worksheet::Layout::VerticalLayout};
0045     bool suppressLayoutUpdate{false};
0046     bool suppressCursorPosChanged{false};
0047     double layoutTopMargin{0.0};
0048     double layoutBottomMargin{0.0};
0049     double layoutLeftMargin{0.0};
0050     double layoutRightMargin{0.0};
0051     double layoutVerticalSpacing{0.0};
0052     double layoutHorizontalSpacing{0.0};
0053     int layoutColumnCount{2};
0054     int layoutRowCount{2};
0055     QString theme;
0056     bool plotsInteractive{true};
0057     bool updateCompleteCursorModel{true};
0058     Worksheet::CartesianPlotActionMode cartesianPlotActionMode{Worksheet::CartesianPlotActionMode::ApplyActionToSelection};
0059     Worksheet::CartesianPlotActionMode cartesianPlotCursorMode{Worksheet::CartesianPlotActionMode::ApplyActionToAll};
0060 
0061     int cursorTreeModelCurveBackgroundAlpha{50};
0062     enum class TreeModelColumn { PLOTNAME = 0, SIGNALNAME = 0, CURSOR0, CURSOR1, CURSORDIFF };
0063 
0064     TreeModel* cursorData{nullptr};
0065 
0066     friend class WorksheetTest;
0067 };
0068 
0069 #endif