// This file is generated by kconfig_compiler_kf6 from pdfsettings.kcfg.
// All changes you do to this file will be lost.
#ifndef PDFSETTINGS_H
#define PDFSETTINGS_H

#include <kconfigskeleton.h>
#include <QCoreApplication>
#include <QDebug>
#include <QSet>

class PDFSettings : public KConfigSkeleton
{
  Q_OBJECT
  public:
    class EnumEnhanceThinLines
    {
      public:
      enum type { No, Solid, Shape, COUNT };
    };
    class EnumOverprintPreviewEnabled
    {
      public:
      enum type { Never, Always, Automatic, COUNT };
    };

    static PDFSettings *self();
    ~PDFSettings() override;

    /**
      Set EnhanceThinLines
    */
    static
    void setEnhanceThinLines( int v )
    {
      if (!self()->isEnhanceThinLinesImmutable())
        self()->mEnhanceThinLines = v;
    }

    /**
      Get EnhanceThinLines
    */
    static
    int enhanceThinLines()
    {
      return self()->mEnhanceThinLines;
    }

    /**
      Is EnhanceThinLines Immutable
    */
    static
    bool isEnhanceThinLinesImmutable()
    {
      return self()->isImmutable( QStringLiteral( "EnhanceThinLines" ) );
    }

    /**
      Set OverprintPreviewEnabled
    */
    static
    void setOverprintPreviewEnabled( int v )
    {
      if (!self()->isOverprintPreviewEnabledImmutable())
        self()->mOverprintPreviewEnabled = v;
    }

    /**
      Get OverprintPreviewEnabled
    */
    static
    int overprintPreviewEnabled()
    {
      return self()->mOverprintPreviewEnabled;
    }

    /**
      Is OverprintPreviewEnabled Immutable
    */
    static
    bool isOverprintPreviewEnabledImmutable()
    {
      return self()->isImmutable( QStringLiteral( "OverprintPreviewEnabled" ) );
    }

    /**
      Set PrintScaleMode
    */
    static
    void setPrintScaleMode( uint v )
    {

      if (v > 2)
      {
        qDebug() << "setPrintScaleMode: value " << v << " is greater than the maximum value of 2";
        v = 2;
      }

      if (!self()->isPrintScaleModeImmutable())
        self()->mPrintScaleMode = v;
    }

    /**
      Get PrintScaleMode
    */
    static
    uint printScaleMode()
    {
      return self()->mPrintScaleMode;
    }

    /**
      Is PrintScaleMode Immutable
    */
    static
    bool isPrintScaleModeImmutable()
    {
      return self()->isImmutable( QStringLiteral( "PrintScaleMode" ) );
    }

    /**
      Set SignatureBackend
    */
    static
    void setSignatureBackend( const QString & v )
    {
      if (v != self()->mSignatureBackend && !self()->isSignatureBackendImmutable()) {
        self()->mSignatureBackend = v;
        self()->mSettingsChanged.insert(signalSignatureBackendChanged);
      }
    }

    /**
      Get SignatureBackend
    */
    static
    QString signatureBackend()
    {
      return self()->mSignatureBackend;
    }

    /**
      Is SignatureBackend Immutable
    */
    static
    bool isSignatureBackendImmutable()
    {
      return self()->isImmutable( QStringLiteral( "SignatureBackend" ) );
    }

    /**
      Set EnablePgp
    */
    static
    void setEnablePgp( bool v )
    {
      if (v != self()->mEnablePgp && !self()->isEnablePgpImmutable()) {
        self()->mEnablePgp = v;
        self()->mSettingsChanged.insert(signalEnablePgpChanged);
      }
    }

    /**
      Get EnablePgp
    */
    static
    bool enablePgp()
    {
      return self()->mEnablePgp;
    }

    /**
      Is EnablePgp Immutable
    */
    static
    bool isEnablePgpImmutable()
    {
      return self()->isImmutable( QStringLiteral( "EnablePgp" ) );
    }

    /**
      Set UseDefaultCertDB
    */
    static
    void setUseDefaultCertDB( bool v )
    {
      if (v != self()->mUseDefaultCertDB && !self()->isUseDefaultCertDBImmutable()) {
        self()->mUseDefaultCertDB = v;
        self()->mSettingsChanged.insert(signalUseDefaultDBChanged);
      }
    }

    /**
      Get UseDefaultCertDB
    */
    static
    bool useDefaultCertDB()
    {
      return self()->mUseDefaultCertDB;
    }

    /**
      Is UseDefaultCertDB Immutable
    */
    static
    bool isUseDefaultCertDBImmutable()
    {
      return self()->isImmutable( QStringLiteral( "UseDefaultCertDB" ) );
    }

    /**
      Set DBCertificatePath
    */
    static
    void setDBCertificatePath( const QString & v )
    {
      if (v != self()->mDBCertificatePath && !self()->isDBCertificatePathImmutable()) {
        self()->mDBCertificatePath = v;
        self()->mSettingsChanged.insert(signalDBCertificatePathChanged);
      }
    }

    /**
      Get DBCertificatePath
    */
    static
    QString dBCertificatePath()
    {
      return self()->mDBCertificatePath;
    }

    /**
      Is DBCertificatePath Immutable
    */
    static
    bool isDBCertificatePathImmutable()
    {
      return self()->isImmutable( QStringLiteral( "DBCertificatePath" ) );
    }

    /**
      Set CheckOCSPServers
    */
    static
    void setCheckOCSPServers( bool v )
    {
      if (!self()->isCheckOCSPServersImmutable())
        self()->mCheckOCSPServers = v;
    }

    /**
      Get CheckOCSPServers
    */
    static
    bool checkOCSPServers()
    {
      return self()->mCheckOCSPServers;
    }

    /**
      Is CheckOCSPServers Immutable
    */
    static
    bool isCheckOCSPServersImmutable()
    {
      return self()->isImmutable( QStringLiteral( "CheckOCSPServers" ) );
    }


    enum {
      signalUseDefaultDBChanged = 1,
      signalSignatureBackendChanged = 2,
      signalDBCertificatePathChanged = 3,
      signalEnablePgpChanged = 4
    };

  Q_SIGNALS:
    void useDefaultDBChanged();

    void signatureBackendChanged();

    void dBCertificatePathChanged();

    void enablePgpChanged();

  private:
    void itemChanged(quint64 signalFlag);

  protected:
    PDFSettings();
    friend class PDFSettingsHelper;

    bool usrSave() override;

    // General
    int mEnhanceThinLines;
    int mOverprintPreviewEnabled;

    // PDF Printing
    uint mPrintScaleMode;

    // Signatures
    QString mSignatureBackend;
    bool mEnablePgp;
    bool mUseDefaultCertDB;
    QString mDBCertificatePath;
    bool mCheckOCSPServers;

  private:
    QSet<quint64> mSettingsChanged;
};

#endif

