1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/*
* gafio.h
* © Yves Ouvrard (Collatinus), 2010
* =======================================================================
This file is part of Felix 34.
Felix 34 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Felix 34 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Felix 34. If not, see <http://www.gnu.org/licenses/>.
* =======================================================================
*/
#ifndef GAFIO_H
#define GAFIO_H
#include <QObject>
#include <QMainWindow>
#include <QScrollArea>
class QAction;
class QLineEdit;
class QFont;
class QLabel;
class QScrollArea;
class QScrollBar;
class QVBoxLayout;
class QHBoxLayout;
class QPushButton;
class Gxxxiv;
class zScrollArea : public QScrollArea{
//zoomable scrollarea
Q_OBJECT
public:
zScrollArea(Gxxxiv * mainWindow);
protected:
Gxxxiv * mainWindow;
void wheelEvent (QWheelEvent *event);
};
class Gxxxiv : public QMainWindow
{
Q_OBJECT
friend class zScrollArea;
public:
Gxxxiv();
private:
QString message;
QStringList historique;
int folio;
int pHist;
private slots:
void about();
void aide ();
void bas ();
void descend ();
void droite ();
void gauche ();
void haut ();
void hauteur ();
void lCachee ();
void lVisible ();
void largeur ();
void monte ();
void page(int n);
void pPrec ();
void pSuiv ();
void page_bas ();
void page_haut ();
void returnPressed ();
protected slots:
void zoomIn ();
void zoomOut ();
private:
void scaleImage();
void adjustScrollBar(QScrollBar *scrollBar, double factor);
QWidget *commandes;
QLineEdit *lSaisie;
QFont *fonte;
QHBoxLayout *horizontalLayout;
QPushButton *bCh;
QPushButton *bPrec;
QPushButton *bSuiv;
QPushButton *fleche;
QLabel *imageLabel;
zScrollArea *scrollArea;
QPixmap pix;
QVBoxLayout *layout;
QPoint lastPos;
double scaleFactor;
protected:
void keyPressEvent (QKeyEvent *event);
void mousePressEvent (QMouseEvent * event);
void mouseMoveEvent (QMouseEvent * event);
};
#endif
|