Updated tests cases matching the new tabs
[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        Sami Rämö - sami.ramo@ixonos.com
7
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.
11
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.
16
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,
20    USA.
21 */
22
23 #ifndef BASELOCATIONITEM_H
24 #define BASELOCATIONITEM_H
25
26 #include <QGraphicsPixmapItem>
27
28 /**
29  * @brief Baseclass for showing own and friends locations on the map.
30  *
31  * @author Ville Tiensuu - ville.tiensuu@ixonos.com
32  * @author Sami Rämö - sami.ramo@ixonos.com
33  */
34 class BaseLocationItem : public QGraphicsPixmapItem, public QObject
35 {
36 public:
37     /**
38      * @brief Constructor of BaseLocationItem.
39      *        Sets parent.
40      *
41      * @param parent
42      */
43     BaseLocationItem(QObject *parent = 0);
44
45 /*******************************************************************************
46  * MEMBER FUNCTIONS AND SLOTS
47  ******************************************************************************/
48 public:
49     /**
50      * @brief Return item rect transformed to given zoom level
51      *
52      * Because of using ItemIgnoresTransformations, and not scaling the item, the default
53      * sceneBoundingRect can't be used because it always returns the lowest map tile level scene
54      * bounding rect. This method does return rect scaled to given zoom level. Rect's center
55      * point is also normalized to be inside the map.
56      *
57      * @param zoomLevel Zoom level for which the sceneBoundingRect should be transformed
58      * @return sceneBoundingRect transformed to given zoom level
59      */
60     QRect sceneTransformedBoundingRect(int zoomLevel) const;
61 };
62
63
64 #endif // BASELOCATIONITEM_H