cleaning
[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 <QPointF>
27 #include <QString>
28 #include <QUrl>
29
30 /**
31 * @brief Class to store user information (applies to friends also)
32 *
33 * @author Henri Lampela
34 * @class User user.h "user/user.h"
35 */
36 class User
37 {
38 public:
39
40     /**
41     * @brief Constructor, initializes member data
42     *
43     */
44     User(const QString &address, const QPointF &coordinates, const QString &name,
45          const QString &note, const QUrl &imageUrl, const QUrl &imageUrlBig,
46          const QString &timestamp, const bool &type, const QString &userId,
47          const QString &units = 0, const double &value = 0);
48
49     /**
50     * @brief Default constructor, initializes member data as NULL/0
51     *
52     */
53     User();
54
55     /*******************************************************************************
56      * MEMBER FUNCTIONS AND SLOTS
57      ******************************************************************************/
58
59     /**
60     * @brief Set address
61     *
62     * @param address street address
63     */
64     void setAddress(const QString &address);
65
66     /**
67     * @brief Set coordinates ( x = lon, y = lat )
68     *
69     * @param coordinates coordinates
70     */
71     void setCoordinates(const QPointF &coordinates);
72
73     /**
74     * @brief Set distance
75     *
76     * @param value distance
77     * @param units unit type
78     */
79     void setDistance(const double &value, const QString &units);
80
81     /**
82     * @brief Set note
83     *
84     * @param note note/status message
85     */
86     void setNote(const QString &note);
87
88     /**
89     * @brief Set profile image
90     *
91     * @param image Image
92     */
93     void setProfileImage(const QPixmap &image);
94
95     /**
96     * @brief Set big profile image
97     *
98     * @param image big profile Image
99     */
100     void setProfileImageBig(const QPixmap &image);
101
102     /**
103     * @brief Set download address for profile image
104     *
105     * @param imageUrl image url of big image
106     */
107     void setProfileImageUrl(const QUrl &imageUrl);
108
109     /**
110     * @brief Set download address for big profile image
111     *
112     * @param imageUrl image url
113     */
114     void setProfileImageUrlBig(const QUrl &imageUrl);
115
116     /**
117     * @brief Set timestamp for last status update, timestamp is in literal mode
118     *
119     * @param timestamp timestamp
120     */
121     void setTimestamp(const QString &timestamp);
122
123     /**
124     * @brief Get address
125     *
126     * @return QString address
127     */
128     const QString &address() const;
129
130     /**
131     * @brief Get coordinates
132     *
133     * @return QPointF coordinates
134     */
135     const QPointF &coordinates() const;
136
137     /**
138     * @brief Get distance and units
139     *
140     * @param value distance
141     * @param units unit type
142     */
143     void distance(double &value, QString &units) const;
144
145     /**
146     * @brief Get name
147     *
148     * @return QString profile name
149     */
150     const QString &name() const;
151
152     /**
153     * @brief Get note/status message
154     *
155     * @return QString note
156     */
157     const QString &note() const;
158
159     /**
160     * @brief Get profile image
161     *
162     * @return QPixmap image
163     */
164     const QPixmap &profileImage() const;
165
166     /**
167     * @brief Get big profile image
168     *
169     * @return QPixmap big profile image
170     */
171     const QPixmap &profileImageBig() const;
172
173     /**
174     * @brief Get download address for profile image
175     *
176     * @return QString url
177     */
178     const QUrl &profileImageUrl() const;
179
180     /**
181     * @brief Get download address for big profile image
182     *
183     * @return QString url of big profile image
184     */
185     const QUrl &profileImageUrlBig() const;
186
187     /**
188     * @brief Get timestamp of last status update
189     *
190     * @return QString timestamp
191     */
192     const QString &timestamp() const;
193
194     /**
195     * @brief Get user type
196     *
197     * @return bool user type (true = user, false = friend)
198     */
199     const bool &type() const;
200
201     /**
202     * @brief Get userId
203     *
204     * @return QString userId
205     */
206     const QString &userId() const;
207
208     /*******************************************************************************
209      * DATA MEMBERS
210      ******************************************************************************/
211
212 private:
213     QString m_address; ///< placeholder for address information
214     QPointF m_coordinates; ///< placeholder for coordinates
215     QString m_name; ///< placeholder for name
216     QString m_note; ///< placeholder for note
217     QUrl m_profileImageUrl; ///< placeholder for image url
218     QUrl m_profileImageUrlBig; ///< placeholder for big profile image url
219     QString m_timestamp; ///< placeholer for timestamp
220     bool m_type; ///< placeholder for user type
221     QString m_units; ///< placeholder for distance unit type
222     QString m_userId; ///< placeholder for userId
223     double m_value; ///< placeholder for distance value
224
225     QPixmap m_profileImage; ///< placeholder for image
226     QPixmap m_profileImageBig; ///< placeholder for big image
227 };
228
229
230 #endif // USER_H