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