2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@ixonos.com
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.
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.
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,
26 #include <QVariantAnimation>
28 #include "coordinates/scenecoordinate.h"
33 * Used for kinetic and smooth scroll effects. Class implementation is following the singleton
36 * Use QPointF datatype for startValue and endValue. Emitted datatype is SceneCoordinate.
38 * @author Sami Rämö - sami.ramo@ixonos.com
40 class MapScroller : public QVariantAnimation
46 * @brief Constructor in not accessible because class is using singleton design pattern.
51 * @brief Destructor in not accessible because class is using singleton design pattern.
56 * @brief Copy constructor in not accessible because class is using singleton design pattern.
58 MapScroller(const MapScroller &);
61 * @brief Assignment operator in not accessible because class is using singleton design pattern.
63 MapScroller & operator=(const MapScroller &);
65 /*******************************************************************************
66 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
67 ******************************************************************************/
70 * @brief Reimplemented from QVariantAnimation::updateCurrentValue()
72 * Called every time the animation's current value changes. Does emit coordinateUpdated() signal
73 * if animation is in the running state.
75 * @param value New value
77 void updateCurrentValue(const QVariant &value);
79 /*******************************************************************************
80 * MEMBER FUNCTIONS AND SLOTS
81 ******************************************************************************/
84 * @brief Get reference to instance of this class
86 * Also registers the custom SceneCoordinate interpolator method.
88 * @return reference to instance of this class
90 static MapScroller &getInstance();
93 * @brief Set flag for kinetic scroll
95 * @param isKineticScroll Set to true if starting a kinetic scroll
97 void setKineticScrollFlag(bool isKineticScroll);
99 /*******************************************************************************
101 ******************************************************************************/
104 * @brief Signal if emitted when coordinate value is updated
106 * @param coordinate New coordinate value
107 * @param isKineticScroll True if currently running a kinetic scroll animation
109 void coordinateUpdated(SceneCoordinate coordinate, bool isKineticScroll);
111 /*******************************************************************************
113 ******************************************************************************/
115 bool m_isKineticScroll; ///< Is the current animation a kinetic scroll animation?
118 #endif // MAPSCROLLER_H