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

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

class IPBlockingPluginSettings : public KConfigSkeleton
{
  public:

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

    /**
      Set Level1 filter url
    */
    static
    void setFilterURL( const QUrl & v )
    {
      if (!self()->isFilterURLImmutable())
        self()->mFilterURL = v;
    }

    /**
      Get Level1 filter url
    */
    static
    QUrl filterURL()
    {
      return self()->mFilterURL;
    }

    /**
      Is Level1 filter url Immutable
    */
    static
    bool isFilterURLImmutable()
    {
      return self()->isImmutable( QStringLiteral( "filterURL" ) );
    }

    /**
      Set Use level1 filter?
    */
    static
    void setUseLevel1( bool v )
    {
      if (!self()->isUseLevel1Immutable())
        self()->mUseLevel1 = v;
    }

    /**
      Get Use level1 filter?
    */
    static
    bool useLevel1()
    {
      return self()->mUseLevel1;
    }

    /**
      Is Use level1 filter? Immutable
    */
    static
    bool isUseLevel1Immutable()
    {
      return self()->isImmutable( QStringLiteral( "useLevel1" ) );
    }

    /**
      Set autoUpdate
    */
    static
    void setAutoUpdate( bool v )
    {
      if (!self()->isAutoUpdateImmutable())
        self()->mAutoUpdate = v;
    }

    /**
      Get autoUpdate
    */
    static
    bool autoUpdate()
    {
      return self()->mAutoUpdate;
    }

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

    /**
      Set autoUpdateInterval
    */
    static
    void setAutoUpdateInterval( int v )
    {
      if (v < 1)
      {
        qDebug() << "setAutoUpdateInterval: value " << v << " is less than the minimum value of 1";
        v = 1;
      }

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

      if (!self()->isAutoUpdateIntervalImmutable())
        self()->mAutoUpdateInterval = v;
    }

    /**
      Get autoUpdateInterval
    */
    static
    int autoUpdateInterval()
    {
      return self()->mAutoUpdateInterval;
    }

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

  protected:
    IPBlockingPluginSettings();
    friend class IPBlockingPluginSettingsHelper;


    // general
    QUrl mFilterURL;
    bool mUseLevel1;
    bool mAutoUpdate;
    int mAutoUpdateInterval;
};

#endif

