2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@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,
23 #ifndef FRIENDGROUPITEM_H
24 #define FRIENDGROUPITEM_H
28 #include "baselocationitem.h"
30 class FriendLocationItem;
33 * @brief Friend group map item
35 * Contains grouped FriendLocationItem items and draws group image with number of grouped friends
37 * @author Sami Rämö - sami.ramo@ixonos.com
39 class FriendGroupItem : public BaseLocationItem
47 * Create new group, set picture and join first FriendLocationItem to the group.
48 * Group position is set to be exactly same as item given as parameter.
50 * @param item First FriendLocationItem to be joined to new group
52 FriendGroupItem(FriendLocationItem *item);
54 /*******************************************************************************
55 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
56 ******************************************************************************/
61 * Draw amount of joined FriendLocationItem items over the image.
63 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
67 * @brief Mouse move event.
69 * Disables m_clickEvent flag if press and release where not
72 * @param event QGraphicsSceneMouseEvent.
74 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
77 * @brief Mouse press event.
79 * Sets mouse press position.
81 * @param event QGraphicsSceneMouseEvent.
83 void mousePressEvent(QGraphicsSceneMouseEvent *event);
86 * @brief Mouse release event.
88 * Emits friendGroupItemClicked signal if press and release where
91 * @param event QGraphicsSceneMouseEvent.
93 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
95 /*******************************************************************************
96 * MEMBER FUNCTIONS AND SLOTS
97 ******************************************************************************/
100 * @brief Drop all FriendLocationItem items from the group
102 * Dropped items are set to visible again.
107 * @brief Join new FriendLocationItem to this group.
109 * Given item is also hidden.
111 * @param item FriendLocationItem to be joined
113 void joinFriend(FriendLocationItem *item);
115 /*******************************************************************************
117 ******************************************************************************/
120 * @brief Signal is emitted when l item is clicked.
122 * @param userIDs list of friends user IDs in the group
124 void locationItemClicked(const QList<QString> &userIDs);
126 /*******************************************************************************
128 ******************************************************************************/
130 QList<FriendLocationItem *> m_friends; ///< List of joined FriendLocationItem items
131 QPointF m_mousePressPosition; ///< Mouse press position
132 bool m_clickEvent; ///< Mouse click event flag
135 #endif // FRIENDGROUPITEM_H