Changed fetchPeopleWithSimilarInterest to send request to Situare server instead...
[situare] / src / user / user.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Henri Lampela - henri.lampela@ixonos.com
6
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.
10
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.
15
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,
19    USA.
20 */
21
22 #ifndef USER_H
23 #define USER_H
24
25 #include <QPixmap>
26 #include <QString>
27 #include <QUrl>
28
29 #include "../coordinates/geocoordinate.h"
30
31 /**
32 * @brief Class to store user information (applies to friends also)
33 *
34 * @author Henri Lampela
35 * @class User user.h "user/user.h"
36 */
37 class User
38 {
39 public:
40
41     /**
42     * @brief Constructor, initializes member data
43     *
44     */
45     User(const QString &address, const GeoCoordinate &coordinates, const QString &name,
46          const QString &note, const QUrl &imageUrl, const QString &timestamp,
47          const bool &type, const QString &userId, const QString &units = 0,
48          const double &value = 0);
49
50     /**
51     * @brief Default constructor, initializes member data as NULL/0
52     *
53     */
54     User();
55
56     /*******************************************************************************
57      * MEMBER FUNCTIONS AND SLOTS
58      ******************************************************************************/
59
60     /**
61     * @brief Set address
62     *
63     * @param address street address
64     */
65     void setAddress(const QString &address);
66
67     /**
68     * @brief Set coordinates ( x = lon, y = lat )
69     *
70     * @param coordinates coordinates
71     */
72     void setCoordinates(const GeoCoordinate &coordinates);
73
74     /**
75     * @brief Set distance
76     *
77     * @param value distance
78     * @param units unit type
79     */
80     void setDistance(const double &value, const QString &units);
81
82     /**
83     * @brief Set name
84     *
85     * @param name user name
86     */
87     void setName(const QString &name);
88
89     /**
90     * @brief Set note
91     *
92     * @param note note/status message
93     */
94     void setNote(const QString &note);
95
96     /**
97     * @brief Set profile image
98     *
99     * @param image Image
100     */
101     void setProfileImage(const QPixmap &image);
102
103     /**
104     * @brief Set download address for profile image
105     *
106     * @param imageUrl image url of big image
107     */
108     void setProfileImageUrl(const QUrl &imageUrl);
109
110     /**
111     * @brief Sets user's tags.
112     *
113     * @param tags user's tags
114     */
115     void setTags(const QHash<QString, QString> &tags);
116
117     /**
118     * @brief Sets user's tags.
119     *
120     * @param tags user's tags
121     */
122     void setTags(const QList<QVariant> &tags);
123
124     /**
125     * @brief Sets user's tags.
126     *
127     * @param tags user's tags
128     */
129     void setTags(const QString &tags);
130
131     /**
132     * @brief Set timestamp for last status update, timestamp is in literal mode
133     *
134     * @param timestamp timestamp
135     */
136     void setTimestamp(const QString &timestamp);
137
138     /**
139     * @brief Sets user's ID.
140     *
141     * @param userId user's ID
142     */
143     void setUserId(const QString &userId);
144
145     /**
146     * @brief Get address
147     *
148     * @return QString address
149     */
150     const QString &address() const;
151
152     /**
153     * @brief Get coordinates
154     *
155     * @return GeoCoordinate coordinates
156     */
157     const GeoCoordinate &coordinates() const;
158
159     /**
160     * @brief Get distance and units
161     *
162     * @param value distance
163     * @param units unit type
164     */
165     void distance(double &value, QString &units) const;
166
167     /**
168     * @brief Get name
169     *
170     * @return QString profile name
171     */
172     const QString &name() const;
173
174     /**
175     * @brief Get note/status message
176     *
177     * @return QString note
178     */
179     const QString &note() const;
180
181     /**
182     * @brief Get profile image
183     *
184     * @return QPixmap image
185     */
186     const QPixmap &profileImage() const;
187
188     /**
189     * @brief Get download address for profile image
190     *
191     * @return QString url
192     */
193     const QUrl &profileImageUrl() const;
194
195     /**
196     * @brief Returns user's tags.
197     *
198     * @return QStringList list of tags
199     */
200     const QHash<QString, QString> &tags() const;
201
202     /**
203     * @brief Get timestamp of last status update
204     *
205     * @return QString timestamp
206     */
207     const QString &timestamp() const;
208
209     /**
210     * @brief Get user type
211     *
212     * @return bool user type (true = user, false = friend)
213     */
214     const bool &type() const;
215
216     /**
217     * @brief Get userId
218     *
219     * @return QString userId
220     */
221     const QString &userId() const;
222
223     /*******************************************************************************
224      * DATA MEMBERS
225      ******************************************************************************/
226
227 private:
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
240 };
241
242
243 #endif // USER_H