Added coordinates to Messages, added Message type.
[situare] / src / situareservice / message.cpp
1 #include <QDebug>
2
3 #include "message.h"
4
5 Message::Message(const Type type)
6     : m_timestamp(QDateTime()),
7       m_id(QString()),
8       m_image(QPixmap()),
9       m_receiverId(QString()),
10       m_senderId(QString()),
11       m_senderName(QString()),
12       m_text(QString()),
13       m_title(QString()),
14       m_coordinates(GeoCoordinate()),
15       m_type(type)
16 {
17     qDebug() << __PRETTY_FUNCTION__;
18 }
19
20 const GeoCoordinate &Message::coordinates() const
21 {
22     qDebug() << __PRETTY_FUNCTION__;
23
24     return m_coordinates;
25 }
26
27
28 const QString &Message::id() const
29 {
30     qDebug() << __PRETTY_FUNCTION__;
31
32     return m_id;
33 }
34
35 const QPixmap &Message::image() const
36 {
37     qDebug() << __PRETTY_FUNCTION__;
38
39     return m_image;
40 }
41
42 const QString &Message::receiverId() const
43 {
44     qDebug() << __PRETTY_FUNCTION__;
45
46     return m_receiverId;
47 }
48
49 const QString &Message::senderId() const
50 {
51     qDebug() << __PRETTY_FUNCTION__;
52
53     return m_senderId;
54 }
55
56 const QString &Message::senderName() const
57 {
58     qDebug() << __PRETTY_FUNCTION__;
59
60     return m_senderName;
61 }
62
63 void Message::setCoordinates(const GeoCoordinate &coordinates)
64 {
65     qDebug() << __PRETTY_FUNCTION__;
66
67     m_coordinates = coordinates;
68 }
69
70 void Message::setImage(const QPixmap &image)
71 {
72     qDebug() << __PRETTY_FUNCTION__;
73
74     m_image = image;
75 }
76
77 void Message::setId(const QString &id)
78 {
79     qDebug() << __PRETTY_FUNCTION__;
80
81     m_id = id;
82 }
83
84 void Message::setReceiverId(const QString &receiverId)
85 {
86     qDebug() << __PRETTY_FUNCTION__;
87
88     m_receiverId = receiverId;
89 }
90
91 void Message::setSenderId(const QString &senderId)
92 {
93     qDebug() << __PRETTY_FUNCTION__;
94
95     m_senderId = senderId;
96 }
97
98 void Message::setSenderName(const QString &senderName)
99 {
100     qDebug() << __PRETTY_FUNCTION__;
101
102     m_senderName = senderName;
103 }
104
105 void Message::setText(const QString &text)
106 {
107     qDebug() << __PRETTY_FUNCTION__;
108
109     m_text = text;
110 }
111
112 void Message::setTimestamp(const QDateTime &timestamp)
113 {
114     qDebug() << __PRETTY_FUNCTION__;
115
116     m_timestamp = timestamp;
117 }
118
119 void Message::setTitle(const QString &title)
120 {
121     qDebug() << __PRETTY_FUNCTION__;
122
123     m_title = title;
124 }
125
126 void Message::setType(const Type type)
127 {
128     qDebug() << __PRETTY_FUNCTION__;
129
130     m_type = type;
131 }
132
133 const QString &Message::text() const
134 {
135     qDebug() << __PRETTY_FUNCTION__;
136
137     return m_text;
138 }
139
140 const QDateTime &Message::timestamp() const
141 {
142     qDebug() << __PRETTY_FUNCTION__;
143
144     return m_timestamp;
145 }
146
147 const QString &Message::title() const
148 {
149     qDebug() << __PRETTY_FUNCTION__;
150
151     return m_title;
152 }
153
154 const Message::Type &Message::type() const
155 {
156     qDebug() << __PRETTY_FUNCTION__;
157
158     return m_type;
159 }