File indexing completed on 2025-01-26 03:34:10

0001 /*
0002     File                 : CustomPoint.h
0003     Project              : LabPlot
0004     Description          : Custom user-defined point on the plot
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2015 Ankit Wagadre <wagadre.ankit@gmail.com>
0007     SPDX-FileCopyrightText: 2015 Alexander Semke <alexander.semke@web.de>
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef CUSTOMPOINT_H
0012 #define CUSTOMPOINT_H
0013 
0014 #include <QPen>
0015 
0016 #include "backend/lib/macros.h"
0017 #include "backend/worksheet/WorksheetElement.h"
0018 
0019 class CartesianPlot;
0020 class CustomPointPrivate;
0021 class Symbol;
0022 class QBrush;
0023 
0024 class CustomPoint : public WorksheetElement {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit CustomPoint(CartesianPlot*, const QString&);
0029     ~CustomPoint() override;
0030 
0031     QIcon icon() const override;
0032     virtual QMenu* createContextMenu() override;
0033 
0034     void save(QXmlStreamWriter*) const override;
0035     bool load(XmlStreamReader*, bool preview) override;
0036 
0037     Symbol* symbol() const;
0038 
0039     void retransform() override;
0040     void handleResize(double horizontalRatio, double verticalRatio, bool pageResize) override;
0041 
0042     typedef CustomPointPrivate Private;
0043 
0044 protected:
0045     CustomPoint(const QString& name, CustomPointPrivate* dd);
0046 
0047 private:
0048     Q_DECLARE_PRIVATE(CustomPoint)
0049     void init();
0050     void initActions();
0051 
0052 Q_SIGNALS:
0053     friend class CustomPointSetPositionCmd;
0054 };
0055 
0056 #endif