# This file is generated by rbkconfig_compiler from test1.kcfg.
# All changes you do to this file will be lost.

class Test1 < KDE::ConfigSkeleton

  class EnumListOption
    One = 0
    Two = 1
    Three = 2
    COUNT = 3
  end

  #
  # Set One option
  #
  def setOneOption(v)
    item = findItem("OneOption")
    if !item.immutable?
      item.property = @oneOption = Qt::Variant.fromValue(v)
    end
  end

  def oneOption=(v)
    setOneOption(v)
  end

  #
  # Get One option
  #
  def oneOption
    @oneOption = findItem("OneOption").property
    return @oneOption.value
  end

  #
  # Set Another option
  #
  def setAnotherOption(v)
    item = findItem("AnotherOption")
    if !item.immutable?
      item.property = @anotherOption = Qt::Variant.fromValue(v)
    end
  end

  def anotherOption=(v)
    setAnotherOption(v)
  end

  #
  # Get Another option
  #
  def anotherOption
    @anotherOption = findItem("AnotherOption").property
    return @anotherOption.value
  end

  #
  # Set This is some funky option
  #
  def setListOption(v)
    item = findItem("ListOption")
    if !item.immutable?
      item.property = @listOption = Qt::Variant.fromValue(v)
    end
  end

  def listOption=(v)
    setListOption(v)
  end

  #
  # Get This is some funky option
  #
  def listOption
    @listOption = findItem("ListOption").property
    return @listOption.toInt
  end

  #
  # Set This is a string
  #
  def setMyString(v)
    item = findItem("MyString")
    if !item.immutable?
      item.property = @myString = Qt::Variant.fromValue(v)
    end
  end

  def myString=(v)
    setMyString(v)
  end

  #
  # Get This is a string
  #
  def myString
    @myString = findItem("MyString").property
    return @myString.value
  end

  #
  # Set This is a path
  #
  def setMyPath(v)
    item = findItem("MyPath")
    if !item.immutable?
      item.property = @myPath = Qt::Variant.fromValue(v)
    end
  end

  def myPath=(v)
    setMyPath(v)
  end

  #
  # Get This is a path
  #
  def myPath
    @myPath = findItem("MyPath").property
    return @myPath.toString
  end

  #
  # Set Another option
  #
  def setAnotherOption2(v)
    item = findItem("AnotherOption2")
    if !item.immutable?
      item.property = @anotherOption2 = Qt::Variant.fromValue(v)
    end
  end

  def anotherOption2=(v)
    setAnotherOption2(v)
  end

  #
  # Get Another option
  #
  def anotherOption2
    @anotherOption2 = findItem("AnotherOption2").property
    return @anotherOption2.value
  end

  #
  # Set MyStringList
  #
  def setMyStringList(v)
    item = findItem("MyStringList")
    if !item.immutable?
      item.property = @myStringList = Qt::Variant.fromValue(v)
    end
  end

  def myStringList=(v)
    setMyStringList(v)
  end

  #
  # Get MyStringList
  #
  def myStringList
    @myStringList = findItem("MyStringList").property
    return @myStringList.value
  end

  #
  # Set MyStringListHidden
  #
  def setMyStringListHidden(v)
    item = findItem("MyStringListHidden")
    if !item.immutable?
      item.property = @myStringListHidden = Qt::Variant.fromValue(v)
    end
  end

  def myStringListHidden=(v)
    setMyStringListHidden(v)
  end

  #
  # Get MyStringListHidden
  #
  def myStringListHidden
    @myStringListHidden = findItem("MyStringListHidden").property
    return @myStringListHidden.value
  end

  #
  # Set List Number
  #
  def setMyNumber(v)
    item = findItem("MyNumber")
    if !item.immutable?
      item.property = @myNumber = Qt::Variant.fromValue(v)
    end
  end

  def myNumber=(v)
    setMyNumber(v)
  end

  #
  # Get List Number
  #
  def myNumber
    @myNumber = findItem("MyNumber").property
    return @myNumber.value
  end

  def initialize(transport, folder)
    super("examplerc")
    @paramtransport = Qt::Variant.fromValue(transport)
    @paramfolder = Qt::Variant.fromValue(folder)

    # General-$(folder)
    @oneOption = Qt::Variant.fromValue(false)
    @anotherOption = Qt::Variant.fromValue(0)
    @listOption = Qt::Variant.fromValue(0)

    # MyOptions
    @myString = Qt::Variant.fromValue("")
    @myPath = Qt::Variant.fromValue("")
    @anotherOption2 = Qt::Variant.fromValue(0)
    @myStringList = Qt::Variant.fromValue([])
    @myStringListHidden = Qt::Variant.fromValue([])
    @myNumber = Qt::Variant.fromValue(0)
    setCurrentGroup("General-#{@paramfolder.value}")

    itemOneOption = ItemBool.new(currentGroup(), "OneOption", @oneOption.value, true)
    itemOneOption.property = @oneOption
    addItem(itemOneOption)
    itemAnotherOption = ItemInt.new(currentGroup(), "Another Option", @anotherOption.value, 5)
    itemAnotherOption.property = @anotherOption
    addItem(itemAnotherOption, "AnotherOption")
    valuesListOption = []
    choice = ItemEnum::Choice.new
    choice.name = "One"
    valuesListOption << choice
    choice = ItemEnum::Choice.new
    choice.name = "Two"
    valuesListOption << choice
    choice = ItemEnum::Choice.new
    choice.name = "Three"
    valuesListOption << choice
    itemListOption = ItemEnum.new(currentGroup(), "ListOption", @listOption.toInt, valuesListOption, EnumListOption::One)
    itemListOption.property = @listOption
    addItem(itemListOption)

    setCurrentGroup("MyOptions")

    itemMyString = ItemString.new(currentGroup(), "MyString", @myString.value, "Default String")
    itemMyString.property = @myString
    addItem(itemMyString)
    itemMyPath = ItemPath.new(currentGroup(), "MyPath", @myPath.toString, Qt::Dir.homePath + ".hidden_file")
    itemMyPath.property = @myPath
    addItem(itemMyPath)
    itemAnotherOption2 = ItemInt.new(currentGroup(), "Another Option", @anotherOption2.value, 10)
    itemAnotherOption2.property = @anotherOption2
    addItem(itemAnotherOption2, "AnotherOption2")
    defaultMyStringList = []
    defaultMyStringList << "up"
    defaultMyStringList << "down"

    itemMyStringList = ItemStringList.new(currentGroup(), "MyStringList", @myStringList.value, defaultMyStringList)
    itemMyStringList.property = @myStringList
    addItem(itemMyStringList)
    defaultMyStringListHidden = []
    defaultMyStringListHidden << "up"
    defaultMyStringListHidden << "down"

    itemMyStringListHidden = ItemStringList.new(currentGroup(), "MyStringListHidden", @myStringListHidden.value, defaultMyStringListHidden)
    itemMyStringListHidden.property = @myStringListHidden
    addItem(itemMyStringListHidden)
    itemMyNumber = ItemInt.new(currentGroup(), "List-#{@paramtransport.value}-#{@paramfolder.value}", @myNumber.value, 1)
    itemMyNumber.property = @myNumber
    addItem(itemMyNumber, "MyNumber")
  end

end
