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
45 * Create new group, set picture and join first FriendLocationItem to the group.
46 * Group position is set to be exactly same as item given as parameter.
48 * @param item First FriendLocationItem to be joined to new group
50 FriendGroupItem(FriendLocationItem *item);
52 /*******************************************************************************
53 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
54 ******************************************************************************/
58 * Draw amount of joined FriendLocationItem items over the image.
60 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
62 /*******************************************************************************
63 * MEMBER FUNCTIONS AND SLOTS
64 ******************************************************************************/
67 * @brief Drop all FriendLocationItem items which bounding rect is not colliding with
70 * Dropped items are set to visible again.
72 bool dropFriends(int zoomLevel);
75 * @brief Join new FriendLocationItem to this group.
77 * Given item is also hidden.
79 * @param item FriendLocationItem to be joined
81 void joinFriend(FriendLocationItem *item);
84 * @brief Merge this group to another FriendGroupItem
86 * Removes all FrienLocationItem items from this group and joins then to given group.
87 * Group item is not deleted, so caller must delete group after merging.
89 * @param group FriendGroupItem which takes all this group FriendLocationItem items
91 void mergeWithGroup(FriendGroupItem *group);
95 * @brief Drop single FriendLocationItem from this group
97 * @param item FriendLocationItem to be dropped
99 void dropFriend(FriendLocationItem *item);
102 QList<FriendLocationItem *> m_friends; ///< List of joined FriendLocationItem items
105 #endif // FRIENDGROUPITEM_H