KReport

KReportScriptConstants.h
1 /* This file is part of the KDE project
2  * Copyright (C) 2001-2007 by OpenMFG, LLC ([email protected])
3  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef KRSCRIPTCONSTANTS_H
20 #define KRSCRIPTCONSTANTS_H
21 
22 #include <QObject>
23 
24 /**
25  @brief Helper giving access to various scripting constants
26 
27  Contains methods for retreiving the current page number, page total
28  and access to the PenStyle enums from user scripts
29  */
31 {
32  Q_OBJECT
33 public:
34  explicit KReportScriptConstants(QObject *parent = nullptr);
35 
36  ~KReportScriptConstants() override;
38 
39  //!Enum values for pen styles that can be accessed from user scripts using
40  //! \code
41  //! constants.QtSolidLine
42  //! \endcode
43  //! for example
44  enum PenStyle {QtNoPen, QtSolidLine, QtDashLine, QtDotLine, QtDashDotLine, QtDashDotDotLine};
45 
46  void setPageNumber(int p) {
47  m_currentPage = p;
48  }
49  void setPageTotal(int t) {
50  m_totalPages = t;
51  };
52 public Q_SLOTS:
53 
54  //! @return the current page number
55  int PageNumber() {
56  return m_currentPage;
57  };
58 
59  //! @return the total number of pages
60  int PageTotal() {
61  return m_totalPages;
62  };
63 
64 private:
65  int m_currentPage;
66  int m_totalPages;
67 
68 
69 };
70 
71 #endif
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
Helper giving access to various scripting constants.
Q_ENUMS(...)
PenStyle
Enum values for pen styles that can be accessed from user scripts using.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:17:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.