Added engine to master
[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 QString &timestamp, const bool &type,
46          const QString &userId, const QString &units = 0, const double &value = 0);
47
48     /**
49     * @brief Default constructor, initializes member data as NULL/0
50     *
51     */
52     User();
53
54     /*******************************************************************************
55      * MEMBER FUNCTIONS AND SLOTS
56      ******************************************************************************/
57
58     /**
59     * @brief Set address
60     *
61     * @param address street address
62     */
63     void setAddress(const QString &address);
64
65     /**
66     * @brief Set coordinates ( x = lon, y = lat )
67     *
68     * @param coordinates coordinates
69     */
70     void setCoordinates(const QPointF &coordinates);
71
72     /**
73     * @brief Set distance
74     *
75     * @param value distance
76     * @param units unit type
77     */
78     void setDistance(const double &value, const QString &units);
79
80     /**
81     * @brief Set note
82     *
83     * @param note note/status message
84     */
85     void setNote(const QString &note);
86
87     /**
88     * @brief Set profile image
89     *
90     * @param image Image
91     */
92     void setProfileImage(const QPixmap &image);
93
94     /**
95     * @brief Set download address for profile image
96     *
97     * @param imageUrl image url
98     */
99     void setProfileImageUrl(const QUrl &imageUrl);
100
101     /**
102     * @brief Set timestamp for last status update, timestamp is in literal mode
103     *
104     * @param timestamp timestamp
105     */
106     void setTimestamp(const QString &timestamp);
107
108     /**
109     * @brief Get address
110     *
111     * @return QString address
112     */
113     const QString &address() const;
114
115     /**
116     * @brief Get coordinates
117     *
118     * @return QPointF coordinates
119     */
120     const QPointF &coordinates() const;
121
122     /**
123     * @brief Get distance and units
124     *
125     * @param value distance
126     * @param units unit type
127     */
128     void distance(double &value, QString &units) const;
129
130     /**
131     * @brief Get name
132     *
133     * @return QString profile name
134     */
135     const QString &name() const;
136
137     /**
138     * @brief Get note/status message
139     *
140     * @return QString note
141     */
142     const QString &note() const;
143
144     /**
145     * @brief Get profile image
146     *
147     * @return QPixmap image
148     */
149     const QPixmap &profileImage() const;
150
151     /**
152     * @brief Get download address for profile image
153     *
154     * @return QString url
155     */
156     const QUrl &profileImageUrl() const;
157
158     /**
159     * @brief Get timestamp of last status update
160     *
161     * @return QString timestamp
162     */
163     const QString &timestamp() const;
164
165     /**
166     * @brief Get user type
167     *
168     * @return bool user type (true = user, false = friend)
169     */
170     const bool &type() const;
171
172     /**
173     * @brief Get userId
174     *
175     * @return QString userId
176     */
177     const QString &userId() const;
178
179     /*******************************************************************************
180      * DATA MEMBERS
181      ******************************************************************************/
182
183 private:
184     QString m_address; ///< placeholder for address information
185     QPointF m_coordinates; ///< placeholder for coordinates
186     QString m_name; ///< placeholder for name
187     QString m_note; ///< placeholder for note
188     QUrl m_profileImageUrl; ///< placeholder for image url
189     QString m_timestamp; ///< placeholer for timestamp
190     bool m_type; ///< placeholder for user type
191     QString m_units; ///< placeholder for distance unit type
192     QString m_userId; ///< placeholder for userId
193     double m_value; ///< placeholder for distance value
194
195     QPixmap m_profileImage; ///< placeholder for image
196 };
197
198
199 #endif // USER_H