File indexing completed on 2024-05-12 15:27:59
0001 /*************************************************************************** 0002 File : HistogramDock.h 0003 Project : LabPlot 0004 Description : widget for histogram plot properties 0005 -------------------------------------------------------------------- 0006 Copyright : (C) 2016 Anu Mittal (anu22mittal@gmail.com) 0007 0008 ***************************************************************************/ 0009 0010 /*************************************************************************** 0011 * * 0012 * This program is free software; you can redistribute it and/or modify * 0013 * it under the terms of the GNU General Public License as published by * 0014 * the Free Software Foundation; either version 2 of the License, or * 0015 * (at your option) any later version. * 0016 * * 0017 * This program is distributed in the hope that it will be useful, * 0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0020 * GNU General Public License for more details. * 0021 * * 0022 * You should have received a copy of the GNU General Public License * 0023 * along with this program; if not, write to the Free Software * 0024 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0025 * Boston, MA 02110-1301 USA * 0026 * * 0027 ***************************************************************************/ 0028 0029 #ifndef HISTOGRAMDOCK_H 0030 #define HISTOGRAMDOCK_H 0031 0032 #include "backend/worksheet/plots/cartesian/Histogram.h" 0033 #include "kdefrontend/dockwidgets/BaseDock.h" 0034 #include "ui_histogramdock.h" 0035 0036 class Histogram; 0037 class TreeViewComboBox; 0038 class AspectTreeModel; 0039 class Column; 0040 0041 class HistogramDock : public BaseDock { 0042 Q_OBJECT 0043 0044 public: 0045 explicit HistogramDock(QWidget*); 0046 ~HistogramDock() override; 0047 0048 void setCurves(QList<Histogram*>); 0049 0050 private: 0051 QStringList dateStrings; 0052 QStringList timeStrings; 0053 0054 TreeViewComboBox* cbDataColumn; 0055 TreeViewComboBox* cbValuesColumn; 0056 0057 void updateValuesWidgets(); 0058 void loadConfig(KConfig&); 0059 0060 protected: 0061 Ui::HistogramDock ui; 0062 QList<Histogram*> m_curvesList; 0063 Histogram* m_curve{nullptr}; 0064 AspectTreeModel* m_aspectTreeModel{nullptr}; 0065 0066 virtual void setModel(); 0067 void setModelIndexFromColumn(TreeViewComboBox*, const AbstractColumn*); 0068 0069 private slots: 0070 void init(); 0071 void retranslateUi(); 0072 0073 //SLOTs for changes triggered in HistogramDock 0074 0075 //General-Tab 0076 void dataColumnChanged(const QModelIndex&); 0077 void visibilityChanged(bool); 0078 void typeChanged(int); 0079 void orientationChanged(int); 0080 void binningMethodChanged(int); 0081 void binCountChanged(int); 0082 void binWidthChanged(); 0083 void autoBinRangesChanged(int); 0084 void binRangesMinChanged(const QString&); 0085 void binRangesMaxChanged(const QString&); 0086 void binRangesMinDateTimeChanged(const QDateTime&); 0087 void binRangesMaxDateTimeChanged(const QDateTime&); 0088 0089 //Lines-Tab 0090 void lineTypeChanged(int); 0091 void lineStyleChanged(int); 0092 void lineColorChanged(const QColor&); 0093 void lineWidthChanged(double); 0094 void lineOpacityChanged(int); 0095 0096 //Symbol-tab 0097 void symbolsStyleChanged(int); 0098 void symbolsSizeChanged(double); 0099 void symbolsRotationChanged(int); 0100 void symbolsOpacityChanged(int); 0101 void symbolsFillingStyleChanged(int); 0102 void symbolsFillingColorChanged(const QColor&); 0103 void symbolsBorderStyleChanged(int); 0104 void symbolsBorderColorChanged(const QColor&); 0105 void symbolsBorderWidthChanged(double); 0106 0107 //Values-Tab 0108 void valuesTypeChanged(int); 0109 void valuesColumnChanged(const QModelIndex&); 0110 void valuesPositionChanged(int); 0111 void valuesDistanceChanged(double); 0112 void valuesRotationChanged(int); 0113 void valuesOpacityChanged(int); 0114 void valuesNumericFormatChanged(int); 0115 void valuesPrecisionChanged(int); 0116 void valuesDateTimeFormatChanged(const QString&); 0117 void valuesPrefixChanged(); 0118 void valuesSuffixChanged(); 0119 void valuesFontChanged(const QFont&); 0120 void valuesColorChanged(const QColor&); 0121 0122 //Filling-tab 0123 void fillingEnabledChanged(int); 0124 void fillingTypeChanged(int); 0125 void fillingColorStyleChanged(int); 0126 void fillingImageStyleChanged(int); 0127 void fillingBrushStyleChanged(int); 0128 void fillingFirstColorChanged(const QColor&); 0129 void fillingSecondColorChanged(const QColor&); 0130 void selectFile(); 0131 void fileNameChanged(); 0132 void fillingOpacityChanged(int); 0133 0134 //"Error bars"-Tab 0135 void errorTypeChanged(int) const; 0136 void errorBarsTypeChanged(int) const; 0137 void errorBarsCapSizeChanged(double) const; 0138 void errorBarsStyleChanged(int) const; 0139 void errorBarsColorChanged(const QColor&); 0140 void errorBarsWidthChanged(double) const; 0141 void errorBarsOpacityChanged(int) const; 0142 0143 //SLOTs for changes triggered in Histogram 0144 //General-Tab 0145 void curveDescriptionChanged(const AbstractAspect*); 0146 void curveDataColumnChanged(const AbstractColumn*); 0147 void curveTypeChanged(Histogram::HistogramType); 0148 void curveOrientationChanged(Histogram::HistogramOrientation); 0149 void curveBinningMethodChanged(Histogram::BinningMethod); 0150 void curveBinCountChanged(int); 0151 void curveBinWidthChanged(double); 0152 void curveAutoBinRangesChanged(bool); 0153 void curveBinRangesMinChanged(double); 0154 void curveBinRangesMaxChanged(double); 0155 void curveVisibilityChanged(bool); 0156 0157 //Line-tab 0158 void curveLineTypeChanged(Histogram::LineType); 0159 void curveLinePenChanged(const QPen&); 0160 void curveLineOpacityChanged(qreal); 0161 0162 //Symbol-Tab 0163 void curveSymbolsStyleChanged(Symbol::Style); 0164 void curveSymbolsSizeChanged(qreal); 0165 void curveSymbolsRotationAngleChanged(qreal); 0166 void curveSymbolsOpacityChanged(qreal); 0167 void curveSymbolsBrushChanged(const QBrush&); 0168 void curveSymbolsPenChanged(const QPen&); 0169 0170 //Values-Tab 0171 void curveValuesTypeChanged(Histogram::ValuesType); 0172 void curveValuesColumnChanged(const AbstractColumn*); 0173 void curveValuesPositionChanged(Histogram::ValuesPosition); 0174 void curveValuesDistanceChanged(qreal); 0175 void curveValuesOpacityChanged(qreal); 0176 void curveValuesRotationAngleChanged(qreal); 0177 void curveValuesNumericFormatChanged(char); 0178 void curveValuesPrecisionChanged(int); 0179 void curveValuesDateTimeFormatChanged(const QString&); 0180 void curveValuesPrefixChanged(const QString&); 0181 void curveValuesSuffixChanged(const QString&); 0182 void curveValuesFontChanged(QFont); 0183 void curveValuesColorChanged(QColor); 0184 0185 //Filling-Tab 0186 void curveFillingEnabledChanged(bool); 0187 void curveFillingTypeChanged(PlotArea::BackgroundType); 0188 void curveFillingColorStyleChanged(PlotArea::BackgroundColorStyle); 0189 void curveFillingImageStyleChanged(PlotArea::BackgroundImageStyle); 0190 void curveFillingBrushStyleChanged(Qt::BrushStyle); 0191 void curveFillingFirstColorChanged(QColor&); 0192 void curveFillingSecondColorChanged(QColor&); 0193 void curveFillingFileNameChanged(QString&); 0194 void curveFillingOpacityChanged(double); 0195 0196 //"Error bars"-Tab 0197 void curveErrorTypeChanged(Histogram::ErrorType); 0198 void curveErrorBarsTypeChanged(XYCurve::ErrorBarsType); 0199 void curveErrorBarsPenChanged(const QPen&); 0200 void curveErrorBarsCapSizeChanged(qreal); 0201 void curveErrorBarsOpacityChanged(qreal); 0202 0203 //load and save 0204 void loadConfigFromTemplate(KConfig&); 0205 void saveConfigAsTemplate(KConfig&); 0206 0207 signals: 0208 void info(const QString&); 0209 }; 0210 0211 #endif