Cleanup
[situare] / src / map / mapscroller.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Sami Rämö - sami.ramo@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
23 #ifndef MAPSCROLLER_H
24 #define MAPSCROLLER_H
25
26 #include <QPoint>
27 #include <QVariantAnimation>
28
29 /**
30 * @brief Map scroller
31 *
32 * Used for kinetic and smooth scroll effects. Class implementation is following the singleton
33 * desing pattern.
34 *
35 * @author Sami Rämö - sami.ramo@ixonos.com
36 */
37 class MapScroller : public QVariantAnimation
38 {
39     Q_OBJECT
40
41 private:
42     /**
43     * @brief Constructor in not accessible because class is using singleton design pattern.
44     */
45     MapScroller();
46
47     /**
48     * @brief Destructor in not accessible because class is using singleton design pattern.
49     */
50     ~MapScroller() {}
51
52     /**
53     * @brief Copy constructor in not accessible because class is using singleton design pattern.
54     */
55     MapScroller(const MapScroller &);
56
57     /**
58     * @brief Assignment operator in not accessible because class is using singleton design pattern.
59     */
60     MapScroller & operator=(const MapScroller &);
61
62 /*******************************************************************************
63  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
64  ******************************************************************************/
65 private:
66     /**
67     * @brief Reimplemented from QVariantAnimation::updateCurrentValue()
68     *
69     * Called every time the animation's current value changes
70     *
71     * @param value New value
72     */
73     void updateCurrentValue(const QVariant &value);
74
75 /*******************************************************************************
76  * MEMBER FUNCTIONS AND SLOTS
77  ******************************************************************************/
78 public:
79     /**
80     * @brief Get reference to instance of this class
81     *
82     * @return reference to instance of this class
83     */
84     static MapScroller &getInstance();
85
86 /*******************************************************************************
87  * SIGNALS
88  ******************************************************************************/
89 signals:
90     /**
91     * @brief Signal if emitted when coordinate value is updated
92     *
93     * @param coordinate New coordinate value
94     */
95     void coordinateUpdated(QPoint coordinate);
96 };
97
98 #endif // MAPSCROLLER_H