Fixed review defects
[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 /**
30   * @brief Baseclass for showing own and friends locations on the map.
31   *
32   * @author Ville Tiensuu - ville.tiensuu@ixonos.com
33   * @author Sami Rämö - sami.ramo@ixonos.com
34   */
35 class BaseLocationItem : public QGraphicsPixmapItem, public QObject
36 {    
37 public:
38     /**
39     * @brief Constructor of BaseLocationItem.
40     *        Sets parent.
41     *
42     * @param parent
43     */
44     BaseLocationItem(QObject *parent = 0);
45
46 /*******************************************************************************
47  * MEMBER FUNCTIONS AND SLOTS
48  ******************************************************************************/
49 public:
50     /**
51       *@brief Return item sceneBoundingRect transformed to given zoom level
52       *
53       * Because of using ItemIgnoresTransformations, and not scaling the item, the default
54       * sceneBoundingRect does always return the lowest map tile level scene bounding rect which
55       * must be scaled to current zoom level.
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