Sorted src.pro file, added new signals/slots for showing/opening panels/tabs
[situare] / src / ui / friendlistpanel.h
index b280799..5b7f3bc 100644 (file)
@@ -1,8 +1,10 @@
- /*
+/*
     Situare - A location system for Facebook
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Kaj Wallin - kaj.wallin@ixonos.com
+        Henri Lampela - henri.lampela@ixonos.com
+        Pekka Nissinen - pekka.nissinen@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
     along with Situare; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
     USA.
- */
+*/
 
 #ifndef FRIENDLISTPANEL_H
 #define FRIENDLISTPANEL_H
 
-#include <QtGui>
+#include <QWidget>
+
+class QLabel;
+class QPushButton;
 
-class FriendListView;
+class FriendListItemDelegate;
+class GeoCoordinate;
+class ListView;
 class User;
 
 /**
-* @brief Class for sliding friends list panel
-*
-* @author Kaj Wallin - kaj.wallin (at) ixonos.com
-* @class FriendListPanel friendlistpanel.h "ui/friendlistpanel.h"
-*/
+ * @brief Class for sliding friends list panel
+ *
+ * @author Kaj Wallin - kaj.wallin (at) ixonos.com
+ * @author Henri Lampela - henri.lampela (at) ixonos.com
+ * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
+ */
 class FriendListPanel : public QWidget
 {
     Q_OBJECT
 
 public:
     /**
-    * @brief Default constructor
-    *
-    * @param parent
-    */
+     * @brief Default constructor
+     *
+     * @param parent
+     */
     FriendListPanel(QWidget *parent = 0);
 
-
-/*******************************************************************************
-* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
-******************************************************************************/
-protected:
-    /**
-    * @brief Draws stylesheet used in this class.
-    *
-    * @param * QPaintEvent unused
-    */
-    void paintEvent(QPaintEvent *);
-
-    void mouseReleaseEvent(QMouseEvent *);
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
     /**
-    * @brief Slot to refresh friends list
-    *
-    * @param friendList
-    */
-    void friendInfoReceived(QList<User *> &friendList);
+     * @brief Slot to update friend item's image
+     *
+     * @param user Friend
+     */
+    void friendImageReady(User *user);
 
     /**
-    * @brief Slot to redraw the panel after window resize event
-    *
-    * @param width Width of the window after resize
-    * @param height Height of the window after resize
-    */
-    void reDrawFriendsPanel(int width, int height);
+     * @brief Slot to refresh friends list
+     *
+     * @param friendList
+     */
+    void friendInfoReceived(QList<User *> &friendList);
 
+private slots:
+    /**
+     * @brief Slot to clear friend list filter
+     */
+    void clearFriendListFilter();
 
+    /**
+     * @brief Slot to show friends in list
+     *
+     * Shows only friends that are on userIDs list
+     * @param userIDs list of user ID's
+     */
+    void showFriendsInList(const QList<QString> &userIDs);
 
+/*******************************************************************************
+ * SIGNALS
+ ******************************************************************************/
 signals:
-    void clicked();
+    /**
+     * @brief Signal for friend finding
+     *
+     * @param coordinates Target coordinate
+     */
+    void findFriend(const GeoCoordinate &coordinates);
+
+    /**
+     * @brief Signal for requesting a panel to be opened
+     *
+     * @param widget Pointer to the widget that emitted the signal
+     */
+    void showPanelRequested(QWidget *widget);
 
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    FriendListView *m_friendListView; ///< Friend list view
+    QLabel *m_friendListLabel;          ///< Friend list label
+
+    QPushButton *m_clearFilterButton;   ///< Button to clear list filtering
 
-    QVBoxLayout *m_friendsPanelVBox; ///< Vertical layout inside the panel
-    QPushButton *m_friendsPanelExpandButton; ///< PushButton used to expand the panel
-    QWidget *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
+    QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
 
-    QStateMachine *m_friendsPanelStateMachine; ///< State machine for sliding the panel
-    QState *m_friendsPanelStateClosed; ///< State of the closed panel
-    QState *m_friendsPanelStateOpened; ///< State of the opened panel
-    QSignalTransition *m_friendsPanelTransitionClose; ///< Transition signal for closing the panel
-    QSignalTransition *m_friendsPanelTransitionOpen; ///< Transition signal for opening the panel
+    FriendListItemDelegate *m_friendListItemDelegate;   ///< Friend list item delegate
+    ListView *m_friendListView;                         ///< Friend list view
 };
 
 #endif // FRIENDLISTPANEL_H