2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Ville Tiensuu - ville.tiensuu@ixonos.com
6 Sami Rämö - sami.ramo@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
23 #ifndef FRIENDLOCATIONITEM_H
24 #define FRIENDLOCATIONITEM_H
30 #include "baselocationitem.h"
33 * @brief Class that shows friends location icons on the map
35 * @class FriendLocationItem friendlocationitem.h "map/friendlocationitem.h"
36 * @author Ville Tiensuu.
37 * @author Sami Rämö - sami.ramo@ixonos.com
39 class FriendLocationItem : public BaseLocationItem
46 * @brief Constructor of FriendLocationItem
49 * Sets position to UNDEFINED.
50 * Sets default Z-value.
51 * Sets item to ignore transformations. this feature is needed to make icon on the map
54 * @param userId Used ID of the friend
55 * @param parent Parent
57 FriendLocationItem(const QString &userId, QObject *parent = 0);
59 /*******************************************************************************
60 * MEMBER FUNCTIONS AND SLOTS
61 ******************************************************************************/
64 * @brief Is item part of any group
66 * @return True if item is part of group, otherwise false.
68 bool isPartOfGroup() const;
71 * @brief getter for friends profile image URL
73 * @return QUrl friends profile images URL
75 QUrl profileImageUrl() const;
78 * @brief Set profile image and it's URL for friend
80 * Also offset is set matching new image dimensions.
82 * @param image New profile image
83 * @param url URL of the new profile image
85 void setProfileImage(const QPixmap image, const QUrl &url);
88 * @brief Set value for m_partOfGroup flag
90 * @param value New value
92 void setPartOfGroup(bool value);
95 * @brief getter for m_userId
97 * @return QString friends user identity
99 QString userId() const;
103 * @brief method that detects when friend icon is clicked
105 * @param event detects the mouse click (or touch in Maemo)
107 void mousePressEvent(QGraphicsSceneMouseEvent *event);
110 * @brief method that detects when friend icon press is released
112 * @param event detects the mouse release event (or touch in Maemo)
114 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
116 /*******************************************************************************
118 ******************************************************************************/
121 * @brief Signal is emitted when l item is clicked.
123 * @param userIDs list of friends user IDs in the group
125 void locationItemClicked(const QList<QString> &userIDs);
127 /*******************************************************************************
129 ******************************************************************************/
131 bool m_partOfGroup; ///< Flag to mark if item is part of any group
132 const QString m_userId; ///< Friends user ID. Can't be changed afterwards
133 QUrl m_profileImageUrl; ///< Friends Facebook profile image URL
134 QPoint m_mousePressPosition; ///< Mouse press position
137 #endif // FRIENDLOCATIONITEM_H