KReport

KReportSection.shared.h
1/* This file is part of the KDE project
2 * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
3 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
4 * Copyright (C) 2010-2015 Jarosław Staniek <staniek@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KREPORTSECTION_H
21#define KREPORTSECTION_H
22
23#include <QCoreApplication>
24#include <QSet>
25#include <KReportElement>
26
27//! @brief The KReportSection class represents a section of a report design
28/*! A section has optional report header, report footer, page header, page footer,
29 group header, group footer and detail.
30 In the case of page header and page footer it is possible to define (firstpage, odd, even or lastpage). */
31class KREPORT_EXPORT KReportSection //SDC: explicit operator== virtual_dtor custom_clone
32{
33 Q_DECLARE_TR_FUNCTIONS(KReportSection)
34public:
35 enum class Type {
36 Invalid,
37 PageHeaderFirst,
38 PageHeaderOdd,
39 PageHeaderEven,
40 PageHeaderLast,
41 PageHeaderAny,
42 ReportHeader,
43 ReportFooter,
44 PageFooterFirst,
45 PageFooterOdd,
46 PageFooterEven,
47 PageFooterLast,
48 PageFooterAny,
49 GroupHeader,
50 GroupFooter,
51 Detail
52 };
53
54 /*!
55 @getter
56 @return section type
57 Default section type is Invalid.
58 @setter
59 Sets section type.
60 */
61 KReportSection::Type type; //SDC: default=KReportSection::Type::Invalid simple_type
62
63 /*!
64 @getter
65 @return section height measured in points
66 It is equal to KReportSection::defaultHeight() unless setHeight()
67 is called with value > 0.
68 @setter
69 Sets section height measured in points.
70 Set negative value to reset to the default height.
71 */
72 qreal height; //SDC: default=-1 custom_getter
73
74 /*!
75 @getter
76 @return section background color
77 It is equal to KReportSection::defaultBackgroundColor() unless setBackgroundColor()
78 is called with a valid color.
79 @setter
80 Sets section background color.
81 Set invalid color (QColor()) to reset to the default background color.
82 */
83 QColor backgroundColor; //SDC: custom_getter
84
85 /*!
86 @getter
87 @return all elements of this section
88 */
89 QList<KReportElement> elements; //SDC: custom_getter no_setter
90
91 /*!
92 @internal A set that helps to quickly check if element is part of the section.
93 */
95
96 //! Adds element @a element to this section.
97 //! @return true on success.
98 //! Adding fails if element is already added to this or other section.
99 //! Use KReportElement::clone() to add a copy.
100 bool addElement(const KReportElement &element);
101
102 //! Adds element @a element to this section at index position @a i.
103 //! @return true on success.
104 //! Adding fails if element is already added to this or other section or if
105 //! position @a i is out of bounds.
106 //! Use KReportElement::clone() to add a copy.
107 bool insertElement(int i, const KReportElement &element);
108
109 //! Removes element @a element from this section.
110 //! @return true on success.
111 //! Removing fails if element @a element is not added in this section.
112 bool removeElement(const KReportElement &element);
113
114 //! Removes element from index position @a i from this section.
115 //! @return true on success.
116 //! Removing fails position @a i is out of bounds.
117 bool removeElementAt(int i);
118
119 //! @return default height for report sections. The standard is 2cm (converted to points).
120 static qreal defaultHeight();
121
122 //! Sets default height for report sections in points.
123 static void setDefaultHeight(qreal height);
124
125 //! @return default background color for report sections. The standard is white.
126 static QColor defaultBackgroundColor();
127
128 //! Sets default background color for report sections.
129 static void setDefaultBackgroundColor(const QColor &color);
130};
131
132#endif // KREPORTSECTION_H
The KReportElement class represents a functional visual element of a report design.
The KReportSection class represents a section of a report design.
KReportSection::Type type
QSet< KReportElement > elementsSet
QList< KReportElement > elements
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:16:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.