File indexing completed on 2024-05-12 15:28:00

0001 /***************************************************************************
0002     File                 : MatrixDock.h
0003     Project              : LabPlot
0004     Description          : widget for matrix properties
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2015 by Alexander Semke (alexander.semke@web.de)
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 MATRIXDOCK_H
0030 #define MATRIXDOCK_H
0031 
0032 #include "backend/matrix/Matrix.h"
0033 #include "kdefrontend/dockwidgets/BaseDock.h"
0034 #include "ui_matrixdock.h"
0035 
0036 class Matrix;
0037 class KConfig;
0038 
0039 class MatrixDock : public BaseDock {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit MatrixDock(QWidget*);
0044     void setMatrices(QList<Matrix*>);
0045 
0046 private:
0047     Ui::MatrixDock ui;
0048     QList<Matrix*> m_matrixList;
0049     Matrix* m_matrix{nullptr};
0050 
0051     void load();
0052     void loadConfig(KConfig&);
0053 
0054 private slots:
0055     //SLOTs for changes triggered in MatrixDock
0056 
0057     void rowCountChanged(int);
0058     void columnCountChanged(int);
0059 
0060     void xStartChanged();
0061     void xEndChanged();
0062     void yStartChanged();
0063     void yEndChanged();
0064 
0065     void numericFormatChanged(int);
0066     void precisionChanged(int);
0067     void headerFormatChanged(int);
0068 
0069     //SLOTs for changes triggered in Matrix
0070     void matrixDescriptionChanged(const AbstractAspect*);
0071 
0072     void matrixXStartChanged(double);
0073     void matrixXEndChanged(double);
0074     void matrixYStartChanged(double);
0075     void matrixYEndChanged(double);
0076 
0077     void matrixRowCountChanged(int);
0078     void matrixColumnCountChanged(int);
0079 
0080     void matrixNumericFormatChanged(char);
0081     void matrixPrecisionChanged(int);
0082     void matrixHeaderFormatChanged(Matrix::HeaderFormat);
0083 
0084     //save/load template
0085     void loadConfigFromTemplate(KConfig&);
0086     void saveConfigAsTemplate(KConfig&);
0087 
0088 signals:
0089     void info(const QString&);
0090 };
0091 
0092 #endif // MATRIXDOCK_H