Added new List stubs, modified MeetPeoplePanel unit test.
[situare] / src / ui / personlistitem.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 PERSONLISTITEM_H
23 #define PERSONLISTITEM_H
24
25 #include "../coordinates/geocoordinate.h"
26 #include "extendedlistitem.h"
27
28 class User;
29
30 /**
31 * @brief List item stores information about persons.
32 *
33 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
34 */
35 class PersonListItem : public ExtendedListItem
36 {
37
38 public:
39     /**
40     * @brief Constructor.
41     *
42     * Sets sub items' text width.
43     */
44     PersonListItem();
45
46     /**
47     * @brief Destructor.
48     */
49     ~PersonListItem();
50
51 /******************************************************************************
52 * MEMBER FUNCTIONS AND SLOTS
53 ******************************************************************************/
54 public:
55     /**
56     * @brief Returns item's coordinates.
57     *
58     * @return item's coordinates
59     */
60     GeoCoordinate coordinates() const;
61
62     /**
63     * @brief Return's item's Facebook ID
64     *
65     * @return item's Facebook ID
66     */
67     QString facebookId() const;
68
69     /**
70     * @brief Sets avatar image for this item.
71     *
72     * @param image image
73     */
74     void setAvatarImage(const QPixmap &image);
75
76     /**
77     * @brief Sets item's coordinates.
78     *
79     * @param coordinates GeoCoordinate
80     */
81     void setCoordinates(const GeoCoordinate &coordinates);
82
83     /**
84     * @brief Set person data for this item.
85     *
86     * @param user User
87     */
88     void setPersonData(const User &user);
89
90 private:
91     /**
92     * @brief Sets item's Facebook ID
93     *
94     * @param facebookId item's Facebook ID
95     */
96     void setFacebookId(const QString &facebookId);
97
98 /******************************************************************************
99 * DATA MEMBERS
100 ******************************************************************************/
101 private:
102     QString m_facebookId;           ///< User's Facebook ID
103
104     GeoCoordinate m_coordinates;    ///< User coordinates
105 };
106
107 #endif // PERSONLISTITEM_H
108