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,
29 #include "../coordinates/geocoordinate.h"
32 * @brief Class to store user information (applies to friends also)
34 * @author Henri Lampela
35 * @class User user.h "user/user.h"
42 * @brief Constructor, initializes member data
45 User(const QString &address, const GeoCoordinate &coordinates, const QString &name,
46 const QString ¬e, const QUrl &imageUrl, const QString ×tamp,
47 const bool &type, const QString &userId, const QString &units = 0,
48 const double &value = 0);
51 * @brief Default constructor, initializes member data as NULL/0
56 /*******************************************************************************
57 * MEMBER FUNCTIONS AND SLOTS
58 ******************************************************************************/
63 * @param address street address
65 void setAddress(const QString &address);
68 * @brief Set coordinates ( x = lon, y = lat )
70 * @param coordinates coordinates
72 void setCoordinates(const GeoCoordinate &coordinates);
77 * @param value distance
78 * @param units unit type
80 void setDistance(const double &value, const QString &units);
85 * @param name user name
87 void setName(const QString &name);
92 * @param note note/status message
94 void setNote(const QString ¬e);
97 * @brief Set profile image
101 void setProfileImage(const QPixmap &image);
104 * @brief Set download address for profile image
106 * @param imageUrl image url of big image
108 void setProfileImageUrl(const QUrl &imageUrl);
111 * @brief Sets user's tags.
113 * @param tags user's tags
115 void setTags(const QHash<QString, QString> &tags);
118 * @brief Sets user's tags.
120 * @param tags user's tags
122 void setTags(const QList<QVariant> &tags);
125 * @brief Sets user's tags.
127 * @param tags user's tags
129 void setTags(const QString &tags);
132 * @brief Set timestamp for last status update, timestamp is in literal mode
134 * @param timestamp timestamp
136 void setTimestamp(const QString ×tamp);
139 * @brief Sets user's ID.
141 * @param userId user's ID
143 void setUserId(const QString &userId);
148 * @return QString address
150 const QString &address() const;
153 * @brief Get coordinates
155 * @return GeoCoordinate coordinates
157 const GeoCoordinate &coordinates() const;
160 * @brief Get distance and units
162 * @param value distance
163 * @param units unit type
165 void distance(double &value, QString &units) const;
170 * @return QString profile name
172 const QString &name() const;
175 * @brief Get note/status message
177 * @return QString note
179 const QString ¬e() const;
182 * @brief Get profile image
184 * @return QPixmap image
186 const QPixmap &profileImage() const;
189 * @brief Get download address for profile image
191 * @return QString url
193 const QUrl &profileImageUrl() const;
196 * @brief Returns user's tags.
198 * @return QStringList list of tags
200 const QHash<QString, QString> &tags() const;
203 * @brief Get timestamp of last status update
205 * @return QString timestamp
207 const QString ×tamp() const;
210 * @brief Get user type
212 * @return bool user type (true = user, false = friend)
214 const bool &type() const;
219 * @return QString userId
221 const QString &userId() const;
223 /*******************************************************************************
225 ******************************************************************************/
228 QString m_address; ///< placeholder for address information
229 GeoCoordinate m_coordinates; ///< placeholder for coordinates
230 QString m_name; ///< placeholder for name
231 QString m_note; ///< placeholder for note
232 QUrl m_profileImageUrl; ///< placeholder for image url
233 QHash<QString, QString> m_tags; ///< placeholder for tags
234 QString m_timestamp; ///< placeholer for timestamp
235 bool m_type; ///< placeholder for user type
236 QString m_units; ///< placeholder for distance unit type
237 QString m_userId; ///< placeholder for userId
238 double m_value; ///< placeholder for distance value
239 QPixmap m_profileImage; ///< placeholder for image