2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Ville Tiensuu - ville.tiensuu@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 OWNLOCATIONITEM_H
24 #define OWNLOCATIONITEM_H
26 #include <QGraphicsPixmapItem>
29 * @brief Class that shows own location icon on the map
31 * @class OwnLocationItem ownlocationitem.h "map/ownlocationitem.h"
32 * @author Ville Tiensuu
34 class OwnLocationItem : public QGraphicsPixmapItem
38 * @brief Default constructor of OwnLocationItem.
39 * Sets position to default location.
40 * Loads and sets default pixmap that is show on the map.
41 * Sets default Z-value to show icon on top of maps but under zoom buttons.
42 * Sets offset so that achor of the picture is at the origin. this feature is
43 * needed to center icon on the middle of the location.
44 * Sets item to ignore transformations. this feature is needed to make icon on the map
50 * @brief Overloaded constructor for OwnLocationItem.
51 * Otherwise same as default constructor, but position is set according to parameters.
53 * @param longitude Longitude coordinate of position.
54 * @param latitude Latitude coordinate of position.
56 OwnLocationItem(const qreal & longitude, const qreal & latitude);
59 * @brief Overloaded constructor for OwnLocationItem.
60 * Otherwise same as default constructor, but position is set according to parameter.
62 * @param ownPosition Position in QPoinF format
64 OwnLocationItem(const QPointF & ownPosition);
66 /*******************************************************************************
67 * MEMBER FUNCTIONS AND SLOTS
68 ******************************************************************************/
72 * @brief Hides OwnLocationItem so that it is invisible on the map
75 void hideOwnLocation();
78 * @brief returns position of OwnLocationItem
80 * @return QPoint position of OwnLocationItem
82 QPoint position() const;
85 * @brief sets position of OwnLocationItem as specified in parameter.
86 * Position defines where icon is show on the map.
88 * @param newPosition Parameter that specifies new position.
90 void setPosition(const QPointF & newPosition);
93 * @brief Sets OwnLocationItem to be visible on the map.
94 * OwnLocationImte is visible by default, function is needed only when own location
95 * needs to be set back visible after hideOwnLocation function call.
97 void showOwnLocation();
100 #endif // OWNLOCATIONITEM_H