00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Ville Tiensuu - ville.tiensuu@ixonos.com 00006 Sami Rämö - sami.ramo@ixonos.com 00007 00008 Situare is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 version 2 as published by the Free Software Foundation. 00011 00012 Situare is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Situare; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 USA. 00021 */ 00022 00023 #ifndef FRIENDLOCATIONITEM_H 00024 #define FRIENDLOCATIONITEM_H 00025 00026 00027 #include <QObject> 00028 #include <QUrl> 00029 #include <QPixmap> 00030 #include <QPainter> 00031 00032 #include "baselocationitem.h" 00033 00041 class FriendLocationItem : public BaseLocationItem 00042 { 00043 Q_OBJECT 00044 00045 public: 00058 FriendLocationItem(const QString &userId, QObject *parent = 0); 00059 00060 /******************************************************************************* 00061 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00062 ******************************************************************************/ 00063 public: 00073 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 00074 00075 /******************************************************************************* 00076 * MEMBER FUNCTIONS AND SLOTS 00077 ******************************************************************************/ 00078 public: 00084 bool isPartOfGroup() const; 00085 00091 QUrl profileImageUrl() const; 00092 00101 void setProfileImage(const QPixmap image, const QUrl &url); 00102 00108 void setPartOfGroup(bool value); 00109 00115 QString userId() const; 00116 00117 protected: 00126 void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 00127 00133 void mousePressEvent(QGraphicsSceneMouseEvent *event); 00134 00140 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 00141 00142 /******************************************************************************* 00143 * SIGNALS 00144 ******************************************************************************/ 00145 signals: 00151 void locationItemClicked(const QList<QString> &userIDs); 00152 00153 /******************************************************************************* 00154 * DATA MEMBERS 00155 ******************************************************************************/ 00156 private: 00157 bool m_partOfGroup; 00158 const QString m_userId; 00159 QUrl m_profileImageUrl; 00160 QPointF m_mousePressPosition; 00161 bool m_clickEvent; 00162 }; 00163 00164 #endif // FRIENDLOCATIONITEM_H