#include "countrydata.h"

CountryData::CountryData(QObject *parent) : ComboItem(parent)
{

}

int CountryData::id() const
{
    return m_id;
}

void CountryData::setId(int id)
{
    m_id = id;
}

QString CountryData::code2() const
{
    return m_code2;
}

void CountryData::setCode2(const QString &code2)
{
    m_code2 = code2;
}

QString CountryData::code3() const
{
    return m_code3;
}

void CountryData::setCode3(const QString &code3)
{
    m_code3 = code3;
}

QString CountryData::czechFullName() const
{
    return m_czechFullName;
}

void CountryData::setCzechFullName(const QString &czechFullName)
{
    m_czechFullName = czechFullName;
}

QString CountryData::czechName() const
{
    return m_czechName;
}

void CountryData::setCzechName(const QString &czechName)
{
    m_czechName = czechName;
}

QString CountryData::englishFullName() const
{
    return m_englishFullName;
}

void CountryData::setEnglishFullName(const QString &englishFullName)
{
    m_englishFullName = englishFullName;
}

QString CountryData::englishName() const
{
    return m_englishName;
}

void CountryData::setEnglishName(const QString &englishName)
{
    m_englishName = englishName;
}

bool CountryData::eq(ComboItem *other)
{
    CountryData *obj = qobject_cast<CountryData*>(other);

    if (obj == NULL)
    {
        return false;
    }

    return this == obj || (m_id == obj->m_id && m_code2 == obj->m_code2 && m_code3 == obj->m_code3);
}

QString CountryData::toString()
{
    return m_czechName + " (" + m_code3 + ")";
}
