1 /* This file is part of the KDE project 2 Copyright (C) 2009 Thorsten Zachmann <zachmann@kde.org> 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Library General Public 6 License as published by the Free Software Foundation; either 7 version 2 of the License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Library General Public License for more details. 13 14 You should have received a copy of the GNU Library General Public License 15 along with this library; see the file COPYING.LIB. If not, write to 16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef KOPAPRINTJOB_H 21 #define KOPAPRINTJOB_H 22 23 #include <KoPrintJob.h> 24 25 #include <QPrinter> 26 27 #include "kopageapp_export.h" 28 29 class KoPAView; 30 class KoPAPageBase; 31 class KoPAPageProvider; 32 33 /** 34 * For now we print to the center of the page honoring the margins. 35 * The page is zoomed to be as big as possible. 36 */ 37 class KOPAGEAPP_EXPORT KoPAPrintJob : public KoPrintJob 38 { 39 Q_OBJECT 40 public: 41 explicit KoPAPrintJob(KoPAView * view); 42 ~KoPAPrintJob() override; 43 44 QPrinter & printer() override; 45 QList<QWidget *> createOptionWidgets() const override; 46 47 public Q_SLOTS: 48 void startPrinting(RemovePolicy removePolicy = DoNotDelete) override; 49 50 protected: 51 QPrinter m_printer; 52 QList<KoPAPageBase*> m_pages; 53 KoPAPageProvider *m_pageProvider; 54 }; 55 56 #endif /* KOPAPRINTJOB_H */ 57