File indexing completed on 2024-04-28 04:42:10

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
0003  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Lesser General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2.1 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0013  * Lesser General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Lesser General Public
0016  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 #ifndef KREPORTDESIGNERSECTIONDETAILGROUP_H
0020 #define KREPORTDESIGNERSECTIONDETAILGROUP_H
0021 
0022 #include <QObject>
0023 
0024 #include "kreport_export.h"
0025 
0026 class QDomElement;
0027 class QDomDocument;
0028 class QString;
0029 class QWidget;
0030 
0031 class KReportDesignerSection;
0032 class KReportDesignerSectionDetail;
0033 
0034 /*!
0035  * @brief A section group allows a header and footer to be used for a particular report field
0036 */
0037 class KREPORT_EXPORT KReportDesignerSectionDetailGroup : public QObject
0038 {
0039     Q_OBJECT
0040 public:
0041     KReportDesignerSectionDetailGroup(const QString &column, KReportDesignerSectionDetail *rsd,
0042                                       QWidget *parent = nullptr);
0043     ~KReportDesignerSectionDetailGroup() override;
0044 
0045     enum class PageBreak {
0046         None,
0047         AfterGroupFooter,
0048         BeforeGroupHeader
0049     };
0050 
0051     void setColumn(const QString &);
0052     QString column() const;
0053 
0054     void setGroupHeaderVisible(bool yes = true);
0055     bool groupHeaderVisible() const;
0056 
0057     void setGroupFooterVisible(bool yes = true);
0058     bool groupFooterVisible() const;
0059 
0060     void setPageBreak(PageBreak);
0061     PageBreak  pageBreak() const;
0062 
0063     void setSort(Qt::SortOrder);
0064     Qt::SortOrder sort();
0065 
0066     KReportDesignerSection * groupHeader() const;
0067     KReportDesignerSection * groupFooter() const;
0068 
0069     void buildXML(QDomDocument *doc, QDomElement *section) const;
0070     void initFromXML( const QDomElement &element );
0071 
0072 private:
0073     Q_DISABLE_COPY(KReportDesignerSectionDetailGroup)
0074     class Private;
0075     Private * const d;
0076 };
0077 
0078 
0079 #endif