46
48
* This widget can display various documents, using an instance of
47
49
* AbstractDocumentViewAdapter
49
class GWENVIEWLIB_EXPORT DocumentView : public QWidget {
51
Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
52
Q_PROPERTY(bool zoomToFit READ zoomToFit WRITE setZoomToFit NOTIFY zoomToFitChanged)
53
Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged)
51
class GWENVIEWLIB_EXPORT DocumentView : public QGraphicsWidget
54
Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
55
Q_PROPERTY(bool zoomToFit READ zoomToFit WRITE setZoomToFit NOTIFY zoomToFitChanged)
56
Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged)
58
DocumentView(QWidget* parent, KActionCollection*);
61
AbstractDocumentViewAdapter* adapter() const;
63
Document::Ptr document() const;
67
void openUrl(const KUrl&);
73
qreal minimumZoom() const;
77
bool isCurrent() const;
79
void setCurrent(bool);
81
void setCompareMode(bool);
83
bool zoomToFit() const;
85
QPoint position() const;
63
* Create a new view attached to scene. We need the scene to be able to
64
* install scene event filters.
66
DocumentView(QGraphicsScene* scene);
69
Document::Ptr document() const;
73
void openUrl(const KUrl&);
76
* Tells the current adapter to load its config. Used when the user changed
77
* the config while the view was visible.
79
void loadAdapterConfig();
82
* Returns true if an adapter is loaded (note: adapters are also used to
83
* display error messages!)
89
qreal minimumZoom() const;
93
bool isCurrent() const;
95
void setCurrent(bool);
97
void setCompareMode(bool);
99
bool zoomToFit() const;
101
QPoint position() const;
104
* Returns the RasterImageView of the current adapter, if it has one
106
RasterImageView* imageView() const;
108
AbstractRasterImageViewTool* currentTool() const;
110
void moveTo(const QRect&);
111
void moveToAnimated(const QRect&);
115
void setGeometry(const QRectF& rect); // reimp
90
void setZoomToFit(bool);
92
void setPosition(const QPoint&);
120
void setZoomToFit(bool);
122
void setPosition(const QPoint&);
96
* Emitted when the part has finished loading
100
void previousImageRequested();
102
void nextImageRequested();
104
void captionUpdateRequested(const QString&);
106
void toggleFullScreenRequested();
108
void videoFinished();
110
void minimumZoomChanged(qreal);
112
void zoomChanged(qreal);
114
void adapterChanged();
116
void focused(DocumentView*);
118
void zoomToFitChanged(bool);
120
void positionChanged();
126
* Emitted when the part has finished loading
130
void previousImageRequested();
132
void nextImageRequested();
134
void captionUpdateRequested(const QString&);
136
void toggleFullScreenRequested();
138
void videoFinished();
140
void minimumZoomChanged(qreal);
142
void zoomChanged(qreal);
144
void adapterChanged();
146
void focused(DocumentView*);
148
void zoomToFitChanged(bool);
150
void positionChanged();
152
void hudTrashClicked(DocumentView*);
153
void hudDeselectClicked(DocumentView*);
155
void animationFinished(DocumentView*);
157
void contextMenuRequested();
159
void currentToolChanged(AbstractRasterImageViewTool*);
123
virtual bool eventFilter(QObject*, QEvent* event);
162
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
125
virtual void paintEvent(QPaintEvent*);
164
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
165
void wheelEvent(QGraphicsSceneWheelEvent* event);
166
void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
167
bool sceneEventFilter(QGraphicsItem*, QEvent*);
128
void finishOpenUrl();
130
void slotLoadingFailed();
132
void zoomActualSize();
134
void zoomIn(const QPoint& center = QPoint(-1,-1));
135
void zoomOut(const QPoint& center = QPoint(-1,-1));
137
void slotZoomChanged(qreal);
139
void slotBusyChanged(const KUrl&, bool);
141
void slotKeyPressed(Qt::Key key, bool pressed);
170
void finishOpenUrl();
172
void slotLoadingFailed();
174
void zoomActualSize();
176
void zoomIn(const QPointF& center = QPointF(-1, -1));
177
void zoomOut(const QPointF& center = QPointF(-1, -1));
179
void slotZoomChanged(qreal);
181
void slotBusyChanged(const KUrl&, bool);
183
void emitHudTrashClicked();
184
void emitHudDeselectClicked();
187
void slotAnimationFinished();
144
friend struct DocumentViewPrivate;
145
DocumentViewPrivate* const d;
190
friend struct DocumentViewPrivate;
191
DocumentViewPrivate* const d;
147
void createAdapterForDocument();
193
void createAdapterForDocument();
153
198
#endif /* DOCUMENTVIEW_H */