00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Kaj Wallin - kaj.wallin@ixonos.com 00006 Henri Lampela - henri.lampela@ixonos.com 00007 Pekka Nissinen - pekka.nissinen@ixonos.com 00008 Jussi Laitinen - jussi.laitinen@ixonos.com 00009 Sami Rämö - sami.ramo@ixonos.com 00010 00011 Situare is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 version 2 as published by the Free Software Foundation. 00014 00015 Situare is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with Situare; if not, write to the Free Software 00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00023 USA. 00024 */ 00025 00026 #ifndef FRIENDLISTPANEL_H 00027 #define FRIENDLISTPANEL_H 00028 00029 #include "panelbase.h" 00030 00031 class QLabel; 00032 class QLineEdit; 00033 class QPushButton; 00034 00035 class FriendListItemDelegate; 00036 class FriendListView; 00037 class GeoCoordinate; 00038 class ImageButton; 00039 class User; 00040 00050 class FriendListPanel : public PanelBase 00051 { 00052 Q_OBJECT 00053 00054 public: 00060 FriendListPanel(QWidget *parent = 0); 00061 00062 /******************************************************************************* 00063 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00064 ******************************************************************************/ 00065 protected: 00073 void hideEvent(QHideEvent *event); 00074 00082 void showEvent(QShowEvent *event); 00083 00084 /******************************************************************************* 00085 * MEMBER FUNCTIONS AND SLOTS 00086 ******************************************************************************/ 00087 public slots: 00093 void friendImageReady(User *user); 00094 00100 void friendInfoReceived(QList<User *> &friendList); 00101 00102 private: 00108 void setFilteringLayoutVisibility(bool visible); 00109 00117 void updateKeyboardGrabbing(); 00118 00119 private slots: 00128 void anyPanelClosed(); 00129 00136 void anyPanelOpened(); 00137 00143 void clearFiltering(); 00144 00150 void clearTextFiltering(); 00151 00162 void filterTextChanged(const QString &text); 00163 00167 void requestSelectedFriendContactDialog(); 00168 00174 void routeToSelectedFriend(); 00175 00181 void setRouteButtonDisabled(); 00182 00189 void showFriendsInList(const QList<QString> &userIDs); 00190 00198 void topmostWindowChanged(bool mainWindowIsTopmost); 00199 00200 /******************************************************************************* 00201 * SIGNALS 00202 ******************************************************************************/ 00203 signals: 00209 void findFriend(const GeoCoordinate &coordinates); 00210 00216 void requestContactDialog(const QString &facebookId); 00217 00223 void routeToFriend(const GeoCoordinate &coordinates); 00224 00225 /******************************************************************************* 00226 * DATA MEMBERS 00227 ******************************************************************************/ 00228 private: 00229 bool m_mainWindowIsTopmost; 00230 bool m_somePanelIsOpen; 00231 00232 QLabel *m_headerLabel; 00233 00234 QLineEdit *m_filterField; 00235 00236 QPushButton *m_clearTextFilteringButton; 00237 00238 QWidget *m_headerWidget; 00239 00240 FriendListView *m_friendListView; 00241 ImageButton *m_clearGroupFilteringButton; 00242 ImageButton *m_showContactButton; 00243 ImageButton *m_routeButton; 00244 }; 00245 00246 #endif // FRIENDLISTPANEL_H