Modified FriendListItem constructor.
[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 <QPointF>
26 #include <QString>
27 #include <QUrl>
28
29 /**
30 * @brief Class to store user information (applies to friends also)
31 *
32 * @author Henri Lampela
33 * @class User user.h "user/user.h"
34 */
35 class User
36 {
37 public:
38
39     User();
40
41     /**
42     * @brief Default constructor, initializes member data
43     *
44     */
45     User(const QString address, const QPointF coordinates, const QString name, const QString note,
46          const QUrl imageUrl, const QString timestamp, const bool type, const QString userId,
47          const QString units = 0, const double value = 0);
48
49     /*******************************************************************************
50      * MEMBER FUNCTIONS AND SLOTS
51      ******************************************************************************/
52
53     /**
54     * @brief Set address
55     *
56     * @param address street address
57     */
58     void setAddress(const QString &address);
59
60     /**
61     * @brief Set coordinates ( x = lon, y = lat )
62     *
63     * @param coordinates coordinates
64     */
65     void setCoordinates(const QPointF &coordinates);
66
67     /**
68     * @brief Set distance
69     *
70     * @param value distance
71     * @param units unit type
72     */
73     void setDistance(const double &value, const QString &units);
74
75     /**
76     * @brief Set note
77     *
78     * @param note note/status message
79     */
80     void setNote(const QString &note);
81
82     /**
83     * @brief Set download address for profile image
84     *
85     * @param imageUrl image url
86     */
87     void setProfileImageUrl(const QUrl &imageUrl);
88
89     /**
90     * @brief Set timestamp for last status update, timestamp is in literal mode
91     *
92     * @param timestamp timestamp
93     */
94     void setTimestamp(const QString &timestamp);
95
96     /**
97     * @brief Get address
98     *
99     * @return QString address
100     */
101     QString address() const;
102
103     /**
104     * @brief Get coordinates
105     *
106     * @return QPointF coordinates
107     */
108     QPointF coordinates() const;
109
110     /**
111     * @brief Get distance and units
112     *
113     * @param value distance
114     * @param units unit type
115     */
116     void distance(double &value, QString &units) const;
117
118     /**
119     * @brief Get name
120     *
121     * @return QString profile name
122     */
123     QString name() const;
124
125     /**
126     * @brief Get note/status message
127     *
128     * @return QString note
129     */
130     QString note() const;
131
132     /**
133     * @brief Get download address for profile image
134     *
135     * @return QString url
136     */
137     QUrl profileImageUrl() const;
138
139     /**
140     * @brief Get timestamp of last status update
141     *
142     * @return QString timestamp
143     */
144     QString timestamp() const;
145
146     /**
147     * @brief Get user type
148     *
149     * @return bool user type (true = user, false = friend)
150     */
151     bool type() const;
152
153     /**
154     * @brief Get userId
155     *
156     * @return QString userId
157     */
158     QString userId() const;
159
160     /*******************************************************************************
161      * DATA MEMBERS
162      ******************************************************************************/
163
164 private:
165     QString m_address; ///< placeholder for address information
166     QPointF m_coordinates; ///< placeholder for coordinates
167     QString m_name; ///< placeholder for name
168     QString m_note; ///< placeholder for note
169     QUrl m_profileImageUrl; ///< placeholder for image url
170     QString m_timestamp; ///< placeholer for timestamp
171     bool m_type; ///< placeholder for user type
172     QString m_units; ///< placeholder for distance unit type
173     QString m_userId; ///< placeholder for userId
174     double m_value; ///< placeholder for distance value
175 };
176
177
178 #endif // USER_H