Added routing feature to friend and location list.
[situare] / src / ui / friendlistpanel.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Kaj Wallin - kaj.wallin@ixonos.com
6         Henri Lampela - henri.lampela@ixonos.com
7         Pekka Nissinen - pekka.nissinen@ixonos.com
8         Jussi Laitinen - jussi.laitinen@ixonos.com
9
10     Situare is free software; you can redistribute it and/or
11     modify it under the terms of the GNU General Public License
12     version 2 as published by the Free Software Foundation.
13
14     Situare is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17     GNU General Public License for more details.
18
19     You should have received a copy of the GNU General Public License
20     along with Situare; if not, write to the Free Software
21     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
22     USA.
23 */
24
25 #ifndef FRIENDLISTPANEL_H
26 #define FRIENDLISTPANEL_H
27
28 #include <QtGui>
29
30 class QLabel;
31 class QWidget;
32
33 class FriendListItemDelegate;
34 class GeoCoordinate;
35 class FriendListView;
36 class User;
37
38 /**
39  * @brief Class for sliding friends list panel
40  *
41  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
42  * @author Henri Lampela - henri.lampela (at) ixonos.com
43  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
44  * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
45  */
46 class FriendListPanel : public QWidget
47 {
48     Q_OBJECT
49
50 public:
51     /**
52      * @brief Default constructor
53      *
54      * @param parent
55      */
56     FriendListPanel(QWidget *parent = 0);
57
58 /*******************************************************************************
59  * MEMBER FUNCTIONS AND SLOTS
60  ******************************************************************************/
61 public slots:
62     /**
63      * @brief Slot to update friend item's image
64      *
65      * @param user Friend
66      */
67     void friendImageReady(User *user);
68
69     /**
70      * @brief Slot to refresh friends list
71      *
72      * @param friendList
73      */
74     void friendInfoReceived(QList<User *> &friendList);
75
76 private slots:
77     /**
78      * @brief Slot to clear friend list filter.
79      */
80     void clearFriendListFilter();
81
82     /**
83     * @brief Routes to selected friend.
84     *
85     * Emits routeToFriend if friend is selected from list.
86     */
87     void routeToSelectedFriend();
88
89     /**
90      * @brief Slot to show friends in list.
91      *
92      * Shows only friends that are on userIDs list.
93      * @param userIDs list of user ID's
94      */
95     void showFriendsInList(const QList<QString> &userIDs);
96
97 /*******************************************************************************
98  * SIGNALS
99  ******************************************************************************/
100 signals:
101     /**
102      * @brief Signal for friend finding.
103      *
104      * @param coordinates Target coordinate
105      */
106     void findFriend(const GeoCoordinate &coordinates);
107
108     /**
109     * @brief Signal for routing to friend.
110     *
111     * @param coordinates friend's geo coordinates
112     */
113     void routeToFriend(const GeoCoordinate &coordinates);
114
115 /*******************************************************************************
116  * DATA MEMBERS
117  ******************************************************************************/
118 private:
119     QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
120
121     QLabel *m_friendListLabel;          ///< Friend list label
122
123     QPushButton *m_clearFilterButton;   ///< Button to clear list filtering
124     QPushButton *m_routeButton;         ///< Button to route to friend
125
126     FriendListView *m_friendListView;   ///< Friend list view
127 };
128
129 #endif // FRIENDLISTPANEL_H