9e9354fd12dd44fd5dfda49397649b71d888fc07
[situare] / src / map / baselocationitem.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Ville Tiensuu - ville.tiensuu@ixonos.com
6
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.
10
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.
15
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,
19    USA.
20 */
21
22 #ifndef BASELOCATIONITEM_H
23 #define BASELOCATIONITEM_H
24
25 #include <QGraphicsPixmapItem>
26
27
28 /**
29 * @brief Baseclass for showing own and friends locations on the map.
30 *        This class is abstract
31 *
32 * @class BaseLocationItem baselocationitem.h "map/baselocationitem.h"
33 * @author Ville Tiensuu
34 */
35 class BaseLocationItem : public QGraphicsPixmapItem, public QObject
36 {    
37
38 public:
39
40     /**
41     * @brief Constructor of BaseLocationItem.
42     *        Sets parent.
43     *
44     * @param parent
45     */
46     BaseLocationItem(QObject *parent = 0);
47
48     /*******************************************************************************
49     * MEMBER FUNCTIONS AND SLOTS
50     ******************************************************************************/
51     public:
52
53     /**
54     * @brief Hides item so that it is invisible on the map
55     *
56     */
57     void hideLocation();
58
59     /**
60     * @brief returns position of item in scene coordinates.
61     *
62     * @return QPoint position of OwnLocationItem
63     */
64     QPoint position() const;
65
66     /**
67     * @brief sets position of item as specified in parameter.
68     *        Parameter can be given in georaphical coordinates
69     *
70     * @param newPosition Parameter that specifies new position.
71     */
72     void setPosition(const QPointF & newPosition);
73
74     /**
75     * @brief Sets item to be visible on the map.
76     *        Item is visible by default, function is needed only when own location
77     *        needs to be set back visible after hideLocation function call.
78     */
79     void showLocation();
80 };
81
82
83 #endif // BASELOCATIONITEM_H