Added unit tests.
[situare] / src / ui / messagelistitem.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jussi Laitinen - jussi.laitinen@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 MESSAGELISTITEM_H
23 #define MESSAGELISTITEM_H
24
25 #include "../coordinates/geocoordinate.h"
26 #include "extendedlistitem.h"
27
28 class Message;
29
30 /**
31 * @brief Item stores message data.
32 *
33 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
34 */
35 class MessageListItem : public ExtendedListItem
36 {
37 public:
38     /**
39     * @brief Constructor.
40     *
41     * Sets sub items' text width.
42     */
43     MessageListItem();
44
45     /**
46     * @brief Destructor.
47     */
48     ~MessageListItem();
49
50 /******************************************************************************
51 * MEMBER FUNCTIONS AND SLOTS
52 ******************************************************************************/
53 public:
54     /**
55     * @brief Returns item's coordinates.
56     *
57     * @return item's coordinates
58     */
59     GeoCoordinate &coordinates() const;
60
61     /**
62     * @brief Returns message's ID.
63     *
64     * @return message's ID
65     */
66     QString &id() const;
67
68     /**
69     * @brief Returns new message message receiver's ID.
70     *
71     * @return new message message receiver's ID
72     */
73     QString &newMessageReceiverId() const;
74
75     /**
76     * @brief Sets new message message receiver's ID.
77     *
78     * @return newMessageReceiverId new message message receiver's ID
79     */
80     void setNewMessageReceiverId(const QString &newMessageReceiverId);
81
82     /**
83     * @brief Set message data for this item.
84     *
85     * @param message Messagedata
86     */
87     void setMessageData(const Message &message);
88
89 /******************************************************************************
90 * DATA MEMBERS
91 ******************************************************************************/
92 private:
93     QString m_id;                   ///< message's ID
94     QString m_newMessageReceiverId;           ///< new message reveiver's ID
95
96     GeoCoordinate m_coordinates;    ///< message's coordinates
97 };
98
99 #endif // MESSAGELISTITEM_H