-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScrollingImageList.h
102 lines (73 loc) · 2.27 KB
/
ScrollingImageList.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
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
#ifndef SCROLLINGIMAGELIST_H
#define SCROLLINGIMAGELIST_H
#include <QObject>
#include <QScrollArea>
#include "ui_Window.h"
#include "ImageWidget.h"
#include "Document.h"
class ScrollingImageList : public QObject
{
Q_OBJECT
public:
explicit ScrollingImageList(QObject *parent = 0);
QScrollArea *scrollArea() const;
void setScrollArea(QScrollArea *scrollArea);
void show();
void hide();
Document *document() const {return m_document;}
void setDocument(Document *document) {m_document = document;}
void hilightImage(int nImage);
void goToPage (int nPage, bool evenIfVisible=false);
virtual void zoom (double scale);
void annot (bool showAnnotations);
void links (bool showLinks);
void buildImages();
void setScale(double scale) {m_scale=scale;}
virtual double getScale();
virtual bool thumbnails() {return false;}
bool eventFilter(QObject *target, QEvent *event);
void reRender();
void reRender(int nPage);
void cleanup();
virtual void onScrollChange() {}
virtual void onSliderReleased() {}
virtual void onMouseEnter() {}
virtual void onMouseLeave() {}
QScrollArea *getScrollArea() {return m_scrollArea;}
bool isSliderDown();
virtual void wheelZoomIn() {}
virtual void wheelZoomOut() {}
virtual void setBackgroundColor() {}
void zoomLive (double scale);
void startLiveZoom(int page);
void endLiveZoom();
protected:
ImageWidget *images() {return m_images;}
Document *m_document = NULL;
bool isImageVisible(int nPage);
public slots:
void sliderReleasedSlot();
void valueChangedSlot(int val);
void onRenderTimer();
virtual void onScrollingTimer() {}
signals:
void imagesReady();
void startRender();
void finishRender();
private:
void renderVisibleImages(bool lowRes=false);
void renderImage(int index, bool lowRes);
void onImagesReady();
void renderVisibleImagesLow();
QScrollArea *m_scrollArea = NULL;
ImageWidget *m_images = NULL;
bool m_imagesBuilt = false;
double m_scale = 1.0;
bool m_showAnnotations = true;
bool m_showLinks = false;
QTimer *m_rendertimer = NULL;
double start_scale;
int start_page;
bool liveScrolling = false;
};
#endif // SCROLLINGIMAGELIST_H