QsKineticScroller.hpp

Go to the documentation of this file.
00001 // Copyright (c) 2010, Razvan Petru
00002 // All rights reserved.
00003 
00004 // Redistribution and use in source and binary forms, with or without modification,
00005 // are permitted provided that the following conditions are met:
00006 
00007 // * Redistributions of source code must retain the above copyright notice, this
00008 //   list of conditions and the following disclaimer.
00009 // * Redistributions in binary form must reproduce the above copyright notice, this
00010 //   list of conditions and the following disclaimer in the documentation and/or other
00011 //   materials provided with the distribution.
00012 // * The name of the contributors may not be used to endorse or promote products
00013 //   derived from this software without specific prior written permission.
00014 
00015 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00016 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00018 // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00019 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00020 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00021 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00022 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
00023 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00024 // OF THE POSSIBILITY OF SUCH DAMAGE.
00025 
00026 #ifndef QSKINETICSCROLLER_H
00027 #define QSKINETICSCROLLER_H
00028 
00029 #include <QObject>
00030 #include <QScopedPointer>
00031 class QsKineticScrollerImpl;
00032 class QAbstractScrollArea;
00033 class QEvent;
00034 
00035 //! Vertical kinetic scroller implementation without overshoot and bouncing.
00036 //! A temporary solution to get kinetic-like scrolling on Symbian.
00037 class QsKineticScroller: public QObject
00038 {
00039    Q_OBJECT
00040 public:
00041    QsKineticScroller(QObject* parent = 0);
00042    ~QsKineticScroller();
00043    //! enabled for one widget only, new calls remove previous association
00044    void enableKineticScrollFor(QAbstractScrollArea* scrollArea);
00045 
00046 protected:
00047    bool eventFilter(QObject* object, QEvent* event);
00048 
00049 private slots:
00050    void onKineticTimerElapsed();
00051 
00052 private:
00053    QScopedPointer<QsKineticScrollerImpl> d;
00054 };
00055 
00056 #endif // QSKINETICSCROLLER_H

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:56 2011 by Doxygen 1.6.1