Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/documentview.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | * This widget can display various documents, using an instance of | 46 | * This widget can display various documents, using an instance of | ||
47 | * AbstractDocumentViewAdapter | 47 | * AbstractDocumentViewAdapter | ||
48 | */ | 48 | */ | ||
49 | class GWENVIEWLIB_EXPORT DocumentView : public QGraphicsWidget | 49 | class GWENVIEWLIB_EXPORT DocumentView : public QGraphicsWidget | ||
50 | { | 50 | { | ||
51 | Q_OBJECT | 51 | Q_OBJECT | ||
52 | Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged) | 52 | Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged) | ||
53 | Q_PROPERTY(bool zoomToFit READ zoomToFit WRITE setZoomToFit NOTIFY zoomToFitChanged) | 53 | Q_PROPERTY(bool zoomToFit READ zoomToFit WRITE setZoomToFit NOTIFY zoomToFitChanged) | ||
54 | Q_PROPERTY(bool zoomToFitWidth READ zoomToFitWidth WRITE setZoomToFitWidth NOTIFY zoomToFitWidthChanged) | 54 | Q_PROPERTY(bool zoomToFill READ zoomToFill WRITE setZoomToFill NOTIFY zoomToFillChanged) | ||
55 | Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged) | 55 | Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged) | ||
56 | public: | 56 | public: | ||
57 | static const int MaximumZoom; | 57 | static const int MaximumZoom; | ||
58 | static const int AnimDuration; | 58 | static const int AnimDuration; | ||
59 | 59 | | |||
60 | struct Setup { | 60 | struct Setup { | ||
61 | Setup() | 61 | Setup() | ||
62 | : valid(false) | 62 | : valid(false) | ||
63 | , zoomToFit(true) | 63 | , zoomToFit(true) | ||
64 | , zoomToFitWidth(false) | 64 | , zoomToFill(false) | ||
65 | , zoom(0) | 65 | , zoom(0) | ||
66 | {} | 66 | {} | ||
67 | bool valid:1; | 67 | bool valid:1; | ||
68 | bool zoomToFit:1; | 68 | bool zoomToFit:1; | ||
69 | bool zoomToFitWidth:1; | 69 | bool zoomToFill:1; | ||
70 | qreal zoom; | 70 | qreal zoom; | ||
71 | QPointF position; | 71 | QPointF position; | ||
72 | }; | 72 | }; | ||
73 | 73 | | |||
74 | enum AnimationMethod { | 74 | enum AnimationMethod { | ||
75 | NoAnimation, | 75 | NoAnimation, | ||
76 | SoftwareAnimation, | 76 | SoftwareAnimation, | ||
77 | GLAnimation | 77 | GLAnimation | ||
Show All 29 Lines | |||||
107 | bool isCurrent() const; | 107 | bool isCurrent() const; | ||
108 | 108 | | |||
109 | void setCurrent(bool); | 109 | void setCurrent(bool); | ||
110 | 110 | | |||
111 | void setCompareMode(bool); | 111 | void setCompareMode(bool); | ||
112 | 112 | | |||
113 | bool zoomToFit() const; | 113 | bool zoomToFit() const; | ||
114 | 114 | | |||
115 | bool zoomToFitWidth() const; | 115 | bool zoomToFill() const; | ||
116 | 116 | | |||
117 | QPoint position() const; | 117 | QPoint position() const; | ||
118 | 118 | | |||
119 | /** | 119 | /** | ||
120 | * Returns the RasterImageView of the current adapter, if it has one | 120 | * Returns the RasterImageView of the current adapter, if it has one | ||
121 | */ | 121 | */ | ||
122 | RasterImageView* imageView() const; | 122 | RasterImageView* imageView() const; | ||
123 | 123 | | |||
Show All 18 Lines | |||||
142 | 142 | | |||
143 | bool isAnimated() const; | 143 | bool isAnimated() const; | ||
144 | 144 | | |||
145 | public Q_SLOTS: | 145 | public Q_SLOTS: | ||
146 | void setZoom(qreal); | 146 | void setZoom(qreal); | ||
147 | 147 | | |||
148 | void setZoomToFit(bool); | 148 | void setZoomToFit(bool); | ||
149 | 149 | | |||
150 | void setZoomToFitWidth(bool); | 150 | void setZoomToFill(bool); | ||
151 | 151 | | |||
152 | void setPosition(const QPoint&); | 152 | void setPosition(const QPoint&); | ||
153 | 153 | | |||
154 | void hideAndDeleteLater(); | 154 | void hideAndDeleteLater(); | ||
155 | 155 | | |||
156 | Q_SIGNALS: | 156 | Q_SIGNALS: | ||
157 | /** | 157 | /** | ||
158 | * Emitted when the part has finished loading | 158 | * Emitted when the part has finished loading | ||
Show All 15 Lines | |||||
174 | void zoomChanged(qreal); | 174 | void zoomChanged(qreal); | ||
175 | 175 | | |||
176 | void adapterChanged(); | 176 | void adapterChanged(); | ||
177 | 177 | | |||
178 | void focused(DocumentView*); | 178 | void focused(DocumentView*); | ||
179 | 179 | | |||
180 | void zoomToFitChanged(bool); | 180 | void zoomToFitChanged(bool); | ||
181 | 181 | | |||
182 | void zoomToFitWidthChanged(bool); | 182 | void zoomToFillChanged(bool); | ||
183 | 183 | | |||
184 | void positionChanged(); | 184 | void positionChanged(); | ||
185 | 185 | | |||
186 | void hudTrashClicked(DocumentView*); | 186 | void hudTrashClicked(DocumentView*); | ||
187 | void hudDeselectClicked(DocumentView*); | 187 | void hudDeselectClicked(DocumentView*); | ||
188 | 188 | | |||
189 | void fadeInFinished(DocumentView*); | 189 | void fadeInFinished(DocumentView*); | ||
190 | 190 | | |||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |