2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
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 Sami Rämö - sami.ramo@ixonos.com
11 Situare is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 version 2 as published by the Free Software Foundation.
15 Situare is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Situare; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26 #ifndef FRIENDLISTPANEL_H
27 #define FRIENDLISTPANEL_H
34 class FriendListItemDelegate;
40 * @brief Class for sliding friends list panel
42 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
43 * @author Henri Lampela - henri.lampela (at) ixonos.com
44 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
45 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
46 * @author Sami Rämö - sami.ramo (at) ixonos.com
48 class FriendListPanel : public QWidget
54 * @brief Default constructor
58 FriendListPanel(QWidget *parent = 0);
60 /*******************************************************************************
61 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
62 ******************************************************************************/
65 * @brief Re-implemented from QWidget::hideEvent()
67 * Calls updateKeyboardGrabbing().
71 void hideEvent(QHideEvent *event);
74 * @brief Re-implemented from QWidget::showEvent()
76 * Calls updateKeyboardGrabbing().
80 void showEvent(QShowEvent *event);
82 /*******************************************************************************
83 * MEMBER FUNCTIONS AND SLOTS
84 ******************************************************************************/
87 * @brief Slot to update friend item's image
91 void friendImageReady(User *user);
94 * @brief Slot to refresh friends list
98 void friendInfoReceived(QList<User *> &friendList);
102 * @brief Set visibility for filtering related UI elements
104 * @param visible True if items should be visible, false if not
106 void setFilteringLayoutVisibility(bool visible);
109 * @brief Takes care of grabbing and releasing the keyboard when required
111 * Keyboard is grabbed when MainWindow it the topmost window and FriendListPanel is visible.
112 * Releasing is done if the MainWindow is not the topmost window and/or FriendListPanel
115 void updateKeyboardGrabbing();
119 * @brief Slot to clear friend list filter.
121 void clearFriendListFilter();
124 * @brief Slot for clearing the friend list filtering.
126 void clearFiltering();
129 * @brief Set filtering UI elements visibility based on the filtering text value
131 * Filtering UI elements are invoked when the text becomes not empty and hidden when text
134 * @param text New text value
136 void filterTextChanged(const QString &text);
139 * @brief Called when topmost window is changed
141 * Does set m_mainWindowIsTopmost and calls updateKeyboardGrabbing()
143 * @param mainWindowIsTopmost True if MainWindow is the topmost one
145 void topmostWindowChanged(bool mainWindowIsTopmost);
148 * @brief Slot to show friends in list.
150 * Shows only friends that are on userIDs list.
151 * @param userIDs list of user ID's
153 void showFriendsInList(const QList<QString> &userIDs);
155 /*******************************************************************************
157 ******************************************************************************/
160 * @brief Signal for friend finding.
162 * @param coordinates Target coordinate
164 void findFriend(const GeoCoordinate &coordinates);
166 /*******************************************************************************
168 ******************************************************************************/
170 bool m_mainWindowIsTopmost; ///< Is the MainWindow the topmost one
172 QLabel *m_friendListLabel; ///< Friend list label
173 QLineEdit *m_filterField; ///< Text field for the filter text
174 QPushButton *m_clearFilterButton; ///< Button to clear list filtering
175 QPushButton *m_filterClearButton; ///< Button for clearing the filtering
176 QWidget *m_friendListHeaderWidget; ///< Friend list header widget
178 FriendListView *m_friendListView; ///< Friend list view
182 #endif // FRIENDLISTPANEL_H