Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/abstractimageview.h
Show All 38 Lines | |||||
39 | class AbstractImageView : public QGraphicsWidget | 39 | class AbstractImageView : public QGraphicsWidget | ||
40 | { | 40 | { | ||
41 | Q_OBJECT | 41 | Q_OBJECT | ||
42 | public: | 42 | public: | ||
43 | enum UpdateType { | 43 | enum UpdateType { | ||
44 | UpdateIfNecessary, | 44 | UpdateIfNecessary, | ||
45 | ForceUpdate | 45 | ForceUpdate | ||
46 | }; | 46 | }; | ||
47 | enum AlphaBackgroundMode { | ||||
48 | AlphaBackgroundCheckBoard, | ||||
49 | AlphaBackgroundSolid | ||||
50 | }; | ||||
51 | | ||||
47 | AbstractImageView(QGraphicsItem* parent); | 52 | AbstractImageView(QGraphicsItem* parent); | ||
48 | ~AbstractImageView(); | 53 | ~AbstractImageView(); | ||
49 | 54 | | |||
50 | qreal zoom() const; | 55 | qreal zoom() const; | ||
51 | 56 | | |||
52 | virtual void setZoom(qreal zoom, const QPointF& center = QPointF(-1, -1), UpdateType updateType = UpdateIfNecessary); | 57 | virtual void setZoom(qreal zoom, const QPointF& center = QPointF(-1, -1), UpdateType updateType = UpdateIfNecessary); | ||
53 | 58 | | |||
54 | bool zoomToFit() const; | 59 | bool zoomToFit() const; | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 110 | Q_SIGNALS: | |||
110 | void zoomOutRequested(const QPointF&); | 115 | void zoomOutRequested(const QPointF&); | ||
111 | void scrollPosChanged(); | 116 | void scrollPosChanged(); | ||
112 | void completed(); | 117 | void completed(); | ||
113 | void previousImageRequested(); | 118 | void previousImageRequested(); | ||
114 | void nextImageRequested(); | 119 | void nextImageRequested(); | ||
115 | void toggleFullScreenRequested(); | 120 | void toggleFullScreenRequested(); | ||
116 | 121 | | |||
117 | protected: | 122 | protected: | ||
123 | virtual void setAlphaBackgroundMode(AlphaBackgroundMode mode) = 0; | ||||
124 | virtual void setAlphaBackgroundColor(const QColor& color) = 0; | ||||
125 | const QPixmap& alphaBackgroundTexture() const; | ||||
126 | | ||||
118 | virtual void loadFromDocument() = 0; | 127 | virtual void loadFromDocument() = 0; | ||
119 | virtual void onZoomChanged() = 0; | 128 | virtual void onZoomChanged() = 0; | ||
120 | /** | 129 | /** | ||
121 | * Called when the offset changes. | 130 | * Called when the offset changes. | ||
122 | * Note: to avoid multiple adjustments, this is not called if zoom changes! | 131 | * Note: to avoid multiple adjustments, this is not called if zoom changes! | ||
123 | */ | 132 | */ | ||
124 | virtual void onImageOffsetChanged() = 0; | 133 | virtual void onImageOffsetChanged() = 0; | ||
125 | /** | 134 | /** | ||
Show All 22 Lines |