00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Sami Rämö - sami.ramo@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 00023 #ifndef FRIENDGROUPITEM_H 00024 #define FRIENDGROUPITEM_H 00025 00026 #include <QList> 00027 00028 #include "baselocationitem.h" 00029 00030 class FriendLocationItem; 00031 00039 class FriendGroupItem : public BaseLocationItem 00040 { 00041 Q_OBJECT 00042 00043 public: 00052 FriendGroupItem(FriendLocationItem *item); 00053 00054 /******************************************************************************* 00055 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00056 ******************************************************************************/ 00062 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 00063 00064 protected: 00073 void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 00074 00082 void mousePressEvent(QGraphicsSceneMouseEvent *event); 00083 00092 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 00093 00094 /******************************************************************************* 00095 * MEMBER FUNCTIONS AND SLOTS 00096 ******************************************************************************/ 00097 public: 00104 bool dropFriends(int zoomLevel); 00105 00111 void dropFriend(FriendLocationItem *item); 00112 00120 void joinFriend(FriendLocationItem *item); 00121 00130 void mergeWithGroup(FriendGroupItem *group); 00131 00132 /******************************************************************************* 00133 * SIGNALS 00134 ******************************************************************************/ 00135 signals: 00141 void locationItemClicked(const QList<QString> &userIDs); 00142 00143 /******************************************************************************* 00144 * DATA MEMBERS 00145 ******************************************************************************/ 00146 private: 00147 QList<FriendLocationItem *> m_friends; 00148 QPoint m_mousePressPosition; 00149 bool m_clickEvent; 00150 }; 00151 00152 #endif // FRIENDGROUPITEM_H