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

0001 /*
0002     File                 : ErrorBarStyle.h
0003     Project              : LabPlot
0004     Description          : The styling related part of the error bar definition
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2024 Alexander Semke <alexander.semke@web.de>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef ERRORBARSTYLE_H
0011 #define ERRORBARSTYLE_H
0012 
0013 #include "backend/core/AbstractAspect.h"
0014 #include "backend/lib/macros.h"
0015 
0016 class ErrorBarStylePrivate;
0017 class Line;
0018 class KConfigGroup;
0019 
0020 class ErrorBarStyle : public AbstractAspect {
0021     Q_OBJECT
0022 
0023 public:
0024     enum class Type { Simple, WithEnds };
0025 
0026     explicit ErrorBarStyle(const QString& name);
0027     ~ErrorBarStyle() override;
0028 
0029     void save(QXmlStreamWriter*) const override;
0030     bool load(XmlStreamReader*, bool preview) override;
0031     void loadThemeConfig(const KConfigGroup&);
0032     void loadThemeConfig(const KConfigGroup&, const QColor&);
0033     void saveThemeConfig(KConfigGroup&) const;
0034 
0035     void init(const KConfigGroup&);
0036 
0037     BASIC_D_ACCESSOR_DECL(Type, type, Type)
0038     BASIC_D_ACCESSOR_DECL(double, capSize, CapSize)
0039     Line* line() const;
0040 
0041     typedef ErrorBarStylePrivate Private;
0042 
0043 protected:
0044     ErrorBarStylePrivate* const d_ptr;
0045 
0046 private:
0047     Q_DECLARE_PRIVATE(ErrorBarStyle)
0048 
0049 Q_SIGNALS:
0050     void updateRequested();
0051     void updatePixmapRequested();
0052 
0053     void typeChanged(ErrorBarStyle::Type);
0054     void capSizeChanged(double);
0055 };
0056 
0057 #endif