2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26 User::User(const QString &address, const GeoCoordinate &coordinates, const QString &name,
27 const QString ¬e, const QUrl &imageUrl, const QString ×tamp, const bool &type,
28 const QString &userId, const QString &units, const double &value)
30 , m_coordinates(coordinates)
33 , m_profileImageUrl(imageUrl)
34 , m_timestamp(timestamp)
59 void User::setAddress(const QString &address)
64 void User::setCoordinates(const GeoCoordinate &coordinates)
66 m_coordinates = coordinates;
69 void User::setDistance(const double &value, const QString &units)
75 void User::setName(const QString &name)
80 void User::setNote(const QString ¬e)
85 void User::setProfileImage(const QPixmap &image)
87 m_profileImage = image;
90 void User::setProfileImageUrl(const QUrl &imageUrl)
92 m_profileImageUrl = imageUrl;
95 void User::setTags(const QHash<QString, QString> &tags)
100 void User::setTags(const QList<QVariant> &tags)
102 QHash<QString, QString> tagsStrings;
104 for (int i = 0; i < tags.count(); ++i)
105 tagsStrings.insert(QString::number(i), tags.at(i).toString());
107 m_tags = tagsStrings;
110 void User::setTags(const QString &tags)
112 QHash<QString, QString> tagsStrings;
113 QStringList invTags = tags.split(",");
115 for (int i = 0; i < invTags.count(); ++i)
116 tagsStrings.insert(QString::number(i), invTags.at(i));
118 m_tags = tagsStrings;
121 void User::setTimestamp(const QString ×tamp)
123 m_timestamp = timestamp;
126 void User::setUserId(const QString &userId)
131 const QString& User::address() const
136 const GeoCoordinate& User::coordinates() const
138 return m_coordinates;
141 void User::distance(double &value, QString &units) const
147 const QString& User::name() const
152 const QString& User::note() const
157 const QPixmap& User::profileImage() const
159 return m_profileImage;
162 const QUrl& User::profileImageUrl() const
164 return m_profileImageUrl;
167 const QHash<QString, QString>& User::tags() const
172 const QString& User::timestamp() const
177 const bool& User::type() const
182 const QString& User::userId() const