kspread

SubtotalDialog.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
00003              (C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
00004              (C) 2002 Laurent Montel <montel@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 
00023 #ifndef KSPREAD_SUBTOTAL_DIALOG
00024 #define KSPREAD_SUBTOTAL_DIALOG
00025 
00026 #include <QRect>
00027 
00028 #include <kdialog.h>
00029 
00030 #include <ui_SubtotalWidget.h>
00031 
00032 
00033 namespace KSpread
00034 {
00035 class Selection;
00036 class Sheet;
00037 
00038 class SubtotalDialog : public KDialog, public ::Ui::SubtotalWidget
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043     SubtotalDialog(QWidget* parent, Selection* selection);
00044     ~SubtotalDialog();
00045 
00046     QRect const & selection() const {
00047         return m_range;
00048     }
00049     Sheet * sheet() const {
00050         return m_pSheet;
00051     }
00052 
00053 private slots:
00054     void slotOk();
00055     void slotCancel();
00056     void slotUser1();
00057 
00058 private:
00059     Selection *      m_selection;
00060     Sheet *          m_pSheet;
00061     QRect            m_range;
00062 
00063     void fillColumnBoxes();
00064     void fillFunctionBox();
00065     void removeSubtotalLines();
00066     bool addSubtotal(int mainCol, int column, int row, int topRow,
00067                      bool addRow, QString const & text);
00068 };
00069 
00070 } // namespace KSpread
00071 
00072 #endif // KSPREAD_SUBTOTAL_DIALOG