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