Emit error signal when login fails
[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 note
84     *
85     * @param note note/status message
86     */
87     void setNote(const QString &note);
88
89     /**
90     * @brief Set profile image
91     *
92     * @param image Image
93     */
94     void setProfileImage(const QPixmap &image);
95
96     /**
97     * @brief Set download address for profile image
98     *
99     * @param imageUrl image url of big image
100     */
101     void setProfileImageUrl(const QUrl &imageUrl);
102
103     /**
104     * @brief Set timestamp for last status update, timestamp is in literal mode
105     *
106     * @param timestamp timestamp
107     */
108     void setTimestamp(const QString &timestamp);
109
110     /**
111     * @brief Get address
112     *
113     * @return QString address
114     */
115     const QString &address() const;
116
117     /**
118     * @brief Get coordinates
119     *
120     * @return GeoCoordinate coordinates
121     */
122     const GeoCoordinate &coordinates() const;
123
124     /**
125     * @brief Get distance and units
126     *
127     * @param value distance
128     * @param units unit type
129     */
130     void distance(double &value, QString &units) const;
131
132     /**
133     * @brief Get name
134     *
135     * @return QString profile name
136     */
137     const QString &name() const;
138
139     /**
140     * @brief Get note/status message
141     *
142     * @return QString note
143     */
144     const QString &note() const;
145
146     /**
147     * @brief Get profile image
148     *
149     * @return QPixmap image
150     */
151     const QPixmap &profileImage() const;
152
153     /**
154     * @brief Get download address for profile image
155     *
156     * @return QString url
157     */
158     const QUrl &profileImageUrl() const;
159
160     /**
161     * @brief Get timestamp of last status update
162     *
163     * @return QString timestamp
164     */
165     const QString &timestamp() const;
166
167     /**
168     * @brief Get user type
169     *
170     * @return bool user type (true = user, false = friend)
171     */
172     const bool &type() const;
173
174     /**
175     * @brief Get userId
176     *
177     * @return QString userId
178     */
179     const QString &userId() const;
180
181     /*******************************************************************************
182      * DATA MEMBERS
183      ******************************************************************************/
184
185 private:
186     QString m_address; ///< placeholder for address information
187     GeoCoordinate m_coordinates; ///< placeholder for coordinates
188     QString m_name; ///< placeholder for name
189     QString m_note; ///< placeholder for note
190     QUrl m_profileImageUrl; ///< placeholder for image url
191     QString m_timestamp; ///< placeholer for timestamp
192     bool m_type; ///< placeholder for user type
193     QString m_units; ///< placeholder for distance unit type
194     QString m_userId; ///< placeholder for userId
195     double m_value; ///< placeholder for distance value
196     QPixmap m_profileImage; ///< placeholder for image
197 };
198
199
200 #endif // USER_H