File indexing completed on 2025-01-05 05:09:31

0001 /*
0002     SPDX-FileCopyrightText: 2010-2013 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KIPPREQUEST_H
0008 #define KIPPREQUEST_H
0009 
0010 #include <KCupsConnection.h>
0011 #include <kcupslib_export.h>
0012 
0013 class KIppRequestPrivate;
0014 class KCUPSLIB_EXPORT KIppRequest
0015 {
0016     Q_DECLARE_PRIVATE(KIppRequest)
0017 public:
0018     KIppRequest();
0019     KIppRequest(const KIppRequest &other);
0020     KIppRequest(ipp_op_t operation, const QString &resource, const QString &filename = QString());
0021     ~KIppRequest();
0022 
0023     ipp_op_t operation() const;
0024     QString resource() const;
0025     QString filename() const;
0026 
0027     ipp_t *sendIppRequest() const;
0028 
0029     void addString(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QString &value);
0030     void addStringList(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QStringList &value);
0031     void addInteger(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, int value);
0032     void addBoolean(ipp_tag_t group, const QString &name, bool value);
0033     void addVariantValues(const QVariantMap &values);
0034     void addPrinterUri(const QString &printerName, bool isClass = false);
0035 
0036     static QString assembleUrif(const QString &name, bool isClass);
0037 
0038     /**
0039      * Makes a copy of the KIppRequest object other.
0040      */
0041     KIppRequest &operator=(const KIppRequest &other);
0042 
0043 private:
0044     KIppRequestPrivate *d_ptr;
0045 };
0046 
0047 Q_DECLARE_METATYPE(KIppRequest)
0048 
0049 #endif // KIPPREQUEST_H