added base class for own and friend locations. added new class for
[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 class BaseLocationItem : public QGraphicsPixmapItem, public QObject
30 {    
31
32 public:
33     BaseLocationItem(QObject *parent = 0);
34
35     /*******************************************************************************
36     * MEMBER FUNCTIONS AND SLOTS
37     ******************************************************************************/
38     public:
39
40     /**
41     * @brief Hides item so that it is invisible on the map
42     *
43     */
44     void hideLocation();
45
46     /**
47     * @brief returns position of item in scene coordinates.
48     *
49     * @return QPoint position of OwnLocationItem
50     */
51     QPoint position() const;
52
53     /**
54     * @brief sets position of item as specified in parameter.
55     *        Parameter can be given in georaphical coordinates
56     *
57     * @param newPosition Parameter that specifies new position.
58     */
59     void setPosition(const QPointF & newPosition);
60
61     /**
62     * @brief Sets item to be visible on the map.
63     *        Item is visible by default, function is needed only when own location
64     *        needs to be set back visible after hideLocation function call.
65     */
66     void showLocation();
67 };
68
69
70 #endif // BASELOCATIONITEM_H