20 #ifndef PLASMA_SCROLLWIDGET_H
21 #define PLASMA_SCROLLWIDGET_H
23 #include <QtCore/QAbstractAnimation>
24 #include <QtGui/QGraphicsWidget>
32 class ScrollWidgetPrivate;
47 Q_PROPERTY(Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy)
48 Q_PROPERTY(Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy)
49 Q_PROPERTY(
bool overflowBordersVisible READ overflowBordersVisible WRITE setOverflowBordersVisible)
50 Q_PROPERTY(QPointF scrollPosition READ scrollPosition WRITE setScrollPosition)
51 Q_PROPERTY(QSizeF contentsSize READ contentsSize)
52 Q_PROPERTY(QRectF viewportGeometry READ viewportGeometry)
53 Q_PROPERTY(QSizeF snapSize READ snapSize WRITE setSnapSize)
54 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
55 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
56 Q_PROPERTY(
bool overShoot READ hasOverShoot WRITE setOverShoot)
92 void setAlignment(Qt::Alignment align);
98 Qt::Alignment alignment() const;
106 void setOverShoot(
bool enable);
112 bool hasOverShoot() const;
119 void setHorizontalScrollBarPolicy(const Qt::ScrollBarPolicy policy);
124 Qt::ScrollBarPolicy horizontalScrollBarPolicy() const;
131 void setVerticalScrollBarPolicy(const Qt::ScrollBarPolicy policy);
136 Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
143 bool overflowBordersVisible() const;
152 void setOverflowBordersVisible(const
bool visible);
160 Q_INVOKABLE
void ensureRectVisible(const QRectF &rect);
168 Q_INVOKABLE
void ensureItemVisible(QGraphicsItem *item);
184 #ifndef KDE_NO_DEPRECATED
185 KDE_DEPRECATED Q_INVOKABLE
void registerAsDragHandle(
QGraphicsWidget *item);
196 #ifndef KDE_NO_DEPRECATED
197 KDE_DEPRECATED Q_INVOKABLE
void unregisterAsDragHandle(
QGraphicsWidget *item);
204 QRectF viewportGeometry()
const;
211 QSizeF contentsSize()
const;
217 void setScrollPosition(
const QPointF &position);
223 QPointF scrollPosition()
const;
232 void setSnapSize(
const QSizeF &size);
238 QSizeF snapSize()
const;
245 void setStyleSheet(
const QString &stylesheet);
250 QString styleSheet()
const;
262 void scrollStateChanged(QAbstractAnimation::State newState,
263 QAbstractAnimation::State oldState);
270 void viewportGeometryChanged(
const QRectF &geomety);
274 void resizeEvent(QGraphicsSceneResizeEvent *event);
276 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
277 void mousePressEvent(QGraphicsSceneMouseEvent *event);
278 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
279 void keyPressEvent(QKeyEvent *event);
280 void wheelEvent(QGraphicsSceneWheelEvent *event);
281 bool eventFilter(
QObject *watched, QEvent *event);
282 void focusInEvent(QFocusEvent *event);
283 QSizeF sizeHint(Qt::SizeHint which,
const QSizeF & constraint)
const;
284 bool sceneEventFilter(QGraphicsItem *i, QEvent *e);
287 ScrollWidgetPrivate *
const d;
289 Q_PRIVATE_SLOT(d,
void verticalScroll(
int value))
290 Q_PRIVATE_SLOT(d,
void horizontalScroll(
int value))
291 Q_PRIVATE_SLOT(d,
void makeRectVisible())
292 Q_PRIVATE_SLOT(d,
void makeItemVisible())
293 Q_PRIVATE_SLOT(d,
void adjustScrollbars())
294 Q_PRIVATE_SLOT(d,
void fixupX())
295 Q_PRIVATE_SLOT(d,
void fixupY())
296 Q_PRIVATE_SLOT(d,
void setScrollX())
297 Q_PRIVATE_SLOT(d,
void setScrollY())
299 friend class ScrollWidgetPrivate;
304 #endif // multiple inclusion guard