2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
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.
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.
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,
30 #include "coordinates/geocoordinate.h"
33 * @brief Container for a single message.
35 * @author Jussi Laitinen - jussi.laitinen@ixonos.com
40 enum Type{MessageTypeReceived, MessageTypeSent};
45 * Constructs empty Message object.
47 Message(const Type type = Message::MessageTypeReceived);
49 /*******************************************************************************
50 * MEMBER FUNCTIONS AND SLOTS
51 ******************************************************************************/
54 * @brief Returns message's coordinates
56 * @return message's coordinates as GeoCoordinate
58 const GeoCoordinate &coordinates() const;
61 * @brief Returns message's ID
63 * @return message's ID
65 const QString &id() const;
68 * @brief Returns message's image
70 * @return message's image
72 const QPixmap &image() const;
75 * @brief Returns message receiver's ID
77 * @return message receiver's ID
79 const QString &receiverId() const;
82 * @brief Returns message sender's ID
84 * @return message sender's ID
86 const QString &senderId() const;
89 * @brief Returns message sender's name
91 * @return message sender's name
93 const QString &senderName() const;
96 * @brief Sets message's coordinates
98 * @param coordinates message's coordinates
100 void setCoordinates(const GeoCoordinate &coordinates);
103 * @brief Sets message's image
105 * @param image message's image
107 void setImage(const QPixmap &image);
110 * @brief Sets message's ID
112 * @param id message's ID
114 void setId(const QString &id);
117 * @brief Sets message receiver's ID
119 * @param id message receiver's ID
121 void setReceiverId(const QString &receiverId);
124 * @brief Sets message's text
126 * @param text message's text
128 void setText(const QString &text);
131 * @brief Sets message's timestamp
133 * @param image message's timestamp
135 void setTimestamp(const QDateTime ×tamp);
138 * @brief Sets message's title
140 * @param title message's title
142 void setTitle(const QString &title);
145 * @brief Sets message's type
147 * @param type message's type
149 void setType(const Type type);
152 * @brief Sets message sender's ID
154 * @param id message sender's ID
156 void setSenderId(const QString &senderId);
159 * @brief Sets message sender's name
161 * @param id message sender's name
163 void setSenderName(const QString &senderName);
166 * @brief Returns message's text
168 * @return message's text
170 const QString &text() const;
173 * @brief Returns message's timestamp
175 * @return message's timestamp
177 const QDateTime ×tamp() const;
180 * @brief Returns message's title
182 * @return message's title
184 const QString &title() const;
187 * @brief Returns message's type
189 * @return message's type
191 const Message::Type &type() const;
193 /*******************************************************************************
195 ******************************************************************************/
197 QDateTime m_timestamp; ///< message's timestamp
198 QString m_id; ///< message's ID
199 QPixmap m_image; ///< message's image
200 QString m_receiverId; ///< message receiver's ID
201 QString m_senderId; ///< message sender's ID
202 QString m_senderName; ///< message sender's name
203 QString m_text; ///< message's text
204 QString m_title; ///< message's title
206 GeoCoordinate m_coordinates; ///< message's coordinates
208 Type m_type; ///< message's type
211 Q_DECLARE_METATYPE(Message)