FriendItemsHandler Class Reference
Handler for friend and friend group items.
More...
#include <frienditemshandler.h>
List of all members.
Detailed Description
Handler for friend and friend group items.
Handles all friend map items. Colliding items and groups are grouped. All items are owned by MapScene.
- Author:
- Sami Rämö - sami.ramo@ixonos.com
-
Ville Tiensuu - ville.tiensuu@ixonos.com
Constructor & Destructor Documentation
FriendItemsHandler::FriendItemsHandler |
( |
MapScene * |
mapScene, |
|
|
QObject * |
parent = 0 | |
|
) |
| | |
Constructor.
- Parameters:
-
| mapScene | MapScene object |
| parent | Parent QObject |
Member Function Documentation
void FriendItemsHandler::addFriendItem |
( |
User * |
friendData |
) |
[private] |
Add new FriendLocationItem.
New FriendLocationItem is created, values are set and item is added to map. Item is also added to m_friendItems list.
- Parameters:
-
| friendData | Data for new friend |
void FriendItemsHandler::checkAllFriendsForCollidingFriends |
( |
|
) |
[private] |
void FriendItemsHandler::checkFriendForCollidingFriends |
( |
FriendLocationItem * |
item |
) |
[private] |
void FriendItemsHandler::cleanOldFriendData |
( |
const QList< User * > & |
friendsList |
) |
[private] |
clean old friend data from m_mapScene and m_friendItems
- Parameters:
-
| friendsList | QList item of friend information |
Check if items collide.
Does check if items sceneTransformedBoundingRect() does intersect. If item1's rect is max half of the rect width from the vertical limits of the map (from inside), then rect is translated to opposite side of the map and intersections are tested there too.
- Parameters:
-
| item1 | First item |
| item2 | Secont item |
- Returns:
- True if collision was found, otherwise false
Delete FriendLocationItem.
Drops item from all groups, removes it from scene and deletes the item.
- Parameters:
-
void FriendItemsHandler::friendImageReady |
( |
User * |
user |
) |
[private, slot] |
Slot updating friend item's profile image.
- Parameters:
-
void FriendItemsHandler::friendListUpdated |
( |
QList< User * > & |
friendsList |
) |
[private, slot] |
Slot for upgrading friend items and groups.
Does add and/or remove FriendLocationItem items if there are new friends or old ones deleted in the given list. Remaining FriensLocationItems are updated.
- Parameters:
-
| friendsList | QList item of friend information |
void FriendItemsHandler::locationItemClicked |
( |
const QList< QString > & |
userIDs |
) |
[signal] |
Signal is emitted when location item is clicked.
- Parameters:
-
| userIDs | list of friends user IDs in the group |
void FriendItemsHandler::refactorFriendItems |
( |
int |
zoomLevel |
) |
[private, slot] |
Update FriendLocationItem data.
Position and image are updated.
- Parameters:
-
| friendItem | Item to be updated |
| friendData | New data for the item |
void FriendItemsHandler::updateFriendItemList |
( |
const QList< User * > & |
friendsList |
) |
[private] |
updates data member m_friendItems from given parameter
- Parameters:
-
| friendsList | QList item of friend information |
void FriendItemsHandler::updateFriendLocationsAndImages |
( |
const QList< User * > & |
friendsList |
) |
[private] |
updates data member m_friendItems values that differs from given parameter
- Parameters:
-
| friendsList | QList item of friend information |
The documentation for this class was generated from the following files: