File indexing completed on 2024-05-12 16:35:25

0001 /* This file is part of the KDE project
0002    Copyright (C) 2012-2013 Jigar Raisinghani <jigarraisinghani@gmail.com>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017    Boston, MA 02110-1301, USA.
0018 */
0019 
0020 // Local
0021 
0022 #ifndef PIVOTMAIN_H
0023 #define PIVOTMAIN_H
0024 
0025 #include <KoDialog.h>
0026 #include<QListWidgetItem>
0027 
0028 #include <sheets/Sheet.h>
0029 namespace Calligra{
0030   namespace Sheets{
0031 
0032 class Selection;
0033 class PivotMain : public KoDialog
0034     {
0035     Q_OBJECT
0036 
0037     public:
0038       explicit PivotMain(QWidget* parent,Selection* selection);
0039       QVector<QString> ValueData(const QString &str);
0040       bool checkCondition(const QString &field , const QString &condition, const QString &value, int line);
0041       Sheet* filter();
0042       ~PivotMain() override;
0043 
0044     private Q_SLOTS:
0045       
0046       //void on_Options_clicked();
0047       void styling(Sheet* mySheet);
0048       void labels_itemChanged(QListWidgetItem *item);
0049       void values_itemChanged(QListWidgetItem *item);
0050       void columns_itemChanged(QListWidgetItem *item);
0051       void rows_itemChanged(QListWidgetItem *item);
0052 
0053       void on_AddFilter_clicked();
0054       void on_Ok_clicked();
0055       void Summarize();
0056       void Reset();
0057       void clean(Sheet* sheet);
0058 
0059     private:
0060       void extractColumnNames();
0061       PivotMain *ui;
0062       class Private;
0063       Private *const d;
0064     };
0065   }//Sheets
0066 }//Calligra
0067 #endif // PIVOTMAIN_H