#include "xeditfielddefinition.h"

XEditFieldDefinition::XEditFieldDefinition()
    : XAsset()
    , mMinVal(0)
    , mMaxVal(0)
    , mDefVal(0)
    , mRange(0)
    , mMaxChars(0)
    , mMaxCharsGotoNext(0)
    , mMaxPaintChars(0)
    , mPaintOffset(0)
{}

float XEditFieldDefinition::GetMinVal() const
{
    return mMinVal;
}

float XEditFieldDefinition::GetMaxVal() const
{
    return mMaxVal;
}

float XEditFieldDefinition::GetDefVal() const
{
    return mDefVal;
}

float XEditFieldDefinition::GetRange() const
{
    return mRange;
}

int XEditFieldDefinition::GetMaxChars() const
{
    return mMaxChars;
}

int XEditFieldDefinition::GetMaxCharsGotoNext() const
{
    return mMaxCharsGotoNext;
}

int XEditFieldDefinition::GetMaxPaintChars() const
{
    return mMaxPaintChars;
}

int XEditFieldDefinition::GetPaintOffset() const
{
    return mPaintOffset;
}

void XEditFieldDefinition::ParseData(QDataStream *aStream)
{
    *aStream
        >> mMinVal
        >> mMaxVal
        >> mDefVal
        >> mRange
        >> mMaxChars
        >> mMaxCharsGotoNext
        >> mMaxPaintChars
        >> mPaintOffset;
}

void XEditFieldDefinition::Clear()
{
    mMinVal = 0;
    mMaxVal = 0;
    mDefVal = 0;
    mRange = 0;
    mMaxChars = 0;
    mMaxCharsGotoNext = 0;
    mMaxPaintChars = 0;
    mPaintOffset = 0;
}

void XEditFieldDefinition::SetMinVal(float aMinVal)
{
    mMinVal = aMinVal;
}

void XEditFieldDefinition::SetMaxVal(float aMaxVal)
{
    mMaxVal = aMaxVal;
}

void XEditFieldDefinition::SetDefVal(float aDefVal)
{
    mDefVal = aDefVal;
}

void XEditFieldDefinition::SetRange(float aRange)
{
    mRange = aRange;
}

void XEditFieldDefinition::SetMaxChars(int aMaxChars)
{
    mMaxChars = aMaxChars;
}

void XEditFieldDefinition::SetMaxCharsGotoNext(int aMaxCharsGotoNext)
{
    mMaxCharsGotoNext = aMaxCharsGotoNext;
}

void XEditFieldDefinition::SetMaxPaintChars(int aMaxPaintChars)
{
    mMaxPaintChars = aMaxPaintChars;
}

void XEditFieldDefinition::SetPaintOffset(int aPaintOffset)
{
    mPaintOffset = aPaintOffset;
}
