forked from mercutiodesign/texmaker-3.3.3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdfdocumentwidget.h
67 lines (60 loc) · 1.83 KB
/
pdfdocumentwidget.h
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
/****************************************************************************
**
** copyright : (C) 2003-2011 by Pascal Brachet
** http://www.xm1math.net/texmaker/
**
** addons by Adrián Yanes Martínez
** Parts of this file come from the documentation of Qt. It was originally
** published as part of Qt Quarterly.
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information ([email protected])
**
**
****************************************************************************/
#ifndef PDFDOCUMENTWIDGET_H
#define PDFDOCUMENTWIDGET_H
#include <QLabel>
#include <QRectF>
#include <QPainterPath>
#include <QTimer>
#include "poppler-qt4.h"
class PdfDocumentWidget : public QLabel {
Q_OBJECT
public:
PdfDocumentWidget(QWidget *parent = 0, int page=0,Poppler::Page *dp=0 );
~PdfDocumentWidget();
Poppler::Page *doc_page;
QMatrix matrix() const;
qreal scale() const;
int numPage;
public slots:
void updatePixmap();
void createblankPixmap(int w, int h);
void setScale(qreal scale);
void changeScale(qreal scale);
void setHighlightPath(const QPainterPath& path);
void setSearchPath(const QPainterPath& path);
void clearHighlight();
void clearPaths();
protected:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
signals:
void syncpage(int, const QPointF&);
void gotoDest(int,int,int);
void updateDone(int);
void pressOnPoint(QPoint p);
void moveOnPoint(QPoint p);
private slots:
void jumpToSourceFromPdf();
private:
Poppler::Link *currentLink;
int currentPage;
qreal scaleFactor;
QPainterPath highlightPath, searchPath;
QTimer highlightRemover;
bool handmode;
};
#endif