File indexing completed on 2024-05-12 15:27:58

0001 /***************************************************************************
0002     File                 : CustomPointDock.h
0003     Project              : LabPlot
0004     Description          : Dock widget for the custom point on the plot
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2015-2020 Alexander Semke (alexander.semke@web.de)
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *  This program is free software; you can redistribute it and/or modify   *
0012  *  it under the terms of the GNU General Public License as published by   *
0013  *  the Free Software Foundation; either version 2 of the License, or      *
0014  *  (at your option) any later version.                                    *
0015  *                                                                         *
0016  *  This program is distributed in the hope that it will be useful,        *
0017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0019  *  GNU General Public License for more details.                           *
0020  *                                                                         *
0021  *   You should have received a copy of the GNU General Public License     *
0022  *   along with this program; if not, write to the Free Software           *
0023  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0024  *   Boston, MA  02110-1301  USA                                           *
0025  *                                                                         *
0026  ***************************************************************************/
0027 
0028 #ifndef CUSTOMPOINTDOCK_H
0029 #define CUSTOMPOINTDOCK_H
0030 
0031 #include "backend/worksheet/plots/cartesian/Symbol.h"
0032 #include "kdefrontend/dockwidgets/BaseDock.h"
0033 #include "ui_custompointdock.h"
0034 
0035 class AbstractAspect;
0036 class CustomPoint;
0037 class KConfig;
0038 
0039 class CustomPointDock : public BaseDock {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit CustomPointDock(QWidget *);
0044     void setPoints(QList<CustomPoint*>);
0045     void updateLocale() override;
0046 
0047 private:
0048     Ui::CustomPointDock ui;
0049     QList<CustomPoint*> m_pointsList;
0050     CustomPoint* m_point{nullptr};
0051 
0052     void load();
0053     void loadConfig(KConfig&);
0054 
0055 private slots:
0056     void init();
0057 
0058     //SLOTs for changes triggered in CustomPointDock
0059     //General-Tab
0060     void positionXChanged();
0061     void positionXDateTimeChanged(const QDateTime&);
0062     void positionYChanged();
0063     void visibilityChanged(bool);
0064 
0065     //Symbol-tab
0066     void symbolStyleChanged(int);
0067     void symbolSizeChanged(double);
0068     void symbolRotationChanged(int);
0069     void symbolOpacityChanged(int);
0070     void symbolFillingStyleChanged(int);
0071     void symbolFillingColorChanged(const QColor&);
0072     void symbolBorderStyleChanged(int);
0073     void symbolBorderColorChanged(const QColor&);
0074     void symbolBorderWidthChanged(double);
0075 
0076     //SLOTs for changes triggered in CustomPoint
0077     //General-Tab
0078     void pointDescriptionChanged(const AbstractAspect*);
0079     void pointPositionChanged(QPointF);
0080     void pointVisibilityChanged(bool);
0081 
0082     //Symbol-Tab
0083     void pointSymbolStyleChanged(Symbol::Style);
0084     void pointSymbolSizeChanged(qreal);
0085     void pointSymbolRotationAngleChanged(qreal);
0086     void pointSymbolOpacityChanged(qreal);
0087     void pointSymbolBrushChanged(const QBrush&);
0088     void pointSymbolPenChanged(const QPen&);
0089 
0090     //load and save
0091     void loadConfigFromTemplate(KConfig&);
0092     void saveConfigAsTemplate(KConfig&);
0093 
0094 signals:
0095     void info(const QString&);
0096 };
0097 
0098 #endif