digiKam
showfotokineticscroller.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2014-02-01
7  * Description : Kinetic Scroller for Thumbnail Bar
8  * based on Razvan Petru implementation.
9  *
10  * Copyright (C) 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef SHOW_FOTO_KINETIC_SCROLLER_H
26 #define SHOW_FOTO_KINETIC_SCROLLER_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QScopedPointer>
32 #include <QAbstractScrollArea>
33 #include <QListView>
34 
35 namespace ShowFoto
36 {
37 
42 class ShowfotoKineticScroller: public QObject
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit ShowfotoKineticScroller(QObject* const parent = nullptr);
49  ~ShowfotoKineticScroller() override;
50 
54  void enableKineticScrollFor(QAbstractScrollArea* const scrollArea);
55  void setScrollFlow(QListView::Flow flow);
56 
57 protected:
58 
59  bool eventFilter(QObject* object, QEvent* event) override;
60 
61 private Q_SLOTS:
62 
63  void onKineticTimerElapsed();
64 
65 private:
66 
67  class Private;
68  Private* const d;
69 };
70 
71 } // namespace ShowFoto
72 
73 #endif // SHOW_FOTO_KINETIC_SCROLLER_H
Definition: showfotokineticscroller.h:43
ShowfotoKineticScroller(QObject *const parent=nullptr)
Definition: showfotokineticscroller.cpp:104
void enableKineticScrollFor(QAbstractScrollArea *const scrollArea)
Definition: showfotokineticscroller.cpp:117
bool eventFilter(QObject *object, QEvent *event) override
intercepts mouse events to make the scrolling work
Definition: showfotokineticscroller.cpp:142
void setScrollFlow(QListView::Flow flow)
Definition: showfotokineticscroller.cpp:326
~ShowfotoKineticScroller() override
Definition: showfotokineticscroller.cpp:112
Definition: showfotofolderviewbar.cpp:52