-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebtextdocument.h
54 lines (37 loc) · 1.08 KB
/
webtextdocument.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
#ifndef WEBTEXTDOCUMENT_H
#define WEBTEXTDOCUMENT_H
#include <QObject>
#include <QTextDocument>
#include <QTextBrowser>
#include <QStack>
class WebTextDocument : public QTextBrowser
{
Q_OBJECT
public:
explicit WebTextDocument(const bool setDefPaths = true, QWidget *parent = 0);
void load(QUrl url);
bool canGoBack();
bool canGoForward();
void setDefaultPaths();
void setSearchPathsExt(const QStringList &paths, const QString &path2html, const QString &filePrefics);
qreal zoomFactor();
QString title();
bool findTextInPage(const QString &text, const bool &caseSensitively, const bool findBackward = false);
signals:
void loadStarted();
void loadFinished(bool);
void loadProgress(int);
void linkActivated(QString link);
public slots:
void back();
void forwardHtml();
void setZoomFactor(qreal zoom);
private:
void loadHtml(QUrl url);
QStack<QUrl> webStackBack, webStackForward;
qreal zoomF, defValZoom;
QString filePath;
QTextDocument textDoc;
QString clickedAnchor;
};
#endif // WEBTEXTDOCUMENT_H