You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.5 KiB
C++

#include "addressbookdata.h"
AddressbookData::AddressbookData(QObject * parent)
:ComboItem(parent)
{
m_ztp = false;
}
QString AddressbookData::title() const
{
return m_title;
}
void AddressbookData::setTitle(const QString &title)
{
m_title = title;
}
QString AddressbookData::firstName() const
{
return m_firstName;
}
void AddressbookData::setFirstName(const QString &firstName)
{
m_firstName = firstName;
}
QString AddressbookData::lastName() const
{
return m_lastName;
}
void AddressbookData::setLastName(const QString &lastName)
{
m_lastName = lastName;
}
QDate AddressbookData::birthDate() const
{
return m_birthDate;
}
void AddressbookData::setBirthDate(const QDate &birthDate)
{
m_birthDate = birthDate;
}
QString AddressbookData::idCardNumber() const
{
return m_idCardNumber;
}
void AddressbookData::setIdCardNumber(const QString &idCardNumber)
{
m_idCardNumber = idCardNumber;
}
bool AddressbookData::ztp() const
{
return m_ztp;
}
void AddressbookData::setZtp(bool ztp)
{
m_ztp = ztp;
}
QString AddressbookData::addressCity() const
{
return m_addressCity;
}
void AddressbookData::setAddressCity(const QString &addressCity)
{
m_addressCity = addressCity;
}
QString AddressbookData::addressStreet() const
{
return m_addressStreet;
}
void AddressbookData::setAddressStreet(const QString &addressStreet)
{
m_addressStreet = addressStreet;
}
QString AddressbookData::addressHouseNumber() const
{
return m_addressHouseNumber;
}
void AddressbookData::setAddressHouseNumber(const QString &addressHouseNumber)
{
m_addressHouseNumber = addressHouseNumber;
}
QString AddressbookData::addressZipCode() const
{
return m_addressZipCode;
}
void AddressbookData::setAddressZipCode(const QString &addressZipCode)
{
m_addressZipCode = addressZipCode;
}
int AddressbookData::id() const
{
return m_id;
}
void AddressbookData::setId(int id)
{
m_id = id;
}
QSharedPointer<QObject> AddressbookData::country() const
{
return m_country;
}
void AddressbookData::setCountry(const QSharedPointer<QObject> &country)
{
if (qobject_cast<CountryData*>(country.data()) != NULL)
{
m_country = qSharedPointerDynamicCast<CountryData, QObject>(country);
}
}
bool AddressbookData::eq(ComboItem *other)
{
AddressbookData *adb = qobject_cast<AddressbookData*>(other);
return adb != NULL && adb->id() == this->id();
}
QString AddressbookData::toString()
{
return m_firstName + " " + m_lastName + ", " + m_addressStreet + " " + m_addressHouseNumber + ", " + m_addressCity;
}