Set application metadata
[Skavegra.git] / svgviewer.h
blob0a01364aa4146901533b6774320bce96ed238414
1 #ifndef SVGVIEWER_H
2 #define SVGVIEWER_H
4 #include <QSvgRenderer>
5 #include <QGraphicsView>
6 #include <QGraphicsSvgItem>
7 #include <QWheelEvent>
8 #include <QMessageBox>
9 #include <QXmlStreamReader>
10 #include <qmath.h>
12 class SVGViewer : public QGraphicsView {
13 Q_OBJECT
15 public:
16 SVGViewer(QWidget *parent = 0);
17 bool getZoomAndPan();
18 bool getAnim();
19 QString getTitle();
20 QString getDesc();
21 QSize getImageSize();
23 public slots:
24 bool openFile(QString fileName);
25 void closeFile();
26 void zoomIn();
27 void zoomOut();
28 void zoomReset();
29 void zoomSet(qreal factor);
31 protected:
32 void paintEvent(QPaintEvent* event);
33 #ifndef QT_NO_WHEELEVENT
34 void wheelEvent(QWheelEvent* event);
35 #endif
37 private slots:
38 void zoomChange(qreal factor);
40 private:
41 QGraphicsSvgItem* svgItem;
42 QSvgRenderer* svgRenderer;
43 bool zoomAndPan;
44 QString title;
45 QString desc;
47 QString SVGPreserveWhitespace(QString text);
48 QString SVGRemoveWhitespace(QString text);
49 QString SVGReadText(QXmlStreamReader* reader, bool keepWhitespace);
53 #endif // SVGVIEWER_H