aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfig_compiler/test_param_minmax.h.ref
blob: a0f93ba7f4ff6b124616773a8a409c8a369602f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// This file is generated by kconfig_compiler_kf5 from test_param_minmax.kcfg.
// All changes you do to this file will be lost.
#ifndef TESTPARAMMINMAX_H
#define TESTPARAMMINMAX_H

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

class TestParamMinMax : public KConfigSkeleton
{
  public:

    TestParamMinMax( KSharedConfig::Ptr config = KSharedConfig::openConfig() );
    ~TestParamMinMax() override;

    /**
      Set foo_#$(myparam)
    */
    void setFoo( int i, double v )
    {
      if (v < 0.01)
      {
        qDebug() << "setFoo: value " << v << " is less than the minimum value of 0.01";
        v = 0.01;
      }

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

      if (!isFooImmutable( i ))
        mFoo[i] = v;
    }

    /**
      Get foo_#$(myparam)
    */
    double foo( int i ) const
    {
      return mFoo[i];
    }

    /**
      Is foo_#$(myparam) Immutable
    */
    bool isFooImmutable( int i ) const
    {
      return isImmutable( QStringLiteral( "Foo%1" ).arg( i ) );
    }

  protected:

    // Something
    double mFoo[6];

  private:
};

#endif