Fixed search history settings read and write and added search history
[situare] / src / ui / friendlistitem.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 FRIENDLISTITEM_H
23 #define FRIENDLISTITEM_H
24
25 #include "coordinates/geocoordinate.h"
26 #include "extendedlistitem.h"
27
28 class User;
29
30 /**
31 * @brief List item stores information about friends.
32 *
33 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
34 */
35 class FriendListItem : public ExtendedListItem
36 {
37
38 public:
39     /**
40     * @brief Constructor.
41     *
42     * Sets sub items' text width.
43     */
44     FriendListItem();
45
46     /**
47     * @brief Destructor.
48     */
49     ~FriendListItem();
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 Sets avatar image for this item.
64     *
65     * @param image image
66     */
67     void setAvatarImage(const QPixmap &image);
68
69     /**
70     * @brief Sets item's coordinates.
71     *
72     * @param coordinates GeoCoordinate
73     */
74     void setCoordinates(const GeoCoordinate &coordinates);
75
76     /**
77     * @brief Set user data for this item.
78     *
79     * @param user User pointer
80     */
81     void setUserData(User *user);
82
83 private:
84     /**
85     * @brief Set distance icon.
86     *
87     * Icon is selected by distance.
88     *
89     * @param value distance value
90     * @param unit distance unit
91     */
92     void setDistanceIcon(double value, const QString &unit);
93
94 /******************************************************************************
95 * DATA MEMBERS
96 ******************************************************************************/
97 private:
98     GeoCoordinate m_coordinates;    ///< User coordinates
99 };
100
101 #endif // FRIENDLISTITEM_H