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.
47 * Sets position to UNDEFINED.
48 * Loads and sets default pixmap that is show on the map.
49 * Sets default Z-value.
50 * Sets offset so that achor of the picture is at the origin. this feature is
51 * needed to center icon on the middle of the location.
52 * Sets item to ignore transformations. this feature is needed to make icon on the map
55 * @param icon Friends Facebook profile picture
56 * @param parent Parent
58 FriendLocationItem(const QPixmap &icon, QObject *parent = 0);
60 /*******************************************************************************
61 * MEMBER FUNCTIONS AND SLOTS
62 ******************************************************************************/
65 * @brief Is item part of any group
67 * @return True if item is part of group, otherwise false.
69 bool isPartOfGroup() const;
72 * @brief getter for friends profile image URL
74 * @return QUrl friends profile images URL
76 QUrl profileImageUrl() const;
79 * @brief sets profile image URL for friend
81 * @param url frieds profile image URL
83 void setProfileImageUrl(const QUrl &url);
86 * @brief Set value for m_partOfGroup flag
88 * @param value New value
90 void setPartOfGroup(bool value);
93 * @brief sets name for friend.
95 * @param userId friends user identity
97 void setUserId(const QString &userId);
100 * @brief getter for m_userId
102 * @return QString friends user identity
104 QString userId() const;
109 * @brief method that detects when friend icon is clicked
111 * @param event detects the mouse click (or touch in Maemo)
113 void mousePressEvent(QGraphicsSceneMouseEvent *event);
115 /*******************************************************************************
117 ******************************************************************************/
121 * @brief signal is emitted when friends icon is clicked on the map
123 * @param m_userId friends user identity
125 void iconClicked(QString m_userId);
127 /*******************************************************************************
129 ******************************************************************************/
131 bool m_partOfGroup; ///< Flag to mark if item is part of any group
132 QString m_userId; ///< Friends user ID
133 QUrl m_profileImageUrl; ///< Friends Facebook profile image URL
136 #endif // FRIENDLOCATIONITEM_H