#include "baselocationitem.h"
+/**
+* @brief Class that shows friends location icons on the map
+*
+* @class FriendLocationItem friendlocationitem.h "map/friendlocationitem.h"
+* @author Ville Tiensuu
+*/
class FriendLocationItem : public BaseLocationItem
{
Q_OBJECT
-public:
+public:
+
+ /**
+ * @brief Constructor of FriendLocationItem.
+ * Sets position to specified location.
+ * Loads and sets default pixmap that is show on the map.
+ * Sets default Z-value.
+ * Sets offset so that achor of the picture is at the origin. this feature is
+ * needed to center icon on the middle of the location.
+ * Sets item to ignore transformations. this feature is needed to make icon on the map
+ * immune to scaling
+ *
+ * @param icon friends Facebook profile picture, friendsLocation Position in QPoinF, parent
+ */
FriendLocationItem(const QPixmap &icon, const QPointF &friendsLocation, QObject *parent = 0);
+
+ /**
+ * @brief sets friends Facebook profile picture that is show on the map.
+ *
+ * @param icon friends Facebook profile picture
+ */
void setIcon(const QPixmap &icon);
+
+ /**
+ * @brief sets name for friend.
+ *
+ * @param name friends name
+ */
void setName(const QString &name);
signals:
+
+ /**
+ * @brief signal is emitted when friends icon is clicked on the map
+ *
+ * @param name friends name
+ */
void iconClicked(QString name);
protected:
+
+ /**
+ * @brief method that detects when friend icon is clicked
+ *
+ * @param event detects the mouse click (same as touch in maemo)
+ */
void mousePressEvent(QGraphicsSceneMouseEvent *event);
private:
- QString *m_name;
+ QString *m_name; ///< Friends name
};
#endif // FRIENDLOCATIONITEM_H
/**
* @brief Constructor of OwnLocationItem.
- * Sets position to default location.
+ * Sets position to specified location.
* Loads and sets default pixmap that is show on the map.
* Sets default Z-value.
* Sets offset so that achor of the picture is at the origin. this feature is
const QPointF testLocationPoint(65.525, 25.345);
const QPointF defaultLocationPoint(DEFAULT_LONGITUDE,DEFAULT_LATITUDE);
const QPointF locationIconOffset(-MAP_OWN_LOCATION_ICON_SIZE/2, -MAP_OWN_LOCATION_ICON_SIZE/2);
- const int itemIgnoresTransformationsFlagValue = 0x20;
+ const int itemIgnoresTransformationsFlagValue = 0x20;
}
using namespace TestOwnLocation;
/**
* @brief Test method for constructors.
- * Creates instance of OwnLocationItem using three different constructors and tests
- * that positions are set correctly.
+ * Tests that positions are set correctly.
* Tests that Z-values are set correctly.
* Tests that offses are set correctly.
* Tests that ItemIgnoresTransformations flag is set.
* @brief Creates instance of OwnLocationItem.
* Sets test position for location item in geographic coordinates.
* Reads position from location item in scene coordinates and
- * verifies that it correctly formed.
+ * verifies that it is correctly formed.
*/
void testSetAndGetPosition();