Renamed some of the old panel classes and re-organized the whole panel structure
[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
8     Situare is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License
10     version 2 as published by the Free Software Foundation.
11
12     Situare is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with Situare; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
20     USA.
21  */
22
23 #ifndef FRIENDLISTPANEL_H
24 #define FRIENDLISTPANEL_H
25
26 #include <QtGui>
27
28 class QLabel;
29 class QWidget;
30
31 class FriendListItemDelegate;
32 class GeoCoordinate;
33 class ListView;
34 class User;
35
36 /**
37 * @brief Class for sliding friends list panel
38 *
39 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
40 * @class FriendListPanel friendlistpanel.h "ui/friendlistpanel.h"
41 */
42 class FriendListPanel : public QWidget
43 {
44     Q_OBJECT
45
46 public:
47     /**
48     * @brief Default constructor
49     *
50     * @param parent
51     */
52     FriendListPanel(QWidget *parent = 0);
53
54 /*******************************************************************************
55  * MEMBER FUNCTIONS AND SLOTS
56  ******************************************************************************/
57 public slots:
58     /**
59     * @brief Slot to update friend item's image
60     *
61     * @param user Friend
62     */
63     void friendImageReady(User *user);
64
65     /**
66     * @brief Slot to refresh friends list
67     *
68     * @param friendList
69     */
70     void friendInfoReceived(QList<User *> &friendList);
71
72 private slots:
73     /**
74     * @brief Slot to clear friend list filter.
75     */
76     void clearFriendListFilter();
77
78     /**
79     * @brief Slot to show friends in list.
80     *
81     * Shows only friends that are on userIDs list.
82     * @param userIDs list of user ID's
83     */
84     void showFriendsInList(const QList<QString> &userIDs);
85
86 /*******************************************************************************
87  * SIGNALS
88  ******************************************************************************/
89 signals:
90     /**
91     * @brief Signal for friend finding.
92     *
93     * @param coordinates Target coordinate
94     */
95     void findFriend(const GeoCoordinate &coordinates);
96
97 /*******************************************************************************
98  * DATA MEMBERS
99  ******************************************************************************/
100 private:
101     QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
102     QLabel *m_friendListLabel;          ///< Friend list label
103     QPushButton *m_clearFilterButton;   ///< Button to clear list filtering
104     ListView *m_friendListView;         ///< Friend list view
105     FriendListItemDelegate *m_friendListItemDelegate;   ///< Friend list item delegate
106 };
107
108 #endif // FRIENDLISTPANEL_H