2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
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.
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.
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,
22 #ifndef FRIENDLISTVIEW_H
23 #define FRIENDLISTVIEW_H
34 * @brief FriendListView shows items in list.
37 class FriendListView : public QWidget
45 * @param parent parent widget
47 FriendListView(QWidget *parent = 0);
49 /******************************************************************************
50 * MEMBER FUNCTIONS AND SLOTS
51 ******************************************************************************/
54 * @brief Add widget to view and widget list.
57 * @param widget widget to add to list
59 void addWidget(const QString &key, QWidget *widget);
62 * @brief Clear unused widgets from view.
64 * Clears items which are not in user ID's list from the view and widget list.
66 * @param userIDs list of new user ID's.
68 void clearUnused(const QStringList &userIDs);
71 * @brief Clears filtering from list.
73 * Calls show to all widgets.
78 * @brief Checks if view contains widget with userID.
80 * @param userID user's ID
81 * @return true if view contains widget, false otherwise
83 bool contains(const QString &userID);
86 * @brief Sets filter to list.
88 * Hide all widgets that are not in the userIDs list.
90 * @param userIDs user ID's to widgets that are shown
92 void filter(const QList<QString> &userIDs);
95 * @brief Returns FriendListItem with userID.
97 * @param userID user's ID
98 * @return FriendListItem
100 FriendListItem *widget(const QString &userID);
102 /******************************************************************************
104 ******************************************************************************/
106 QVBoxLayout *m_friendListLayout; ///< Layout for this view
107 QHash<QString, QWidget *> m_widgets; ///< List of widgets in this view. Key = user ID
110 #endif // FRIENDLISTVIEW_H