File indexing completed on 2024-05-12 16:28:28

0001 /* This file is part of the KDE project
0002    Copyright (C) 2010 KO GmbH <jos.van.den.oever@kogmbh.com>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 #ifndef SLIDEVIEW_H
0020 #define SLIDEVIEW_H
0021 
0022 #include <QWidget>
0023 #include <QProgressBar>
0024 #include <QGraphicsView>
0025 #include <QGraphicsScene>
0026 
0027 class SlideLoader;
0028 class GraphicsSlideItem;
0029 
0030 class SlideView : public QWidget {
0031 friend class GraphicsSlideItem;
0032 private:
0033     Q_OBJECT
0034     class SlideGraphicsScene : public QGraphicsScene {
0035     public:
0036         void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
0037     };
0038     QGraphicsView view;
0039     SlideGraphicsScene scene;
0040     QProgressBar progressBar;
0041     SlideLoader* loader;
0042     qreal zoomfactor;
0043     bool sendingChange;
0044 
0045     void layout();
0046     bool eventFilter(QObject *obj, QEvent *event);
0047     void toggleSlideZoom(const GraphicsSlideItem* slide);
0048 private Q_SLOTS:
0049     void slotUpdateSlides();
0050     void slotViewChanged();
0051 public:
0052     explicit SlideView(SlideLoader* loader, QWidget* parent = 0);
0053 public Q_SLOTS:
0054     void setView(qreal zoomFactor, int h, int v);
0055 Q_SIGNALS:
0056     void viewChanged(qreal zoomFactor, int h, int v);
0057 };
0058 
0059 #endif