File indexing completed on 2024-04-28 15:51:36

0001 /*
0002     SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _OKULAR_PRINTINTERFACE_H_
0008 #define _OKULAR_PRINTINTERFACE_H_
0009 
0010 #include "../core/okularcore_export.h"
0011 
0012 #include <QObject>
0013 
0014 class QWidget;
0015 
0016 namespace Okular
0017 {
0018 /**
0019  * @short Abstract interface for advanced printing control
0020  *
0021  * This interface defines an advanced way of interfacing with the print
0022  * process.
0023  *
0024  * How to use it in a custom Generator:
0025  * @code
0026     class MyGenerator : public Okular::Generator, public Okular::PrintInterface
0027     {
0028         Q_OBJECT
0029         Q_INTERFACES( Okular::PrintInterface )
0030 
0031         ...
0032     };
0033  * @endcode
0034  * and - of course - implementing its methods.
0035  */
0036 class OKULARCORE_EXPORT PrintInterface
0037 {
0038 public:
0039     PrintInterface()
0040     {
0041     }
0042 
0043     /**
0044      * Destroys the printer interface.
0045      */
0046     virtual ~PrintInterface()
0047     {
0048     }
0049 
0050     PrintInterface(const PrintInterface &) = delete;
0051     PrintInterface &operator=(const PrintInterface &) = delete;
0052 
0053     /**
0054      * Builds and returns a new printing configuration widget.
0055      *
0056      * @note don't keep a pointer to the new constructed widget, as it
0057      * will be handled elsewhere (in the Okular KPart)
0058      *
0059      * @note The returned object should be of a PrintOptionsWidget subclass
0060      * (which is not officially enforced by the signature for binary
0061      * compatibility reasons).
0062      */
0063     virtual QWidget *printConfigurationWidget() const = 0;
0064 };
0065 
0066 }
0067 
0068 Q_DECLARE_INTERFACE(Okular::PrintInterface, "org.kde.okular.PrintInterface/0.1")
0069 
0070 #endif