Fixed some issues
[situare] / src / user / user.cpp
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 #include "user.h"
23
24 User::User(QString address, QPointF coordinates, QString name, QString note, QUrl imageUrl,
25            QString timestamp, bool type, QString userId, QString units, double value)
26                : m_address(address)
27                , m_coordinates(coordinates)
28                , m_name(name)
29                , m_note(note)
30                , m_profileImageUrl(imageUrl)
31                , m_timestamp(timestamp)
32                , m_type(type)
33                , m_units(units)
34                , m_userId(userId)
35                , m_value(value)
36 {
37
38 }
39
40 void User::setAddress(const QString &address)
41 {
42     m_address = address;
43 }
44
45 void User::setCoordinates(const QPointF &coordinates)
46 {
47     m_coordinates = coordinates;
48 }
49
50 void User::setDistance(const double &value, const QString &units)
51 {
52     m_value = value;
53     m_units = units;
54 }
55
56 void User::setNote(const QString &note)
57 {
58     m_note = note;
59 }
60
61 void User::setProfileImage(const QPixmap &image)
62 {
63     m_profileImage = image;
64 }
65
66 void User::setProfileImageUrl(const QUrl &imageUrl)
67 {
68     m_profileImageUrl = imageUrl;
69 }
70
71 void User::setTimestamp(const QString &timestamp)
72 {
73     m_timestamp = timestamp;
74 }
75
76 QString User::address() const
77 {
78     return m_address;
79 }
80
81 QPointF User::coordinates() const
82 {
83     return m_coordinates;
84 }
85
86 void User::distance(double &value, QString &units) const
87 {
88     value = m_value;
89     units = m_units;
90 }
91
92 QString User::name() const
93 {
94     return m_name;
95 }
96
97 QString User::note() const
98 {
99     return m_note;
100 }
101
102 QPixmap User::profileImage() const
103 {
104     return m_profileImage;
105 }
106
107 QUrl User::profileImageUrl() const
108 {
109     return m_profileImageUrl;
110 }
111
112 QString User::timestamp() const
113 {
114     return m_timestamp;
115 }
116
117 bool User::type() const
118 {
119     return m_type;
120 }
121
122 QString User::userId() const
123 {
124     return m_userId;
125 }