// This file is generated by kconfig_compiler_kf5 from structureviewpreferences.kcfg.
// All changes you do to this file will be lost.
#ifndef KASTEN_STRUCTUREVIEWPREFERENCES_H
#define KASTEN_STRUCTUREVIEWPREFERENCES_H

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

#include <QSysInfo>
#include <view/structures/datatypes/datainformationbase.hpp>

namespace Kasten {

class StructureViewPreferences : public KConfigSkeleton
{
  public:

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

    /**
      Set UnsignedDisplayBase
    */
    static
    void setUnsignedDisplayBase( int v )
    {
      if (!self()->isUnsignedDisplayBaseImmutable())
        self()->mUnsignedDisplayBase = v;
    }

    /**
      Get UnsignedDisplayBase
    */
    static
    int unsignedDisplayBase()
    {
      return self()->mUnsignedDisplayBase;
    }

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

    /**
      Get Item object corresponding to UnsignedDisplayBase()
    */
    ItemInt *unsignedDisplayBaseItem()
    {
      return mUnsignedDisplayBaseItem;
    }

    /**
      Set SignedDisplayBase
    */
    static
    void setSignedDisplayBase( int v )
    {
      if (!self()->isSignedDisplayBaseImmutable())
        self()->mSignedDisplayBase = v;
    }

    /**
      Get SignedDisplayBase
    */
    static
    int signedDisplayBase()
    {
      return self()->mSignedDisplayBase;
    }

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

    /**
      Get Item object corresponding to SignedDisplayBase()
    */
    ItemInt *signedDisplayBaseItem()
    {
      return mSignedDisplayBaseItem;
    }

    /**
      Set CharDisplayBase
    */
    static
    void setCharDisplayBase( int v )
    {
      if (!self()->isCharDisplayBaseImmutable())
        self()->mCharDisplayBase = v;
    }

    /**
      Get CharDisplayBase
    */
    static
    int charDisplayBase()
    {
      return self()->mCharDisplayBase;
    }

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

    /**
      Get Item object corresponding to CharDisplayBase()
    */
    ItemInt *charDisplayBaseItem()
    {
      return mCharDisplayBaseItem;
    }

    /**
      Set ShowCharNumericalValue
    */
    static
    void setShowCharNumericalValue( bool v )
    {
      if (!self()->isShowCharNumericalValueImmutable())
        self()->mShowCharNumericalValue = v;
    }

    /**
      Get ShowCharNumericalValue
    */
    static
    bool showCharNumericalValue()
    {
      return self()->mShowCharNumericalValue;
    }

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

    /**
      Get Item object corresponding to ShowCharNumericalValue()
    */
    ItemBool *showCharNumericalValueItem()
    {
      return mShowCharNumericalValueItem;
    }

    /**
      Set LocaleAwareFloatFormatting
    */
    static
    void setLocaleAwareFloatFormatting( bool v )
    {
      if (!self()->isLocaleAwareFloatFormattingImmutable())
        self()->mLocaleAwareFloatFormatting = v;
    }

    /**
      Get LocaleAwareFloatFormatting
    */
    static
    bool localeAwareFloatFormatting()
    {
      return self()->mLocaleAwareFloatFormatting;
    }

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

    /**
      Get Item object corresponding to LocaleAwareFloatFormatting()
    */
    ItemBool *localeAwareFloatFormattingItem()
    {
      return mLocaleAwareFloatFormattingItem;
    }

    /**
      Set ShortTypeNames
    */
    static
    void setShortTypeNames( bool v )
    {
      if (!self()->isShortTypeNamesImmutable())
        self()->mShortTypeNames = v;
    }

    /**
      Get ShortTypeNames
    */
    static
    bool shortTypeNames()
    {
      return self()->mShortTypeNames;
    }

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

    /**
      Get Item object corresponding to ShortTypeNames()
    */
    ItemBool *shortTypeNamesItem()
    {
      return mShortTypeNamesItem;
    }

    /**
      Set LocaleAwareDecimalFormatting
    */
    static
    void setLocaleAwareDecimalFormatting( bool v )
    {
      if (!self()->isLocaleAwareDecimalFormattingImmutable())
        self()->mLocaleAwareDecimalFormatting = v;
    }

    /**
      Get LocaleAwareDecimalFormatting
    */
    static
    bool localeAwareDecimalFormatting()
    {
      return self()->mLocaleAwareDecimalFormatting;
    }

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

    /**
      Get Item object corresponding to LocaleAwareDecimalFormatting()
    */
    ItemBool *localeAwareDecimalFormattingItem()
    {
      return mLocaleAwareDecimalFormattingItem;
    }

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

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

      if (!self()->isFloatPrecisionImmutable())
        self()->mFloatPrecision = v;
    }

    /**
      Get FloatPrecision
    */
    static
    int floatPrecision()
    {
      return self()->mFloatPrecision;
    }

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

    /**
      Get Item object corresponding to FloatPrecision()
    */
    ItemInt *floatPrecisionItem()
    {
      return mFloatPrecisionItem;
    }

    /**
      Set Byte order
    */
    static
    void setByteOrder( QSysInfo::Endian v )
    {
      if (!self()->isByteOrderImmutable())
        self()->mByteOrder = v;
    }

    /**
      Get Byte order
    */
    static
    QSysInfo::Endian byteOrder()
    {
      return static_cast<QSysInfo::Endian>(self()->mByteOrder);
    }

    /**
      Is Byte order Immutable
    */
    static
    bool isByteOrderImmutable()
    {
      return self()->isImmutable( QStringLiteral( "ByteOrder" ) );
    }

    /**
      Get Item object corresponding to ByteOrder()
    */
    ItemEnum *byteOrderItem()
    {
      return mByteOrderItem;
    }

    /**
      Set LoadedStructures
    */
    static
    void setLoadedStructures( const QStringList & v )
    {
      if (!self()->isLoadedStructuresImmutable())
        self()->mLoadedStructures = v;
    }

    /**
      Get LoadedStructures
    */
    static
    QStringList loadedStructures()
    {
      return self()->mLoadedStructures;
    }

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

    /**
      Get Item object corresponding to LoadedStructures()
    */
    ItemStringList *loadedStructuresItem()
    {
      return mLoadedStructuresItem;
    }

  protected:
    StructureViewPreferences();
    friend class StructureViewPreferencesHelper;


    // ValueDisplay
    int mUnsignedDisplayBase;
    int mSignedDisplayBase;
    int mCharDisplayBase;
    bool mShowCharNumericalValue;
    bool mLocaleAwareFloatFormatting;
    bool mShortTypeNames;
    bool mLocaleAwareDecimalFormatting;
    int mFloatPrecision;

    // StructureSettings
    int mByteOrder;
    QStringList mLoadedStructures;

  private:
    ItemInt *mUnsignedDisplayBaseItem;
    ItemInt *mSignedDisplayBaseItem;
    ItemInt *mCharDisplayBaseItem;
    ItemBool *mShowCharNumericalValueItem;
    ItemBool *mLocaleAwareFloatFormattingItem;
    ItemBool *mShortTypeNamesItem;
    ItemBool *mLocaleAwareDecimalFormattingItem;
    ItemInt *mFloatPrecisionItem;
    ItemEnum *mByteOrderItem;
    ItemStringList *mLoadedStructuresItem;
};

}

#endif

