File indexing completed on 2024-12-22 03:46:49

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #include "contact.h"
0011 
0012 Address::Address(QObject *parent)
0013     : QObject(parent)
0014 {
0015 }
0016 
0017 int Address::houseNumber() const
0018 {
0019     return m_houseNumber;
0020 }
0021 
0022 QString Address::city()
0023 {
0024     return m_city;
0025 }
0026 
0027 QString Address::streetName()
0028 {
0029     return m_streetName;
0030 }
0031 
0032 void Address::setCity(const QString &city)
0033 {
0034     m_city = city;
0035 }
0036 
0037 void Address::setHouseNumber(int houseNumber)
0038 {
0039     m_houseNumber = houseNumber;
0040 }
0041 
0042 void Address::setStreetName(const QString &streetName)
0043 {
0044     m_streetName = streetName;
0045 }
0046 
0047 Contact::Contact(QObject *parent)
0048     : QObject(parent)
0049     , m_address(0)
0050 {
0051 }
0052 
0053 QString Contact::name() const
0054 {
0055     return m_name;
0056 }
0057 
0058 void Contact::setName(const QString &name)
0059 {
0060     m_name = name;
0061 }
0062 
0063 QString Contact::email() const
0064 {
0065     return m_email;
0066 }
0067 
0068 void Contact::setEmail(const QString &email)
0069 {
0070     m_email = email;
0071 }
0072 
0073 QString Contact::phone() const
0074 {
0075     return m_phone;
0076 }
0077 
0078 void Contact::setPhone(const QString &phone)
0079 {
0080     m_phone = phone;
0081 }
0082 
0083 QObject *Contact::address() const
0084 {
0085     return m_address;
0086 }
0087 
0088 void Contact::setAddress(Address *address)
0089 {
0090     m_address = address;
0091 }
0092 
0093 QString Contact::nickname() const
0094 {
0095     return m_nickname;
0096 }
0097 
0098 void Contact::setNickname(const QString &nickname)
0099 {
0100     m_nickname = nickname;
0101 }
0102 
0103 QString Contact::salaryCurrency() const
0104 {
0105     return m_salaryCurrency;
0106 }
0107 
0108 void Contact::setSalaryCurrency(const QString &salaryCurrency)
0109 {
0110     m_salaryCurrency = salaryCurrency;
0111 }
0112 
0113 double Contact::salary() const
0114 {
0115     return m_salary;
0116 }
0117 
0118 void Contact::setSalary(double salary)
0119 {
0120     m_salary = salary;
0121 }
0122 
0123 double Contact::rating() const
0124 {
0125     return m_rating;
0126 }
0127 
0128 void Contact::setRating(double rating)
0129 {
0130     m_rating = rating;
0131 }
0132 
0133 QDate Contact::birthday() const
0134 {
0135     return m_birthday;
0136 }
0137 
0138 void Contact::setBirthday(const QDate &birthday)
0139 {
0140     m_birthday = birthday;
0141 }
0142 
0143 QVariant Contact::data(int role) const
0144 {
0145     if (role != Qt::DisplayRole)
0146         return QListWidgetItem::data(role);
0147     return m_name;
0148 }
0149 
0150 QVariant Contact::friends() const
0151 {
0152     return QVariant::fromValue(m_friends);
0153 }
0154 
0155 void Contact::setFriends(const QList<QObject *> &friends)
0156 {
0157     m_friends = friends;
0158 }
0159 
0160 #include "moc_contact.cpp"