File indexing completed on 2024-05-05 04:43:23

0001 /* This file is part of the KDE project
0002    Copyright (C) 2015 by Adam Pigg (adam@piggz.co.uk)
0003    Copyright (C) 2017 Jarosław Staniek <staniek@kde.org>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library 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    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018    Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef KREPORTVIEW_H
0022 #define KREPORTVIEW_H
0023 
0024 #include <QWidget>
0025 
0026 #include "kreport_export.h"
0027 
0028 class ORODocument;
0029 class QAbstractScrollArea;
0030 
0031 /**
0032  * @brief Provides a simple widget for viewing a rendered report on screen
0033  */
0034 class KREPORT_EXPORT KReportView : public QWidget
0035 {
0036     Q_OBJECT
0037 public:
0038     explicit KReportView(QWidget *parent);
0039 
0040     ~KReportView() override;
0041 
0042     void moveToFirstPage();
0043     void moveToLastPage();
0044     void moveToNextPage();
0045     void moveToPreviousPage();
0046 
0047     //! Moves to page @a page (counted from 1)
0048     //! @since 3.1
0049     void moveToPage(int page);
0050 
0051     //! @return number of current page (counted from 1)
0052     int currentPage() const;
0053 
0054     int pageCount() const;
0055     void refreshCurrentPage();
0056     void setDocument(ORODocument* doc);
0057 
0058     QAbstractScrollArea* scrollArea();
0059 
0060 private:
0061     Q_DISABLE_COPY(KReportView)
0062     class Private;
0063     Private * const d;
0064 };
0065 
0066 #endif