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

0001 /***************************************************************************
0002     File                 : SpreadsheetDock.h
0003     Project              : LabPlot
0004     Description          : widget for spreadsheet properties
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2010-2015 by Alexander Semke (alexander.semke@web.de)
0007     Copyright            : (C) 2012-2013 by Stefan Gerlach (stefan.gerlach@uni-konstanz.de)
0008 
0009  ***************************************************************************/
0010 
0011 /***************************************************************************
0012  *                                                                         *
0013  *  This program is free software; you can redistribute it and/or modify   *
0014  *  it under the terms of the GNU General Public License as published by   *
0015  *  the Free Software Foundation; either version 2 of the License, or      *
0016  *  (at your option) any later version.                                    *
0017  *                                                                         *
0018  *  This program is distributed in the hope that it will be useful,        *
0019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0021  *  GNU General Public License for more details.                           *
0022  *                                                                         *
0023  *   You should have received a copy of the GNU General Public License     *
0024  *   along with this program; if not, write to the Free Software           *
0025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0026  *   Boston, MA  02110-1301  USA                                           *
0027  *                                                                         *
0028  ***************************************************************************/
0029 
0030 #ifndef SPREADSHEETDOCK_H
0031 #define SPREADSHEETDOCK_H
0032 #include "kdefrontend/dockwidgets/BaseDock.h"
0033 #include "ui_spreadsheetdock.h"
0034 
0035 class KConfig;
0036 class Spreadsheet;
0037 class AbstractAspect;
0038 
0039 class SpreadsheetDock : public BaseDock {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit SpreadsheetDock(QWidget*);
0044     void setSpreadsheets(QList<Spreadsheet*>);
0045 
0046 private:
0047     Ui::SpreadsheetDock ui;
0048     QList<Spreadsheet*> m_spreadsheetList;
0049     Spreadsheet* m_spreadsheet{nullptr};
0050 
0051     void load();
0052     void loadConfig(KConfig&);
0053 
0054 private slots:
0055     //SLOTs for changes triggered in SpreadsheetDock
0056     void commentChanged();
0057     void rowCountChanged(int);
0058     void columnCountChanged(int);
0059     void commentsShownChanged(int);
0060 
0061     //SLOTs for changes triggered in Spreadsheet
0062     void spreadsheetDescriptionChanged(const AbstractAspect*);
0063     void spreadsheetRowCountChanged(int);
0064     void spreadsheetColumnCountChanged(int);
0065     void spreadsheetShowCommentsChanged(int);
0066 
0067     //save/load template
0068     void loadConfigFromTemplate(KConfig&);
0069     void saveConfigAsTemplate(KConfig&);
0070 
0071 signals:
0072     void info(const QString&);
0073 };
0074 
0075 #endif // SPREADSHEETDOCK_H